platform/upstream/mesa.git
2 years agovulkan: spec update to 1.3.211
Mike Blumenkrantz [Tue, 5 Apr 2022 12:36:26 +0000 (08:36 -0400)]
vulkan: spec update to 1.3.211

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15752>

2 years agopanfrost: Don't crash on panfrost_bo_create() with size==0 invocation
Roman Stratiienko [Mon, 4 Apr 2022 17:52:59 +0000 (20:52 +0300)]
panfrost: Don't crash on panfrost_bo_create() with size==0 invocation

1. Clamp bucket_index from both ends to avoid returning negative index.
2. Return NULL in case BO allocation/fetching failure to prevent invalid
   bo mapping.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6247
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15748>

2 years agoradv: only declare dynamic states that are used by internal operations
Samuel Pitoiset [Fri, 1 Apr 2022 09:44:26 +0000 (11:44 +0200)]
radv: only declare dynamic states that are used by internal operations

Initialize some default static PSO states instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15729>

2 years agoradv: use radv_dynamic_state for saving/restoring meta operations
Samuel Pitoiset [Mon, 4 Apr 2022 06:11:40 +0000 (08:11 +0200)]
radv: use radv_dynamic_state for saving/restoring meta operations

Instead of duplicating every fields.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15729>

2 years agoradv: save/restore more dynamic states during internal driver operations
Samuel Pitoiset [Mon, 4 Apr 2022 06:09:56 +0000 (08:09 +0200)]
radv: save/restore more dynamic states during internal driver operations

This doesn't fix anything known but it could happen in theory.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15729>

2 years agoradv/ci: update CI lists against CTS 1.3.1.1
Samuel Pitoiset [Tue, 5 Apr 2022 06:37:27 +0000 (08:37 +0200)]
radv/ci: update CI lists against CTS 1.3.1.1

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15745>

2 years agovenus: add VK_EXT_{conditional_rendering,index_type_uint8} extensions
Igor Torrente [Tue, 29 Mar 2022 14:59:49 +0000 (11:59 -0300)]
venus: add VK_EXT_{conditional_rendering,index_type_uint8} extensions

Implements all the necessary code in the device initialization
and extensions functions.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15652>

2 years agovenus: Update venus-protocol to add two new extensions
Igor Torrente [Tue, 29 Mar 2022 13:39:25 +0000 (10:39 -0300)]
venus: Update venus-protocol to add two new extensions

These are the changes automatically generated from the venus-protocol
repository.

Update the file to add `VK_EXT_index_type_uint8` and
`VK_EXT_conditional_rendering`

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15652>

2 years agovenus: workaround an ANGLE assumption on FORMAT_IMPLEMENTATION_DEFINED
Yiwei Zhang [Sat, 2 Apr 2022 06:10:14 +0000 (06:10 +0000)]
venus: workaround an ANGLE assumption on FORMAT_IMPLEMENTATION_DEFINED

ANGLE expects VK_FORMAT_UNDEFINED to be returned for such AHB prop
query.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15721>

2 years agoci: bump VK-GL-CTS to 1.3.1.1
Omar Akkila [Tue, 29 Mar 2022 16:44:17 +0000 (12:44 -0400)]
ci: bump VK-GL-CTS to 1.3.1.1

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15668>

2 years agoanv: Advertise two more formats
Jason Ekstrand [Mon, 28 Mar 2022 23:36:39 +0000 (18:36 -0500)]
anv: Advertise two more formats

These both require swizzling so border colors won't work.  However,
they're conveniently in the list of formats for which custom border
colors require you to specify a format in the sampler.  That list
constists of:

    - VK_FORMAT_B4G4R4A4_UNORM_PACK16
    - VK_FORMAT_B5G6R5_UNORM_PACK16
    - VK_FORMAT_B5G5R5A1_UNORM_PACK16

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6226
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15624>

2 years agoanv: Generalize border color swizzles
Jason Ekstrand [Tue, 29 Mar 2022 15:55:00 +0000 (10:55 -0500)]
anv: Generalize border color swizzles

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15624>

2 years agoanv: Disallow blending on swizzled formats
Jason Ekstrand [Tue, 29 Mar 2022 21:35:49 +0000 (16:35 -0500)]
anv: Disallow blending on swizzled formats

Fixes: c20f78dc5d7e ("anv: Support swizzled formats.")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15624>

2 years agointel/isl: Add a helper for swizzling color values
Jason Ekstrand [Tue, 29 Mar 2022 15:42:08 +0000 (10:42 -0500)]
intel/isl: Add a helper for swizzling color values

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15624>

2 years agovulkan/queue: Destroy wait temps if they are skipped
Benjamin Cheng [Sun, 3 Apr 2022 23:03:56 +0000 (19:03 -0400)]
vulkan/queue: Destroy wait temps if they are skipped

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6223
Fixes: 8a11d2a31bf9 ("vulkan: Add a dummy sync type")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15727>

2 years agoaco: don't use v_mad_mix on GFX9 if 16-bit denormals must be preserved
Rhys Perry [Fri, 1 Apr 2022 18:51:55 +0000 (19:51 +0100)]
aco: don't use v_mad_mix on GFX9 if 16-bit denormals must be preserved

