Commit graph

220536 commits

Author SHA1 Message Date
Pavel Ondračka
fddc101070 r300: split large HiZ clears into multiple packets
R300_PACKET3_3D_CLEAR_HIZ encodes COUNT in 14 bits (COUNT[13:0]), so a
single packet can clear at most 0x3fff dwords.

Large depth surfaces on R5xx can require more HiZ dwords than that.
When we emitted a single packet, COUNT truncated and part of HiZ RAM
remained uncleared, which could show up as HyperZ corruption.

Emit CLEAR_HIZ in chunks of R300_CLEAR_HIZ_COUNT_MAX and reserve enough
atom space for the worst-case packet count derived.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/360
Fixes: 12dcbd5954 ("r300g: enable Hyper-Z by default on r500")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40040>
2026-03-30 13:37:16 +00:00
Pavel Ondračka
e97ac38ff3 r300: add shared HyperZ pipe-count helper
Introduce r300_hyperz_pipe_count and use it in\nr300_setup_hyperz_properties.\n\nRV530 selects pipe topology from NUM_Z_PIPES, while other families use\nNUM_GB_PIPES. Keeping this in one helper avoids duplicated family checks\nand prepares follow-up HiZ clear sizing changes to reuse the same rule.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40040>
2026-03-30 13:37:16 +00:00
Pavel Ondračka
3fc2627897 r300: disable zmask clears for large surfaces
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40040>
2026-03-30 13:37:16 +00:00
Pavel Ondračka
648dfe88f4 r300: don't apply odd macroblock rounding to 3D textures
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is intended only for NPOT 2D textures.

Fixes: 0763fb947 ("r300: align macro-tiled stride-addressed textures in X")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40674>
2026-03-30 12:39:57 +00:00
Pavel Ondračka
f6b9e9c22b r300: lower Z16 polygon offset scale coefficient
The previous value was too high and led to issues in tesseract.

