Commit graph

19552 commits

Author SHA1 Message Date
Marek Olšák
3552028e87 ac/lower_ngg_mesh: fix a segfault accessing out_variables out of bounds
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
component_addr_off (in bytes) was used to offset a component index (in dwords).

Cc: mesa-stable

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39144>
2026-01-05 22:23:42 +00:00
Marek Olšák
b340588119 ac/gpu_info: don't read uninitialized dev_filename
This fixes radeonsi-run-tests.py not being able to read AMD_DEBUG=info.

Fixes: 8777894d3e - amd: remove radeon_info::dev_filename

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39145>
2026-01-05 21:56:36 +00:00
Konstantin Seurer
405c93c665 radv: Optimize BVH4 acceleration structure updates
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It is more efficient to compute the child index of the current node
inside the parent node and write the bounds when available. The previous
code could load up to 16 AABBs to compute the new ones. The new code
also only needs 1/7 of the previously used scratch memory. The new code
seems to be around 30% faster (0.5ms) in GOTG on a 6700XT.

Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39139>
2026-01-05 15:24:54 +00:00
Daniel Schürmann
2d0d5fc104 aco/validate: validate constant bus limit after register allocation based on PhysReg
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39107>
2026-01-05 14:54:00 +00:00
Daniel Schürmann
eb16f701a6 aco/tests: Add new test to pack 2x16 SGPRs into VGPR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39107>
2026-01-05 14:54:00 +00:00
Daniel Schürmann
61c1ec541d aco/tests: Add test for subdword extraction from SGPR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39107>
2026-01-05 14:54:00 +00:00
Daniel Schürmann
0674c9d30e aco/validate: Validate correct RegisterClasses after lowering to HW instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39107>
2026-01-05 14:53:59 +00:00
Daniel Schürmann
b087bf2fbf aco/lower_to_hw: Fix SGPR Operand RegClasses for pack_2x16
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39107>
2026-01-05 14:53:59 +00:00
Daniel Schürmann
9f5996ae8a aco/lower_to_hw: Don't use 2 SGPR operands before GFX10 in a single VOP3 instruction in do_pack_2x16()
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39107>
2026-01-05 14:53:58 +00:00
Daniel Schürmann
d8481fd7cc aco/lower_to_hw: Fix SGPR Operand RegClasses of subdword copies
Extracting from an SGPR could cause a wrong RegClass on
the operand which could later lead to selecting VOPD
instructions which falsely operate on the corresponding
VGPR.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39107>
2026-01-05 14:53:58 +00:00
Samuel Pitoiset
48d30ce5bf ac/rgp: enable the new derived SPM chunk for performance counters on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
dcf9f630ff ac/spm: add support for Ray Tracing counters in RGP on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
179184c07e ac/spm: add support for new Memory percentage counters in RGP 2.6 on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
78bdc03282 ac/spm: add support for new Memory bytes counters in RGP 2.6 on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
4d7794f0b3 ac/spm: add support for new LDS counters in RGP 2.6 on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
e315bd0321 ac/spm: update the cache group on GFX12
No L1 counter.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:06 +00:00
Samuel Pitoiset
7349169745 ac/spm: rework indexing of the derived groups/counters/components
RGP expects linear indexing across the number of counters/components.
Because a component can be used with different counters, its index
should be re-used when needed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:06 +00:00
Samuel Pitoiset
11a12893d6 ac/perfcounter: add new GCEA_SE block definition on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:05 +00:00
Samuel Pitoiset
7f84c0056f ac/perfcounter: add new GCEA_CPWD block definition on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100>
2026-01-05 10:02:05 +00:00
Samuel Pitoiset
3722ef141c ac/spm: fix a crash with the RT counters on GFX10
They are only enabled on GFX10.3+.

Fixes: 8bc37d0d19 ("ac/spm: add support for Ray Tracing counters in RGP")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39127>
2026-01-05 09:05:50 +00:00
Samuel Pitoiset
a057800300 ac/perfcounter: compute the number of block instance properly on GFX10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:04 +00:00
Samuel Pitoiset
87b938ce41 ac/perfcounter: update configuration of many blocks on GFX10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:04 +00:00
Samuel Pitoiset
381e4f4c9f ac/perfcounter: fix the number of static instances for some blocks on GFX10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:04 +00:00
Samuel Pitoiset
91fdbadacc ac/perfcounter: define a distribution mode for all perf blocks on GFX10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:03 +00:00
Samuel Pitoiset
736ddb6ba8 ac/perfcounter: move configuration for GFX10 in a separate file
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:03 +00:00
Samuel Pitoiset
6374484123 ac/perfcounter: compute the number of block instance properly on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:02 +00:00
Samuel Pitoiset
a037feb40b ac/perfcounter: update configuration of many blocks on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:02 +00:00
Samuel Pitoiset
b7c2e38019 ac/perfcounter: fix the number of static instances for some blocks on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:01 +00:00
Samuel Pitoiset
1925d61a7b ac/perfcounter: define a distribution mode for all perf blocks on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:01 +00:00
Samuel Pitoiset
f4bc670ddf ac/perfcounter: move configuration for GFX10.3 in a separate file
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:01 +00:00
Samuel Pitoiset
abc72740a7 ac/perfcounter: fix number of instances for GCEA
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:00 +00:00
Eric Engestrom
c63732463a radv/ci: document recent flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39140>
2026-01-03 16:27:56 +00:00
Timur Kristóf
c05d276473 radv: Mitigate GFX6-7 SMEM bug for robust OOB access
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Implement a mitigation for VM faults caused by SMEM reading
out of bounds when using robust buffer access.