This probably effectively disables the v_mad_mix optimization on GFX9.

fossil-db (Vega):
Totals from 11545 (7.15% of 161366) affected shaders:
MaxWaves: 43025 -> 42780 (-0.57%); split: +0.06%, -0.63%
Instrs: 18571635 -> 18734201 (+0.88%); split: -0.00%, +0.88%
CodeSize: 96483568 -> 96611012 (+0.13%); split: -0.11%, +0.24%
SGPRs: 1079056 -> 1077616 (-0.13%); split: -0.14%, +0.01%
VGPRs: 819248 -> 821868 (+0.32%); split: -0.04%, +0.36%
SpillSGPRs: 13313 -> 12464 (-6.38%)
Latency: 293804093 -> 295046122 (+0.42%); split: -0.09%, +0.51%
InvThroughput: 110002239 -> 110994978 (+0.90%); split: -0.03%, +0.93%
VClause: 342458 -> 342596 (+0.04%); split: -0.12%, +0.16%
SClause: 648566 -> 648046 (-0.08%); split: -0.12%, +0.04%
Copies: 1728225 -> 1726679 (-0.09%); split: -0.66%, +0.57%
Branches: 552973 -> 552963 (-0.00%); split: -0.02%, +0.02%
PreSGPRs: 862360 -> 856820 (-0.64%); split: -0.69%, +0.05%
PreVGPRs: 773689 -> 776818 (+0.40%); split: -0.02%, +0.42%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6178
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15718>

2 years agoiris: Replace unconditional QBO flush with iris_dirty_for_history().
Francisco Jerez [Fri, 7 Feb 2020 04:58:40 +0000 (20:58 -0800)]
iris: Replace unconditional QBO flush with iris_dirty_for_history().

We can now use the same cache tracking mechanism for synchronizing QBO
writes instead of the unconditional PIPE_CONTROL performed currently,
which is unable to invalidate any incoherent caches which may contain
stale data for the buffer object.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15738>

2 years agoiris: Remove remaining history flushes.
Francisco Jerez [Thu, 6 Feb 2020 02:26:39 +0000 (18:26 -0800)]
iris: Remove remaining history flushes.

This removes a couple of remaining history flushes which were
open-coded instead of using the iris_flush_and_dirty_for_history()
helper.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15738>

2 years agoiris: Demote all callers of iris_flush_and_dirty_for_history() to iris_dirty_for_hist...
Francisco Jerez [Thu, 30 Apr 2020 22:11:19 +0000 (15:11 -0700)]
iris: Demote all callers of iris_flush_and_dirty_for_history() to iris_dirty_for_history().

The unconditional flushing performed by
iris_flush_and_dirty_for_history() is now redundant with the memory
barriers introduced previously in this series, which should be in a
better position to determine from which domain the buffer will
actually be used in the future, and whether an additional flush or
invalidation is required or redundant with other PIPE_CONTROL commands
emitted elsewhere.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15738>

2 years agoaux/trace: dump format in set_shader_images
Mike Blumenkrantz [Wed, 9 Mar 2022 19:36:55 +0000 (14:36 -0500)]
aux/trace: dump format in set_shader_images

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15323>

2 years agoci/freedreno: Reduce concurrency when replaying traces on a630
Tomeu Vizoso [Thu, 31 Mar 2022 03:54:18 +0000 (05:54 +0200)]
ci/freedreno: Reduce concurrency when replaying traces on a630

We are running out of memory when replaying traces sometimes, reduce the
number of concurrent retrace processes.

   Mesa: User error: GL_OUT_OF_MEMORY in glReadPixels
   warning: GL_OUT_OF_MEMORY while getting snapshot
   1074335: warning: failed to get snapshot

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/20519522

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15682>

2 years agov3d: fix some leaks in cache
Juan A. Suarez Romero [Mon, 4 Apr 2022 08:21:21 +0000 (10:21 +0200)]
v3d: fix some leaks in cache

Fix a couple of leaks introduced when adding support for on-disk shader
cache.

Fixes: 4468db20f7f ("v3d: add support for on-disk shader cache")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15733>

2 years agov3dv: fix limits for inline uniform blocks
Iago Toral Quiroga [Mon, 4 Apr 2022 08:51:50 +0000 (10:51 +0200)]
v3dv: fix limits for inline uniform blocks

We don't support 'Update After Bind', however, the limits for this
model also include the ones without it. See the with or without remark
in the spec below:

"maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks is similar to
 maxPerStageDescriptorInlineUniformBlocks but counts descriptor bindings
 from descriptor sets created with or without the
 VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set."

Fixes:
dEQP-VK.api.info.vulkan1p2_limits_validation.ext_inline_uniform_block

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15732>

2 years agoRevert "ci/panfrost: Disable some jobs due to a lab failure"
Tomeu Vizoso [Mon, 4 Apr 2022 06:59:16 +0000 (08:59 +0200)]
Revert "ci/panfrost: Disable some jobs due to a lab failure"