Fixes: 83d636fc7 ("r300: Z16 polygon offset fixes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40674>
2026-03-30 12:39:57 +00:00
Pavel Ondračka
e68e519b91 r300: fix bias presubtract algebraic transformation
One fneg too many.

Fixes: 0508db915 ("r300: implement bias presubtract")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40674>
2026-03-30 12:39:57 +00:00
Lionel Landwerlin
fdc1fae740 isl: speedup buffer fills by dropping swizzle programming
In vkoverhead ubo/ssbo tests, this is about 15/20% improvement.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40697>
2026-03-30 12:05:28 +00:00
Rhys Perry
c6f24ddcc9 util: simplify hash_table_u64
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40318>
2026-03-30 11:29:44 +00:00
Rhys Perry
213470b477 util: allow any key for hash tables
We sometimes use this with non-pointer keys.

This removes a footgun at the cost of a larger entry size on 32-bit.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40318>
2026-03-30 11:29:44 +00:00
Tapani Pälli
d348654a75 iris: use mi_set_autostrip_state for autostrip control
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40344>
2026-03-30 11:02:27 +00:00
Tapani Pälli
3160fbb6ec anv: use mi_set_autostrip_state for autostrip control
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40344>
2026-03-30 11:02:27 +00:00
Tapani Pälli
bafa1120ce genxml/mi: add additional bit to FF_MODE and autostrip helper
This provides bit and common code to control autostrip state.

Requirement for this is coming from Wa_14026781792. We are writing
register for Wa_14024997852 and since this register is nonmaskable
the bit needs to be written always. Helper takes care to touch only
required bits.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40344>
2026-03-30 11:02:27 +00:00
Aitor Camacho
e08da4e928 kk: Add clc in a similar fashion to other drivers like HK
OpenCL shaders will now be compiled offline and translated to MSL offline
at build time. Then added to a static table as binary data, to later be
compiled once when devices are initialized. This allows for easier
integration of OpenCL shaders for things such as tessellation since we
now don't have to manually add these shaders to the precompiled device
library in code.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40436>
2026-03-30 10:46:36 +00:00
Rhys Perry
3aea42e656 radv: create radv_rt_spirv_to_nir
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
4c3a74bebe radv: move radv_shader_create out of radv_rt_nir_to_asm
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
2260105ba1 radv: move radv_shader_create out of radv_graphics_shaders_compile
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
618cad6bfe radv: move radv_shader_create out of radv_graphics_shaders_nir_to_asm
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
6e2debe27c radv: copy spirv in radv_graphics_shaders_nir_to_asm instead
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
06b9660baf radv: move radv_shader_create out of radv_compute_pipeline_compile
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
41ffb087d2 radv: add radv_shader_debug_info parameter to radv_shader_create
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
98f96bd076 radv: add radv_parse_binary_debug_info
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
8cf1fc930c radv: simplify radv_shader_dump_debug_info
And rename to better reflect what it does.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:46 +00:00
Rhys Perry
4073cdf753 radv: add radv_shader_debug_info
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:45 +00:00
Rhys Perry
574f577657 radv: fix memory leak in radv_rt_nir_to_asm
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: 26.0
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40627>
2026-03-30 09:42:45 +00:00
Mary Guillemard
915684fe60 agx: Fix alpha-to-coverage bit size
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The new common code gives us 32-bit values, handle this.
This fixes the various crashes on CTS since the common code changes of
last week.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 22a061fb91 ("nir: Use better calculation for alpha-to-coverage mask")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40691>
2026-03-30 08:19:57 +00:00
Adam Simpkins
e16c8cc579 iris: fix a crash in disable_rb_aux_buffer
I have been running into crashes in this function when using blender.
Some of the entries in ice->state.framebuffer.base.cbufs[0] can
apparently have the texture field be null, which was causing a segfault
in this loop.

In my case, nr_cbufs was 3, and the first two cbufs entries had a null
texture and format set to PIPE_FORMAT_NONE. The last entry had format of
PIPE_FORMAT_R16G16_FLOAT and a non-null texture.

Adding this null check before attempting to dereference the texture
fixes the crash for me and allows blender to work normally.

Fixes: ca96f8517c ("iris: remove uses of pipe_surface as a pointer")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40688>
2026-03-30 07:55:33 +00:00
Samuel Pitoiset
3324abad06 radv: introduce RADV_EXPERIMENTAL envvar for experimental features
Abusing RADV_PERFTEST for experimental features doesn't make real
sense, and I think we should stop doing that.

The existing RADV_PERFTEST options like RADV_PERFTEST=transfer_queue
still exists but they are marked as deprecated, they will be removed
in future Mesa releases.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40646>
2026-03-30 07:27:01 +00:00
Samuel Pitoiset
83a7357d6a docs: add missing description of RADV_PERFTEST=rtcps
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40646>
2026-03-30 07:26:59 +00:00
Faith Ekstrand
d17c79387b vulkan: Add a no-op implementation of [Un]RegisterCustomBorderColor()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
191d2b37de vulkan: Add a common implementation of GetPhysicalDeviceDescriptorSizeKHR
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
2c444c17db vulkan/pipeline: Call vk_nir_lower_descriptor_heaps()
As with vk_shader_object, vk_nir_lower_descriptor_heaps() is called
right after the driver preprocess step.  The resulting mapping and
embedded samplers are then baked into the pre-compile shader.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
80706130c7 vulkan/pipeline: Reorder vk_pipeline_precomp_shader_deserialize()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
978b9f6495 vulkan: Add a vk_hash_descriptor_heap_mappings() helper
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
e8558de16f vulkan/shader: Call vk_nir_lower_descriptor_heaps()
Embedded samplers (if present) are passed to the driver as part of the
vk_shader_compile_info

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
f41dd1d157 vulkan/pipeline: Allow compiling compute/rt pipelines with a NULL layout
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
f0c1b3fe32 vulkan: Support descriptor heaps in vk_nir_convert_ycbcr()
The original version of the pass relied on derefs and passing bindings
and indices to drivers through the callback.  While this works, it's
much more convenient with heaps to just take an index into the embedded
descriptor table.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
20d11c59a4 vulkan: Add a lowering pass for descriptor heap mappings
Lowers all mappings and embedded samplers to descriptor heaps without
mappings.  This was based on a pass written by Konstantin Seurer and
Mike Blumenkrantz but was basically entirely rewritten and uses
different NIR intrinsics.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Samuel Pitoiset
f88506172f vulkan/runtime: handle custom border color index with samplers
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
4d56fa661f vulkan: Rename some VK_EXT_descriptor_buffer properties
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Faith Ekstrand
dc44b2e916 spirv: Mark DescriptorHeapKHR as implemented
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:26 +00:00
Konstantin Seurer
b127c11be9 spirv,nir: Preserve more information about the descriptor type
Descriptor heap mappings need the information to selectively apply
mappings (descriptor type masks).

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:25 +00:00
Samuel Pitoiset
df515cfb5b nir: make nir_variable::descriptor_set a 32-bit variable
With descriptor heap there is no limit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:25 +00:00
Faith Ekstrand
f35839a6bc spirv: Handle OpBufferPointerKHR
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:25 +00:00
Faith Ekstrand
2366bd9cde spirv: Handle ArrayStrideIdKHR and OffsetIdKHR decorations
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:25 +00:00
Faith Ekstrand
b42b7c8f60 spirv,vulkan: Implement OpConstantSizeOfKHR
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:24 +00:00
Faith Ekstrand
ad9f92ba10 spirv: Handle OpTypeBufferKHR
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:23 +00:00
Faith Ekstrand
bc031b76d8 spirv: Add new SPV_KHR_descriptor_heap Builtins
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:23 +00:00
Faith Ekstrand
719cb88748 spirv: Improve the error message for invalid SPIR-V sections
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:23 +00:00
Lionel Landwerlin
302194a566 nir: improve deref_instr_get_variable
So we can get through all the casting inserted by heaps.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:23 +00:00
Faith Ekstrand
e7e601f113 nir: Add tex sources for descriptor heaps
We also add a new boolean which indicates that the texture op uses an
embedded sampler.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40649>
2026-03-30 06:51:22 +00:00