Commit graph

20681 commits

Author SHA1 Message Date
Pierre-Eric Pelloux-Prayer
0ecc6eb2f5 ac/sqtt: add ac_sqtt_update_bo_size
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
buffer_size is uint32_t so we must be careful to not overflow it.
radeonsi had code for this but radv doesn't, which means it will
hang if RADV_THREAD_TRACE_BUFFER_SIZE is too big or if buffer_size
is being doubled up to the point it overflows.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41383>
2026-05-20 08:33:22 +00:00
Pierre-Eric Pelloux-Prayer
2854c1b778 radv, radeonsi: do sqtt buffer_size calc using uint64
The final size is uint64_t so use it from the start to avoid
overflow issues.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41383>
2026-05-20 08:33:22 +00:00
Thong Thai
d7f72e4e5b amd: Build nir files only when with_gfx_compute
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41494>
2026-05-19 22:14:41 +00:00
Samuel Pitoiset
54b71e9e77 util: pass a struct to driParseConfigFiles()
It would be easier to add more functionalities like shader hashes etc.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41657>
2026-05-19 19:51:45 +00:00
Karol Herbst
e9c1cce35f nir: remove ffma_old
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
2026-05-19 18:13:42 +00:00
Karol Herbst
109d93dd98 nir: update ffma helpers to use new opcodes
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
2026-05-19 18:13:41 +00:00
Karol Herbst
6cf3cba68c radv: use nir_op_ffma_weak
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
2026-05-19 18:13:36 +00:00
Karol Herbst
3e334ea0d3 aco: support new multadd opcodes
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
2026-05-19 18:13:36 +00:00
Karol Herbst
04696f9bf9 ac/llvm: support new multadd opcodes
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
2026-05-19 18:13:35 +00:00
Karol Herbst
a80e254fd4 ac: use nir_op_ffma_weak
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
2026-05-19 18:13:35 +00:00
Karol Herbst
570bfe1ee0 ac: handle new float multadd opcodes
This advertizes both ffma and fmad on a couple of chipsets to support
VK_KHR_shader_fma and to improve OpenCL fma performance, where fma is not
optional and the emulation is more expensive than slow fma.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
2026-05-19 18:13:35 +00:00
Karol Herbst
a9b18f8607 nir: rename ffma to ffma_old
We'll get three new opcodes to properly model float multiply-add.
ffma_old is temporary and will be deleted at the end of this series.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41165>
2026-05-19 18:13:27 +00:00
Samuel Pitoiset
29b86874c3 radv: move radv_GetDeviceFaultInfoEXT() to radv_device.c
Because radv_debug.c will be moved to a subdirectory called tools/ and
this is entrypoint from VK_EXT_device_fault.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41598>
2026-05-19 17:48:46 +00:00
Samuel Pitoiset
4dc158a8cb radv: remove an outdated comment in radv_GetDeviceFaultInfoEXT()
The driver exports GPU hang reports already.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41598>
2026-05-19 17:48:46 +00:00
Samuel Pitoiset
d348e324da radv: advertise VK_EXT_device_fault by default
This is can still be useful if the kernel has no GPUVM query support
becuse it's possible to export GPU hang reports.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41598>
2026-05-19 17:48:45 +00:00
Marek Olšák
8a68ae989d ac,radeonsi: remove all frag_coord_xy code
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is now dead code. This code is not used by RADV.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41461>
2026-05-19 15:03:51 +00:00
Marek Olšák
159f22abbe radeonsi: switch to nir_frag_coord_xy_z_w_separate with w_rcp
FYI, ac_nir_lower_ps_early is only used by radeonsi.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41461>
2026-05-19 15:03:51 +00:00
Marek Olšák
cb66de3beb radv: switch to nir_frag_coord_xy_z_w_separate with w_rcp
Only Cyberpunk affected:

Totals from 10 (0.00% of 202429) affected shaders:
Latency: 337370 -> 337366 (-0.00%)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41461>
2026-05-19 15:03:50 +00:00
Eric Engestrom
b52bb138e0 meson/amd: only build libaco when requested
Users all explicitly depend on `idep_aco`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41617>
2026-05-18 19:09:03 +00:00
Timothy Arceri
45421292f1 ac/nir/lower_tex_coord: update cursor when moving wqm coordinates
We need to update the build cursor when moving a load otherwise
subsequent loads will be using a stale cursor.

Fixes: 0ff1650662 ("ac/nir/lower_tex_coord: fix moving wqm coordinates")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15494

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41629>
2026-05-18 14:03:20 +00:00
Georg Lehmann
00016a115c aco/tests: use explicit lod in sparse texture test
Newer glslang complains about implicit derivatives being
used in compute without the extension.

Cc: mesa-stable

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41597>
2026-05-18 12:03:06 +00:00
Daniel Schürmann
16bf0a2047 nir/lower_bit_size: use nir_builder::constant_fold_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41388>
2026-05-18 11:01:06 +00:00
Lone_Wolf
4a7f2258f2 ac/llvm: fix build with LLVM 23 (MCSubtargetInfo)
See the relevant LLVM change d50631faad.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15470
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41555>
2026-05-18 10:34:48 +00:00
Benjamin Cheng
e44cb38c3b ac/parse_ib: Add parsing for variable slice mode
Fixes: d9ba641e28 ("ac: Add variable slice mode interface")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41140>
2026-05-15 08:12:11 +00:00
Samuel Pitoiset
d1fd6b1ef1 radv: fix copying acceleration structure with DAC
Because buffer is NULL.

Fixes: a97c889a7b ("radv: implement VK_KHR_device_address_commands")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41505>
2026-05-15 06:37:54 +00:00
Samuel Pitoiset
116a0eacd1 radv: destroy the gang CS when a cmdbuf is reset
Otherwise, if a cmdbuf is recycled it would assume that a gang CS is
always is present even if it's not used. That means, it would emit
useless synchronization and use gang submit with a mostly empty gang
CS for nothing.

It seems better to create the gang CS on-demand only when it's strictly
required (for compute fallback with SDMA and task shaders). Even for
heavy uses of task shaders, that shouldn't hurt.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41543>
2026-05-15 06:11:16 +00:00
Samuel Pitoiset
937bd7e040 radv: clear the follower gang semaphore when a cmdbuf is reset
Not resetting shouldn't cause any issues but better to be conservative.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41543>
2026-05-15 06:11:16 +00:00
Marek Olšák
3831935818 nir/opt_move_to_top: add an option to exclude moving at_offset/at_sample loads
This splits the nir_move_to_top_input_loads option into 2 options. The latter
option is mainly for at_offset/at_sample loads. Then it updates most places to
use only the first option.

The rationale is that moving at_sample loads makes Control (game) shaders
worse, as per the code comment.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41167>
2026-05-14 16:48:39 -04:00
Rhys Perry
171210e36a aco/ra: remove precolored checks in get_reg_impl()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Since tied definitions no longer use precoloring, I don't think this is
needed anymore.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:24 +00:00
Rhys Perry
faf8926ec8 aco/ra: use phi_dummy instead of is_phi()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:23 +00:00
Rhys Perry
53cd74c284 aco/ra: don't rename phi operands in get_reg_phi()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: *
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:22 +00:00
Rhys Perry
638cefc8f2 aco: fix regclasses for spill/reload subdword temporaries
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:21 +00:00
Rhys Perry
46047cf5ca aco/ra: fix fill() with certain subdword cases
If div_ceil(start.byte() + num_bytes, 4) != div_ceil(num_bytes, 4), like
v3b at byte=2.