Machines are back.

This reverts commit b5fd1fddd9cf24e9250b659130057289d5080746.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15730>

2 years agoradv: save/restore the stencil reference during internal driver operations
Samuel Pitoiset [Thu, 31 Mar 2022 18:20:35 +0000 (20:20 +0200)]
radv: save/restore the stencil reference during internal driver operations

I think I should improve this to be more robust.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6243
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15700>

2 years agoradv: fix cleaning the image view for CmdCopyImageToBuffer()
Samuel Pitoiset [Thu, 31 Mar 2022 16:23:31 +0000 (18:23 +0200)]
radv: fix cleaning the image view for CmdCopyImageToBuffer()

Fixes: f07e67272e8 ("radv: fix vk_object_base_init/finish for internal image views")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15707>

2 years agopvr: Add stricter type checking in pvr_csb_pack().
Karmjit Mahil [Mon, 14 Mar 2022 11:46:54 +0000 (11:46 +0000)]
pvr: Add stricter type checking in pvr_csb_pack().

Since the packing functions generated by csbgen use a void pointer
for the buffer in which to pack, it's possible to easily write out
of bounds. This commits attempts to reduce the chances by
having the pack macro check that the pointer passed points to an
element sized equally to the state word being packed. Catching
these errors earlier.

As can be seen in this commit, there already was a case of this:
"pds_ctrl". The word size is meant to be 64 bits but the pointer
was pointing to a 32 bit field.

Although it's fine for the word size to be smaller than the
storage pointed to by the pointer, this is not allowed just to
be extra careful.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15687>

2 years agoradv: Replace magic constants with enum values
Konstantin Seurer [Sun, 3 Apr 2022 09:24:29 +0000 (11:24 +0200)]
radv: Replace magic constants with enum values

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15722>

2 years agoradv: Advertise ray primitive culling
Konstantin Seurer [Sat, 2 Apr 2022 20:17:15 +0000 (22:17 +0200)]
radv: Advertise ray primitive culling

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15722>

2 years agoradv: Fully implement ray primitive culling
Konstantin Seurer [Sat, 2 Apr 2022 20:16:16 +0000 (22:16 +0200)]
radv: Fully implement ray primitive culling

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15722>

2 years agoturnip: Allow image access on swapped formats.
Emma Anholt [Fri, 4 Mar 2022 19:57:32 +0000 (11:57 -0800)]
turnip: Allow image access on swapped formats.

This is apparently something that gamescope would like to have, and the
CTS's test coverage is happy with it.

Fixes: #6011 (we hope)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>

2 years agoturnip: Disable tiling on 1D images.
Emma Anholt [Wed, 9 Mar 2022 01:17:00 +0000 (17:17 -0800)]
turnip: Disable tiling on 1D images.

If we know the height is 1, then it would be a waste to align each
miplevel to tile height.  For non-mipmapped textures, it doesn't save us
memory (since you still align to 4 on the last miplevel), but it should be
better cache locality by not loading those unused lines.

Incidentally, this gets us some more coverage of swap != WZYX cases in CTS
tests, which often use optimal tiling without also testing linear.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>

2 years agofreedreno/a6xx: Set the color_swap field for storage descriptors.
Emma Anholt [Wed, 9 Mar 2022 18:00:34 +0000 (10:00 -0800)]
freedreno/a6xx: Set the color_swap field for storage descriptors.

This field does appear to work as expected: with 1D/1DArray turnip storage
images switched to be always linear, it fixes the dEQP-VK.image.*store*
tests using a color swapped format (once we allow color swap).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>

2 years agoturnip: Add support for VK_KHR_format_feature_flags2.
Emma Anholt [Fri, 4 Mar 2022 20:29:52 +0000 (12:29 -0800)]
turnip: Add support for VK_KHR_format_feature_flags2.

This reports all of our storage formats as supporting read/write without
format, since we don't have any in-shader format conversions.  Similarly,
shadow comparisons were already supported on all the depth formats.

This extension is required for VK 1.3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15293>

2 years agonir_to_tgsi: Add support for nir_intrinsic_image_samples.
Emma Anholt [Fri, 11 Feb 2022 21:38:28 +0000 (13:38 -0800)]
nir_to_tgsi: Add support for nir_intrinsic_image_samples.

Found in 1 piglit test on r600.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15627>

2 years agolima/ci: enable piglit in lima CI
Erico Nunes [Sun, 5 Dec 2021 22:33:50 +0000 (23:33 +0100)]
lima/ci: enable piglit in lima CI

There are spare boards for it and the results appear stable.
Dividing the load in 2 parallel runs results in a run time
of around 10 minutes each.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15598>

2 years agolima/ci: enable CI again
Erico Nunes [Thu, 2 Dec 2021 20:12:00 +0000 (21:12 +0100)]
lima/ci: enable CI again

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15598>

2 years agolima/ci: update deqp results
Erico Nunes [Fri, 11 Mar 2022 13:21:24 +0000 (14:21 +0100)]
lima/ci: update deqp results