- Pad uniform and storage buffer allocations with a readonly VM page
- Clamp SMEM offsets that can potentially read past the next page

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38769>
2026-01-02 23:42:16 +00:00
Timur Kristóf
f866bed0db radv: Mitigate GFX6-7 SMEM bug for NULL and mutable descriptors
Implement a mitigation for VM faults caused by SMEM reading
from NULL descriptors.

In order to satisfy VKD3D-Proton's expectations on mutable
descriptors, we must do this in shader code, it is not
sufficient to use the address of a mapped BO when writing
null descriptors. It is not feasible to mitigate this
in VKD3D-Proton.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38769>
2026-01-02 23:42:16 +00:00
Timur Kristóf
10a5e5e4f3 radv/amdgpu: Add ability to pad BOs with a read-only VM page
Map the first page of the same BO as read-only after the BO itself
in order to pad each BO with an extra page. This doesn't require
us to allocate any memory.

This is going to be used for a HW bug mitigation.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38769>
2026-01-02 23:42:16 +00:00
Timur Kristóf
18b8543026 ac/nir: Add pass to fixup SMEM on GFX6-7
The pass implements two mitigations for the GFX6-7 SMEM bug:

1. To mitigate VM faults by NULL descriptors:

Make sure that SMEM buffer loads always access a mapped BO.
Use either the descriptor BO (or compute scratch BO),
or otherwise use the zero-filled BO in their place.

2. To mitigate VM faults by OOB robust buffer access:

Add an instruction to clamp the offset source to the
num_records field of the descriptor. It will be still
out of bounds, but the VM fault can be completely mitigated
if the driver adds a padding to each memory allocation.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38769>
2026-01-02 23:42:16 +00:00
Timur Kristóf
7023ef4b8b ac/cu_info: Add GFX6-7 SMEM OOB bug
On GFX6-7, SMEM instructions access memory when num_records == 0
or offset >= num_records, which causes VM faults when reading a
page that isn't mapped.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38769>
2026-01-02 23:42:16 +00:00
Marek Olšák
bd9206192d radv: use ac_set_sx_downconvert_state_for_mrt
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39093>
2026-01-02 16:46:20 +00:00
Marek Olšák
d0dd5a5f57 ac,radeonsi: move SX PS downconversion code into ac_formats.c
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39093>
2026-01-02 16:46:20 +00:00
Marek Olšák
e64e41f69e radv: fix halved pixel throughput for a few non-blended 16bpp/32bpp formats
Fixed formats:
* R16_SFLOAT
* R16G16_SFLOAT
* R5G5B5A1_UNORM
* A2B10G10R10_UINT

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39093>
2026-01-02 16:46:20 +00:00
Samuel Pitoiset
489550d380 radv: add new drirc radv_prefer_2d_swizzle_for_3d_storage
Because some games perform much better with 2D swizzle for 3D storage.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38084>
2026-01-02 09:54:29 +00:00
Samuel Pitoiset
ae99082f96 radv: use 2D swizzle modes for 3D CB render targets when optimal
Much faster because CB is optimal with 2D swizzle modes. This isn't
applied for storage images because it depends on the access pattern,
and benchmark results are very different.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38084>
2026-01-02 09:54:29 +00:00
Samuel Pitoiset
5d4afe60ff ac/surface: add RADEON_SURF_VIEW_3D_AS_2D_ARRAY
This is only compatible with non-sparse 3D images. It will be used
to select a better swizzle mode from RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38084>
2026-01-02 09:54:29 +00:00
Samuel Pitoiset
468c8dca18 ac/perfcounter: compute the number of block instance properly on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
3c7ea1e4ca ac/perfcounter: update configuration of many blocks on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
08f50f169b ac/perfcounter: fix the number of static instances for some blocks on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
59b35e9777 ac/perfcounter: define a distribution mode for all perf blocks on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
d03ad11e11 ac/perfcounter: move configuration for GFX11 in a separate file
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
d18dbd9804 ac/perfcounter: define new GPU blocks on GFX11+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
1672b3aa6d ac/perfcounter: fix configuration of SQ/SQ_WGP blocks on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00