Also, the non-const operator[] was unused and unsafe.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:21 +00:00
Rhys Perry
528aabb056 aco/ra: fix compact_relocate_vars path for get_reg_for_operand
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:20 +00:00
Rhys Perry
7c4429d21a aco: rework subdword definition RA validation a bit
Some issues fixed:
- check that byte=0 for p_as_uniform/etc
- validate 5+ byte definitions
- fix v3b pseudo definition validation
- fix validation when the index of the definition is not 0

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:19 +00:00
Rhys Perry
4249daeedd aco: add helpers to get instruction subdword capabilities
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:19 +00:00
Rhys Perry
43aeeb8b88 aco/ra: test the register file in get_reg_specified() when necessary
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: *
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:17 +00:00
Rhys Perry
2d5478fc3f aco/ra: fix v3b VALU at byte>0
This can happen with v_cndmask_b32, if we were required to take the
sub-dword path in get_reg_simple().

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:17 +00:00
Rhys Perry
62a268eb5f aco/validate: fix some RA validator error messages
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
2026-05-13 15:53:17 +00:00
Karol Herbst
47bde74e91 ci: update OpenCL 3.1 piglit fails
Piglit does enforce the pre 3.1 behavior of clSetKernelArg

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41358>
2026-05-13 15:21:40 +00:00
Samuel Pitoiset
aee1043227 radv/meta: adjust an assertion for HTILE expand on SDMA with compute fallback
Because SDMA doesn't support MSAA, it's possible to get there because
RADV fallback to compute queue in this case.

Some tests only pass because RDNA2 and older don't support image
stores with depth/stencil and MSAA.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41492>
2026-05-13 06:10:02 +00:00
Georg Lehmann
ee64cb2763 aco: add tests for cube txd to tex opt
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41489>
2026-05-12 18:17:22 +00:00
Georg Lehmann
d256c1f49e ac/nir/lower_tex_coords: fix optimizing cube txd to tex
We need to remove ddx/ddy before doing the cube lowering,
otherwise we insert instructions that break dominance.

Affects Sable.

Fixes: 7d552d71e9 ("ac/nir: optimize txd(coord, ddx/ddy(coord))")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41489>
2026-05-12 18:17:22 +00:00
Samuel Pitoiset
6b3223895f radv: invalidate command buffer state after executing secondaries
This is more robust than trying to keep track of the states between
command buffers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41260>
2026-05-12 17:17:55 +00:00
Samuel Pitoiset
70a3d2c082 radv: remove a TODO about layeredShadingRateAttachments
This will never be supported.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41427>
2026-05-12 16:55:23 +00:00
Samuel Pitoiset
da0ee50c3b radv: fix another case of VRS with mipmaps on GFX10.3
When a VRS view is used with a depth/stencil view, the driver is
expected to copy the VRS rates to the HTILE buffer of the depth/stencil
view. Though if the image uses mipmaps and the base level can't support
HTILE there is no way to copy the rates. The workaround is to force VRS
to be 1x1 which is valid in Vulkan.

This fixes old VKCTS failures on RAPHAEL just because it supports
fragmentShadingRateWithShaderDepthStencilWrites compared to other GPUs
in CI (NAVI21/VANGOGH).

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41427>
2026-05-12 16:55:23 +00:00
Samuel Pitoiset
83d350dc1c radv: advertise VK_KHR_maintenance11
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: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41316>
2026-05-12 16:28:43 +00:00
Samuel Pitoiset
d10e732aac radv: adjust minImageTransferGranularity for transfer queue
It's required with VK_KHR_maintenance11. This allows way more transfer
queue related CTS tests to run and all issues I found should already
be fixed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41316>
2026-05-12 16:28:43 +00:00
Samuel Pitoiset
c44ec2fc69 radv: add support for VK_SHADER_CREATE_INDEPENDENT_SETS_BIT_KHR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41316>
2026-05-12 16:28:42 +00:00
Marek Olšák
280f8e6ab5 aco,radeonsi: declare prolog CENTROID VGPRs only if used
Small PS have their VGPR usage equal to the number of input VGPRs,
and this reduces it.

4 input VGPRs removed in most cases.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41226>
2026-05-12 14:13:45 +00:00