Unfortunately some regressions sneaked in while CI was down.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15598>

2 years agoturnip: Use correct type for OUTARRAY in FormatProperties2
Danylo Piliaiev [Thu, 31 Mar 2022 13:26:55 +0000 (16:26 +0300)]
turnip: Use correct type for OUTARRAY in FormatProperties2

Fixes: 799a9db24c334713c0ba5995f59b7db5f782e85e
("turnip: Stop using VK_OUTARRAY_MAKE()")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15694>

2 years agofreedreno/registers: update dsi registers to support dsc
Vinod Koul [Fri, 1 Apr 2022 11:23:04 +0000 (16:53 +0530)]
freedreno/registers: update dsi registers to support dsc

Display Stream compression (DSC) compresses the display stream in
host which is later decoded by panel. This requires addition of 3 new
DSI registers to support DSC over DSI.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14967>

2 years agor300: don't assume position is always OUT[0] in rc_copy_output
Pavel Ondračka [Thu, 31 Mar 2022 14:33:50 +0000 (16:33 +0200)]
r300: don't assume position is always OUT[0] in rc_copy_output

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15677>

2 years agor300: set PVS_XYZW_VALID_INST properly to last position write
Pavel Ondračka [Fri, 4 Mar 2022 09:27:54 +0000 (10:27 +0100)]
r300: set PVS_XYZW_VALID_INST properly to last position write

This is a potential performance optimization, from the docs:
The PVS Instruction which updates the clip coordinatea position for
the last time. This value is used to lower the processing priority
while trivial clip and back-face culling decisions are made. This
field must be set to valid instruction.

Right now it is set at the last instruction. However, there is no
measurable performance effect in either Unigine Sanctuary, Lightsmark
or GLmark.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6045
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15677>

2 years agoradv: Add more BVH vertex formats.
Bas Nieuwenhuizen [Sat, 19 Mar 2022 20:07:49 +0000 (21:07 +0100)]
radv: Add more BVH vertex formats.

AFAIU this is needed for DXR 1.1 with vkd3d-proton.

Reviewed-by: Samuel Pitoiset<samuel.pitoiset@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15475>

2 years agonir_to_tgsi: Handle blocks defined as arrays of arrays
Corentin Noël [Fri, 1 Apr 2022 14:34:13 +0000 (16:34 +0200)]
nir_to_tgsi: Handle blocks defined as arrays of arrays

Make sure to take all the array sizes into account when generating the TGSI.

Makes the `piglit.spec@arb_arrays_of_arrays@execution@ubo@fs-const-explicit-binding`
test pass

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15713>

2 years agoci/panfrost: Disable some jobs due to a lab failure
Tomeu Vizoso [Fri, 1 Apr 2022 13:44:36 +0000 (15:44 +0200)]
ci/panfrost: Disable some jobs due to a lab failure

A dispatcher has had a hard disk failure and these devices are offline
now.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15711>

2 years agoaco/optimizer: check recursively if we can eliminate s_and exec
Daniel Schürmann [Wed, 30 Mar 2022 16:01:45 +0000 (18:01 +0200)]
aco/optimizer: check recursively if we can eliminate s_and exec

Totals from 2860 (2.12% of 134913) affected shaders: (GFX10.3)
CodeSize: 5990728 -> 5979164 (-0.19%); split: -0.20%, +0.01%
Instrs: 1094562 -> 1091653 (-0.27%); split: -0.28%, +0.01%
Latency: 8689841 -> 8684523 (-0.06%); split: -0.07%, +0.00%
InvThroughput: 1840533 -> 1840527 (-0.00%); split: -0.00%, +0.00%
SClause: 51437 -> 51439 (+0.00%)
Copies: 82461 -> 82472 (+0.01%)
PreSGPRs: 83136 -> 83172 (+0.04%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15675>

2 years agovirgl: Don't support QUADS natively
Gert Wollny [Thu, 31 Mar 2022 07:23:36 +0000 (09:23 +0200)]
virgl: Don't support QUADS natively

Using quads leads to a rather expensive buffer readback when quads
are stored in display lists, so avoid them altogether.

Closes: #5825

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15683>

2 years agobroadcom/compiler: always enable per-quad on spill operations
Iago Toral Quiroga [Fri, 1 Apr 2022 06:37:34 +0000 (08:37 +0200)]
broadcom/compiler: always enable per-quad on spill operations

This ensures that any channels used for helper invocations are
also spilled/filled correctly.

Alternatively, we could recursively track all temps that get
involved in computing values that are then used in explicit
(dfdx,dfdy) or implicit (texture coordinates for mipmap or
anisotropic filtering, etc) derivatives, and only enable
per-quad on these (or disable spilling of any of these
values).

Fixes:
dEQP-VK.graphicsfuzz.cov-dfdx-dfdy-after-nested-loops

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15705>

2 years agoradv: enable VK_EXT_separate_stencil_usage
Samuel Pitoiset [Wed, 30 Mar 2022 11:24:47 +0000 (13:24 +0200)]
radv: enable VK_EXT_separate_stencil_usage

This extension has been promoted to Vulkan 1.2 which means it has been
silently enabled when we implemented Vulkan 1.2.

Enable it explicitely to make mesamatrix happy and also for consistency.
This extension was designed for potential performance improvements of
MSAA depth/stencil images but it's currently a no-op in RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15665>

2 years agoradv: use the common vk_framebuffer
Samuel Pitoiset [Mon, 28 Mar 2022 13:54:12 +0000 (15:54 +0200)]
radv: use the common vk_framebuffer

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: remove now unused radv_cmd_buffer_{begin,end}_render_pass()
Samuel Pitoiset [Thu, 17 Mar 2022 12:03:07 +0000 (13:03 +0100)]
radv: remove now unused radv_cmd_buffer_{begin,end}_render_pass()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: convert the meta clear path to dynamic rendering
Samuel Pitoiset [Wed, 16 Mar 2022 16:52:35 +0000 (17:52 +0100)]
radv: convert the meta clear path to dynamic rendering

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: convert the meta blit path to dynamic rendering
Samuel Pitoiset [Thu, 17 Mar 2022 09:28:55 +0000 (10:28 +0100)]
radv: convert the meta blit path to dynamic rendering

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: convert the meta resolve HW path to dynamic rendering
Samuel Pitoiset [Thu, 17 Mar 2022 08:51:07 +0000 (09:51 +0100)]
radv: convert the meta resolve HW path to dynamic rendering

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: convert the meta resolve depth/stencil FS path to dynamic rendering
Samuel Pitoiset [Thu, 17 Mar 2022 10:47:35 +0000 (11:47 +0100)]
radv: convert the meta resolve depth/stencil FS path to dynamic rendering

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: convert the meta resolve color FS path to dynamic rendering
Samuel Pitoiset [Mon, 29 Nov 2021 10:48:40 +0000 (11:48 +0100)]
radv: convert the meta resolve color FS path to dynamic rendering

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: convert the meta blit 2d path to dynamic rendering
Samuel Pitoiset [Wed, 16 Mar 2022 16:38:27 +0000 (17:38 +0100)]
radv: convert the meta blit 2d path to dynamic rendering

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: convert the meta fast clear flush path to dynamic rendering
Samuel Pitoiset [Wed, 24 Nov 2021 09:52:07 +0000 (10:52 +0100)]
radv: convert the meta fast clear flush path to dynamic rendering

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: convert the meta depth decompression path to dynamic rendering
Samuel Pitoiset [Wed, 16 Mar 2022 15:07:58 +0000 (16:07 +0100)]
radv: convert the meta depth decompression path to dynamic rendering

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoradv: rework the workaround that disables DCC for incompatible copies
Samuel Pitoiset [Mon, 28 Mar 2022 12:00:43 +0000 (14:00 +0200)]
radv: rework the workaround that disables DCC for incompatible copies

Rely on the image view to avoid using an extra structure for the
render pass. This will allow to convert the meta operations to
dynamic rendering.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15612>

2 years agoutil: Getting u_debug.h not depends on pipe/*
Yonggang Luo [Tue, 29 Mar 2022 22:10:25 +0000 (06:10 +0800)]
util: Getting u_debug.h not depends on pipe/*

Move pipe_debug_type into u_debug.h
Move pipe_debug_callback into u_debug.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>

2 years agoutil: Rename PIPE_DEBUG_TYPE to UTIL_DEBUG_TYPE
Yonggang Luo [Wed, 30 Mar 2022 20:23:56 +0000 (04:23 +0800)]
util: Rename PIPE_DEBUG_TYPE to UTIL_DEBUG_TYPE

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>

2 years agoutil: Rename pipe_debug_type to util_debug_type
Yonggang Luo [Wed, 30 Mar 2022 20:23:16 +0000 (04:23 +0800)]
util: Rename pipe_debug_type  to util_debug_type

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>

2 years agopipe: place `struct util_debug_callback` at the proper place in p_context.h
Yonggang Luo [Wed, 30 Mar 2022 22:58:36 +0000 (06:58 +0800)]
pipe: place `struct util_debug_callback` at the proper place in p_context.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>

2 years agoutil: Rename pipe_debug_callback to util_debug_callback
Yonggang Luo [Wed, 30 Mar 2022 20:22:26 +0000 (04:22 +0800)]
util: Rename pipe_debug_callback to util_debug_callback

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>

2 years agoutil: Rename pipe_debug_message to util_debug_message
Yonggang Luo [Wed, 30 Mar 2022 20:21:45 +0000 (04:21 +0800)]
util: Rename pipe_debug_message to util_debug_message

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15657>

2 years agolavapipe: set LVP_POISON_MEMORY for ci
Mike Blumenkrantz [Mon, 28 Mar 2022 21:41:12 +0000 (17:41 -0400)]
lavapipe: set LVP_POISON_MEMORY for ci

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15620>

2 years agozink: set LVP_POISON_MEMORY for ci
Mike Blumenkrantz [Mon, 28 Mar 2022 21:41:05 +0000 (17:41 -0400)]
zink: set LVP_POISON_MEMORY for ci

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15620>

2 years agolavapipe: add an env var to enable poisoning memory allocations
Mike Blumenkrantz [Mon, 28 Mar 2022 21:39:08 +0000 (17:39 -0400)]
lavapipe: add an env var to enable poisoning memory allocations

it's not random, but it's definitely not zero or any other expected
value, which means it's going to break anything that was passing due to lucky
uninitialized values

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15620>

2 years agollvmpipe: fix nr_sampler_view in key creation.
Dave Airlie [Sun, 27 Mar 2022 23:20:27 +0000 (09:20 +1000)]
llvmpipe: fix nr_sampler_view in key creation.

This was doing MAX2() but nr_sampler_views hasn't been initialised
yet.

Fixes: 690cc3bb803a ("llvmpipe: overhaul fs/cs variant keys to be simpler.")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15603>

2 years agozink/query: rewrite the query handling code to pass validation.
Dave Airlie [Mon, 28 Mar 2022 06:08:21 +0000 (16:08 +1000)]
zink/query: rewrite the query handling code to pass validation.

The current code was allowing multiple query pools of the same type to be
active on the same commmand buffer which creates validation warnings.

Restructure the query handling, so the query pools are allocated on the
context on first use, then have queries allocate query_id from those pools.

This approach creates a new start dynamic array that contains each time a
vulkan query is started for a gallium query, and holds the flags for it rather
than storing them in a massive array.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>

2 years agozink/query: only reset the range of queries in use.
Dave Airlie [Mon, 28 Mar 2022 05:16:10 +0000 (15:16 +1000)]
zink/query: only reset the range of queries in use.

This reduces the amount of resetting needed.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>

2 years agozink/query: refactor get_query_result to map upfront.
Dave Airlie [Mon, 28 Mar 2022 04:44:47 +0000 (14:44 +1000)]
zink/query: refactor get_query_result to map upfront.

This maps upfront and processes the results in a clearer way.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>

2 years agozink/query: use a single query pool for XFB queries.
Dave Airlie [Mon, 28 Mar 2022 04:30:59 +0000 (14:30 +1000)]
zink/query: use a single query pool for XFB queries.

There is no need to use a separate pool for each AFAIK.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>

2 years agozink: refactor out number of vk queries per gallium query helper
Dave Airlie [Mon, 28 Mar 2022 04:11:53 +0000 (14:11 +1000)]
zink: refactor out number of vk queries per gallium query helper

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>

2 years agozink/query: collapse the xfb_query_pool array into the normal one.
Dave Airlie [Mon, 28 Mar 2022 01:59:00 +0000 (11:59 +1000)]
zink/query: collapse the xfb_query_pool array into the normal one.

This makes things a bit easier to follow.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>

2 years agozink/query: consolidate xfb_buffers into one array.
Dave Airlie [Mon, 28 Mar 2022 01:45:23 +0000 (11:45 +1000)]
zink/query: consolidate xfb_buffers into one array.

This makes the code more complex than needed, just use on buffers
array.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15702>

2 years agoReinstate: llvmpipe: allow vertex processing and fragment processing in parallel
Dave Airlie [Tue, 31 Mar 2020 06:02:08 +0000 (16:02 +1000)]
Reinstate: llvmpipe: allow vertex processing and fragment processing in parallel

This reinstates patch: ec8104c6b227421b3a21e9c0652e3050066bb169
 llvmpipe: allow vertex processing and fragment processing in parallel

For now unknown reasons bisecting an error had lead to this patch, but
the actual bug was in virglrendrerer and the accoring feature was now only
enabled with https://gitlab.freedesktop.org/mesa/mesa/-/issues/6130

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6130

Original patch was

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15684>

2 years agoradv: Enable global bo list if 1.2 features are used.
Georg Lehmann [Thu, 31 Mar 2022 19:32:41 +0000 (21:32 +0200)]
radv: Enable global bo list if 1.2 features are used.

These features require the global bo list and the existing code only checked
if the extensions which were promoted to 1.2 are enabled.

Found by inspection.

Cc: mesa-stable
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15701>

2 years agonir: intel/compiler: Lower TXD on array surfaces on DG2+
Ian Romanick [Wed, 30 Mar 2022 23:36:06 +0000 (16:36 -0700)]
nir: intel/compiler: Lower TXD on array surfaces on DG2+

DG2 can only do sample_d and sample_d_c on 1D and 2D surfaces.  Cube
maps and 3D surfaces were already handled, but 1D array and 2D array
surfaces were not.

Fixes the following Vulkan CTS failures on DG2:

    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler1darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler2darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1darray_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1darray_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2darray_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2darray_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler1darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler2darray_fragment

The Fixes: tag below is a bit misleading. This commit adds another
lowering, similar to the one in the Fixes: commit, that probably should
have been added at the same time.  I just want to make sure this commit
gets applied everywhere that commit was also applied.

Fixes: 635ed58e527 ("intel/compiler: Lower txd for 3D samplers on XeHP.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15681>

2 years agointel/tools: Fix build without drivers
Chad Versace [Mon, 28 Mar 2022 19:51:03 +0000 (12:51 -0700)]
intel/tools: Fix build without drivers

If Meson was configured with -Dtools=intel but all Intel drivers were
disabled, then Meson silently refused to build the tools.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15617>

2 years agovulkan: Move common format function to vulkan/util/vk_format.h
Rajnesh Kanwal [Wed, 30 Mar 2022 18:42:20 +0000 (19:42 +0100)]
vulkan: Move common format function to vulkan/util/vk_format.h

Moving duplicate vk_format helper functions to common
vulkan/util/vk_format.h and also renaming
vk_format_get_component_size_in_bits to match how amd and
freedreno name the same function. Not moving this function
to common code as freedreno's implementation is a bit different.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15696>

2 years agoamd: Use common u_format.h implementation for vk_format_get_component_bits.
Rajnesh Kanwal [Thu, 31 Mar 2022 14:16:48 +0000 (15:16 +0100)]
amd: Use common u_format.h implementation for vk_format_get_component_bits.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15696>

2 years agopvr: Fix seg fault in vkAllocateDescriptorSets().
Karmjit Mahil [Fri, 25 Feb 2022 09:29:57 +0000 (09:29 +0000)]
pvr: Fix seg fault in vkAllocateDescriptorSets().

In cases when no immutable samplers were present but sampler
descriptor set layout bindings were, a seg fault was being caused
by an attempt to get the immutable sampler from within the
immutable sampler array while the array was not allocated.

This commit also remove the binding type check since only those
specific types can have immutable samplers. The check is covered
by the descriptor set layout creation and assignment of
has_immutable_samplers.

This commit also makes the immutable samplers const, since they're
meant to be immutable.

This commit also adds has_immutable_samplers field to descriptor
set layout. Previously to check whether immutable
samplers were present or not you'd check for the layout binding's
descriptor count to be 0 and the immutable sampler offset to be 0.
This doesn't tell you everything. If you have a descriptor of the
appropriate type (VK_DESCRIPTOR_TYPE_{COMBINED_,}IMAGE_SAMPLER).
So descriptor count of >1. The offset can be 0 if you don't have
immutable sampler, or have them at the beginning of the immutable
samplers array. So you can't determine if you really have immutable
samplers or not. One could attempt to perform a NULL check on the
array but this would not work in cases where you have following set
layout bindings with immutable samplers as the array stores the
whole layout's immutable samplers.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15688>

2 years agopvr: fix clang unused function warning
Frank Binns [Wed, 30 Mar 2022 08:06:38 +0000 (09:06 +0100)]
pvr: fix clang unused function warning

../src/imagination/vulkan/pds/pvr_pds.c:230:31: warning: unused function 'pvr_pds_encode_doutv' [-Wunused-function]
static ALWAYS_INLINE uint32_t pvr_pds_encode_doutv(uint32_t cc,
                              ^

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15689>

2 years agozink: remove radv cwrite driver workaround
Mike Blumenkrantz [Thu, 31 Mar 2022 13:42:24 +0000 (09:42 -0400)]
zink: remove radv cwrite driver workaround

seems good

fixes #6185

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15695>

2 years agoradv: Fix vk_queue_to_radv for radv_image_queue_family_mask.
Bas Nieuwenhuizen [Thu, 17 Mar 2022 02:34:23 +0000 (03:34 +0100)]
radv: Fix vk_queue_to_radv for radv_image_queue_family_mask.

radv_image_queue_family_mask was still using queue family index values
for the special cases, while being passes a radv_queue_family enum.

This adds the bits to the enum and vk_queue_to_radv so we can implement
radv_image_queue_family_mask completely in terms of the enum.

Fixes: 1ec4e568 ("radv: abstract queue family away from queue family index.")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15423>

2 years agodri: Remove the megadriver compat stub
Adam Jackson [Wed, 30 Mar 2022 14:24:25 +0000 (10:24 -0400)]
dri: Remove the megadriver compat stub

This is for compatibility with loaders that don't know about
__DRI_DRIVER_GET_EXTENSIONS. xserver has supported that since 1.15.0,
which is almost nine years old now.

While we're about it, fix a comment in meson.build that used to be about
megadrivers to reflect reality.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodri: Remove the globalDriverAPI hacks
Adam Jackson [Wed, 30 Mar 2022 14:19:56 +0000 (10:19 -0400)]
dri: Remove the globalDriverAPI hacks

We now know that we always have access to the appropriate driver
extensions, so we can get the right __DriverAPIRec from the vtable.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodri: Fill in the driver extensions for the legacy createNewScreen paths
Adam Jackson [Wed, 30 Mar 2022 14:11:04 +0000 (10:11 -0400)]
dri: Fill in the driver extensions for the legacy createNewScreen paths

The inner routine is going to want access to the driver extensions, but
the legacy paths only give you the loader extensions.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodri: Implement __DRI_DRIVER_VTABLE
Adam Jackson [Tue, 29 Mar 2022 21:07:34 +0000 (17:07 -0400)]
dri: Implement __DRI_DRIVER_VTABLE

We're going to switch to using this instead of doing all these weird
globalDriverAPI hacks, which are fragile and weird.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodri: Fold away some unused indirection in __DriverAPIRec
Adam Jackson [Tue, 29 Mar 2022 17:36:37 +0000 (13:36 -0400)]
dri: Fold away some unused indirection in __DriverAPIRec

The context-related API doesn't vary between dri2 and drisw.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>

2 years agodzn: Properly support static blend constants
Boris Brezillon [Mon, 28 Mar 2022 07:39:20 +0000 (09:39 +0200)]
dzn: Properly support static blend constants

The current code was assuming blend constants to be passed dynamically,
which is wrong. Let's handle both the dynamic and static cases.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15608>

2 years agodzn: Fix alpha blend factor translation
Boris Brezillon [Mon, 28 Mar 2022 07:36:29 +0000 (09:36 +0200)]
dzn: Fix alpha blend factor translation

When VK_BLEND_FACTOR_xxx_COLOR is passed to an alpha equation what we
really want is the alpha component replicated on the RGBA channels,
which has dedicated enums in D3D12. Let's make sure we use the right
definition depending on the equation we're translating.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15608>

2 years agoradv: suspend/resume queries during internal driver operations
Samuel Pitoiset [Tue, 29 Mar 2022 16:48:34 +0000 (18:48 +0200)]
radv: suspend/resume queries during internal driver operations

Pipeline statistics and occlusion queries shouldn't be enabled for
internal driver operations like clears. Transform feedback queries
don't have to be suspended because the driver doesn't use streamout.

This fixes a bunch of Zink failures.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15660>

2 years agovbo/dlist: do not try to pad an empty draw
Erik Faye-Lund [Tue, 29 Mar 2022 10:38:46 +0000 (12:38 +0200)]
vbo/dlist: do not try to pad an empty draw

In the case where u_index_generator returns zero new vertices, we never
filled tmp_indices before trying to duplicate the last veretx. This
causes us to read unitialized memory.

This fixes a Valgrind issue triggering in glxgears on Zink:

---8<---
==296461== Invalid read of size 2
==296461==    at 0x570F335: compile_vertex_list (vbo_save_api.c:733)
==296461==    by 0x570FEFB: wrap_buffers (vbo_save_api.c:1021)
==296461==    by 0x571050A: upgrade_vertex (vbo_save_api.c:1134)
==296461==    by 0x571050A: fixup_vertex (vbo_save_api.c:1251)
==296461==    by 0x57114D1: _save_Normal3f (vbo_attrib_tmp.h:315)
==296461==    by 0x10B750: ??? (in /usr/bin/glxgears)
==296461==    by 0x10A2CC: ??? (in /usr/bin/glxgears)
==296461==    by 0x4B3F30F: (below main) (in /usr/lib/libc.so.6)
==296461==  Address 0x11ca23de is 2 bytes before a block of size 1,968 alloc'd
==296461==    at 0x4845899: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==296461==    by 0x570E647: compile_vertex_list (vbo_save_api.c:604)
==296461==    by 0x570FEFB: wrap_buffers (vbo_save_api.c:1021)
==296461==    by 0x571050A: upgrade_vertex (vbo_save_api.c:1134)
==296461==    by 0x571050A: fixup_vertex (vbo_save_api.c:1251)
==296461==    by 0x57114D1: _save_Normal3f (vbo_attrib_tmp.h:315)
==296461==    by 0x10B750: ??? (in /usr/bin/glxgears)
==296461==    by 0x10A2CC: ??? (in /usr/bin/glxgears)
==296461==    by 0x4B3F30F: (below main) (in /usr/lib/libc.so.6)
---8<---

Fixes: dcbf2423d28 ("vbo/dlist: add vertices to incomplete primitives")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15633>

2 years agoradv: save/restore the stencil write mask during internal driver operations
Samuel Pitoiset [Wed, 30 Mar 2022 12:31:35 +0000 (14:31 +0200)]
radv: save/restore the stencil write mask during internal driver operations

The slow depth/stencil clear path would overwrite the stencil write
mask otherwise.

This fixes few Zink failures.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15667>

2 years agoac: remove LLVM 4.0 workaround
Pierre-Eric Pelloux-Prayer [Mon, 28 Mar 2022 09:17:58 +0000 (11:17 +0200)]
ac: remove LLVM 4.0 workaround

This was added to fix https://bugs.freedesktop.org/show_bug.cgi?id=97988 but
has been fixed in LLVM since.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15559>

2 years agoradeonsi: drop LLVM global instruction selector
Pierre-Eric Pelloux-Prayer [Thu, 24 Mar 2022 16:17:17 +0000 (17:17 +0100)]
radeonsi: drop LLVM global instruction selector

I'm not sure if this is really used by anyone?

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15559>

2 years agodocs: document useful radeonsi env variables
Pierre-Eric Pelloux-Prayer [Thu, 24 Mar 2022 16:16:49 +0000 (17:16 +0100)]
docs: document useful radeonsi env variables

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15559>