Commit graph

11622 commits

Author SHA1 Message Date
Samuel Pitoiset
e3015d7d5a radv/meta: decompress source resolve images slighly earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40491>
2026-03-20 09:56:49 +00:00
Samuel Pitoiset
d2818c5b3f radv/meta: cleanup determining the resolve method
The fragment resolve path supports everything except layers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40491>
2026-03-20 09:56:49 +00:00
Samuel Pitoiset
130a066d58 radv: stop passing radv_device for creating NIR meta shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40481>
2026-03-19 19:23:55 +00:00
Samuel Pitoiset
6bf978e13e radv: move setting NIR options for meta shaders
To remove radv_device from radv_meta_nir_init_shader().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40481>
2026-03-19 19:23:55 +00:00
Samuel Pitoiset
dcf0274e82 radv: stop associating NIR with device for debugging tools
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40481>
2026-03-19 19:23:55 +00:00
Samuel Pitoiset
fddbeddb2d radv: move valid VA debug info to radv_valid_va data
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40481>
2026-03-19 19:23:54 +00:00
Samuel Pitoiset
7ce3b2a68e radv: move radv_printf_data to radv_debug_nir
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40481>
2026-03-19 19:23:54 +00:00
Samuel Pitoiset
f776a763b4 radv: remove unnecessary radv_device parameter to few functions
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40481>
2026-03-19 19:23:54 +00:00
Samuel Pitoiset
59883a5cb6 vulkan: stop passing vk_device to vk_set_subgroup_size()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40481>
2026-03-19 19:23:54 +00:00
Samuel Pitoiset
79ac5fd4c2 radv/amdgpu: remove dead code in radv_amdgpu_winsys_bo_create()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40461>
2026-03-18 16:03:39 +00:00
Samuel Pitoiset
02628a5eb7 radv/amdgpu: free the VA range in case the BO allocation failed
Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40461>
2026-03-18 16:03:39 +00:00
Lionel Landwerlin
173a4c6170 vulkan/runtime: break view mask from renderpass information
The runtime builds a final pipeline state with pointers to structures
coming from the associated pipelines libraries.

So far it has considered that the viewMask was part of a structure
together with the rest of the renderpass information. This information
can be specified in pre-raster, fragment & color-output state groups
and it was assumed would be consistent for all 3. And the runtime
currently takes the pointer to the structure from the last pipeline
library (color output).

Some coming spec/cts will clarify that the viewMask only needs to be
specified for pre-raster & fragment groups, making the value in the
color-output group untrustworthy.

This change creates a new state structure to hold the viewMask on its
own so it is only gather on pre-raster & fragment groups.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (radv)
Reviewed-by: Aitor Camacho <aitor@lunarg.com> (kosmickrisp)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com> (turnip)
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> (v3dv)
Reviewed-by: Frank Binns <frank.binns@imgtec.com> (powervr)
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (panvk)
Royaled-yes-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> (lavapipe)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39940>
2026-03-17 20:13:35 +00:00
Samuel Pitoiset
ad948a8ca6 radv/meta: fix missing sync for compute resolves
Removed this by mistake during a rebase presumably.

This fixes a regression with
dEQP-VK.pipeline.monolithic.multisample.m10_resolve.* on <= GFX8.

Fixes: 1746837a71 ("radv/meta: remove CB_RESOLVE")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40449>
2026-03-17 11:36:53 +00:00
Rhys Perry
200555fd3b radv: improve lower_array_layer_round_even condition
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
If conformant_trunc_coord=true, then the hardware never truncates the
layer and this lowering isn't needed.

If conformant_trunc_coord=false, then this lowering is needed if
TRUNC_COORD might be set, which is never the case if
disable_trunc_coord=true.

The previous version of this code always did the lowering if
disable_trunc_coord=true, which shouldn't be necessary.

fossil-db (navi31):
Totals from 2244 (2.00% of 112041) affected shaders:
MaxWaves: 50550 -> 50552 (+0.00%)
Instrs: 4497677 -> 4495106 (-0.06%); split: -0.07%, +0.01%
CodeSize: 23967696 -> 23958808 (-0.04%); split: -0.05%, +0.01%
VGPRs: 165132 -> 165096 (-0.02%)
Latency: 45174171 -> 45165056 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 7645548 -> 7639935 (-0.07%); split: -0.08%, +0.00%
VClause: 66733 -> 66717 (-0.02%); split: -0.08%, +0.05%
SClause: 83906 -> 83936 (+0.04%); split: -0.08%, +0.12%
Copies: 297125 -> 297292 (+0.06%); split: -0.19%, +0.24%
Branches: 69963 -> 69960 (-0.00%)
PreSGPRs: 142985 -> 143002 (+0.01%)
PreVGPRs: 138017 -> 137966 (-0.04%)
VALU: 3022018 -> 3019855 (-0.07%); split: -0.07%, +0.00%
SALU: 389844 -> 389663 (-0.05%); split: -0.12%, +0.07%
VOPD: 809 -> 810 (+0.12%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40409>
2026-03-17 10:27:07 +00:00
Zeyang Lyu
70a487adfb radv: Fix incorrect misaligned_mask_invalid for VK_EXT_vertex_input_dynamic_state
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The cmd_buffer->vertex_bindings was not cleared when resetting the command buffer.

The previous misaligned_mask_invalid bits were not preserved when calling radv_CmdBindVertexBuffers2 multiple times.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40312>
2026-03-17 06:56:48 +00:00
Natalie Vock
b046eaf36d radv/rt: Fix shared ray query stack on top of application LDS
Since the stack pointer may wrap around the stack size in overflow
cases, traversal logic calculates the real stack pointer with
nir_umod_imm(b, stack, args->stack_entries * args->stack_stride).

For ray queries, "stack" was initialized to
"stack_base + local_invocation_idx * 4". This was completely broken, as
the umod would later delete the stack base completely and overwrite the
start of LDS, which belongs to the apps' shared memory.

Instead, add the stack base as a constant offset in the load/store_stack
callback. (This should also save 1 VALU per ray query)
Also, delete radv_ray_traversal_args::stack_base since it's unused now.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40420>
2026-03-16 12:43:59 +00:00
Samuel Pitoiset
e1aa011ce4 radv: stop passing radv_device for SPIR-V debug reports
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40379>
2026-03-16 11:55:45 +00:00
Samuel Pitoiset
639207701d aco,radv,radeonsi: remove debug report support in ACO
This doesn't seem very useful since ACO will abort and print the
error messages to stderr.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40379>
2026-03-16 11:55:45 +00:00
Samuel Pitoiset
d6fe5ee8a6 vulkan: do not pass vk_instance for debug report messages
RADV wants to abstract the compiler from any instance/device/pdev
objects.

The previous NULL check for instance seems to be useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40379>
2026-03-16 11:55:45 +00:00
David Rosca
25095cc393 radv/video: Fix coding pic_parameter_set_id in H264 slice header
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40374>
2026-03-16 10:39:13 +00:00
David Rosca
0450e4ff65 radv/video: Fix AV1 encode min tile size
Fixes: 37e71a5cb2 ("radv/video: add support for AV1 encoding")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40374>
2026-03-16 10:39:13 +00:00
Samuel Pitoiset
fd032536d9 radv: cleanup valid image layouts in radv_layout_is_htile_compressed()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:09 +00:00
Samuel Pitoiset
205fe011ea radv: always use separate depth/stencil layouts for rendering
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:09 +00:00
Samuel Pitoiset
7343aff8aa radv: fix missing HTILE decompression with separate depth/stencil layouts
These two layouts mean either the depth or the stencil aspect is
compressed. Without TC-compat HTILE (mostly < GFX8), the driver must
expand HTILE.

This prevents regressions with Vulkan runtime code using separate
depth/stencil layouts by default.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:09 +00:00
Samuel Pitoiset
5192ee3c88 radv: handle separate depth/stencil layouts correctly for barriers
Need to split the transitions, one for each aspect.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:08 +00:00
Samuel Pitoiset
3c26a2fdb1 radv: handle separate depth/stencil layouts correctly for fbfetch decompressions
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:08 +00:00
Samuel Pitoiset
cb3cbf4303 radv/meta: stop setting the other depth/stencil attachments when unused
It should be either both or depth-only or stencil-only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:07 +00:00
Samuel Pitoiset
feffa62a41 radv/meta: add separate ds layouts support to the HTILE expand pass
This should work just fine.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:07 +00:00
Samuel Pitoiset
58441d014e radv: stop checking whether HTILE is compressed with the UNDEFINED layout
This doesn't make sense.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:07 +00:00
Samuel Pitoiset
a55b49569f radv: only set the relevant image views for custom depth/stencil resolves
So the rendering state has correct information, like the aspects.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40154>
2026-03-16 09:16:07 +00:00
Samuel Pitoiset
1746837a71 radv/meta: remove CB_RESOLVE
CB_RESOLVE isn't very fast and we already have two different paths,
it's been removed in hw since GFX11. PAL and RadeonSI removed support
for it too.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39957>
2026-03-16 08:12:46 +00:00
Samuel Pitoiset
9c05ca4366 radv/meta: use the fragment resolve path by default
CB_RESOLVE is going to be removed. The driver will fallback to the
compute resolve path if necessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39957>
2026-03-16 08:12:46 +00:00
Samuel Pitoiset
90a60c84b5 ac/rtld: remove radeon_info
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
2026-03-16 07:50:02 +00:00
Samuel Pitoiset
f6b4acdf45 radv: remove radv_use_llvm_for_stage()
This was useful few years ago to investigate ACO vs LLVM issues but
now it seems unnecessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
2026-03-16 07:50:02 +00:00
Samuel Pitoiset
a7cc55c33b radv: remove unnecessary radv_device parameter to few functions
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
2026-03-16 07:50:01 +00:00
Samuel Pitoiset
1f20feacaa radv: remove radv_nir_compiler_options::info
Passing radeon_info is bad.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
2026-03-16 07:50:01 +00:00
Samuel Pitoiset
c8499885cb radv: use radv_physical_device_cache_key::use_ngg_culling more
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
2026-03-16 07:50:00 +00:00
Samuel Pitoiset
744cedf3a1 radv: remove unused radv_device parameter to few functions
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
2026-03-16 07:50:00 +00:00
Samuel Pitoiset
8d1e148c37 radv: remove empty gather_shader_info_cs()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
2026-03-16 07:50:00 +00:00
Samuel Pitoiset
23dcabcb72 radv: tidy up radv_postprocess_nir()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
2026-03-16 07:49:59 +00:00
Natalie Vock
867d0b33b3 radv/rt: Bump ray query stack base limit for GFX12
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
GFX12 encoding added one bit to the stack offset, doubling the limit on
the stack base offset that is possible to encode. In practice, this
always allows using bvh_stack_push* instructions on GFX12 since LDS is
still 64kB.

Cc: mesa-stable
Fixes: 59a39779 (radv/rt: Only use ds_bvh_stack_rtn if the stack base is possible to encode)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40405>
2026-03-14 15:27:49 +00:00
Benjamin Cheng
e76a5e69ff radv/video_enc: Use variable slice mode when possible
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40329>
2026-03-12 20:22:30 +00:00
Samuel Pitoiset
1ed37ae5e6 radv/meta: remove redundant cache flushes when copying VRS rates to HTILE
No need to invalidate the VCACHE again (applications are supposed to
emit a barrier) and INV_SCACHE/INV_L2 are not necessary either.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40342>
2026-03-12 18:38:21 +00:00
Samuel Pitoiset
2afbf363ca radv: handle FRAGMENT_SHADING_RATE_ATTACHMENT_READ properly on GFX10.3
When VRS rates are copied from the VRS image to HTILE. Only the
vector cache needs to be flushed becaue it's using VMEM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40342>
2026-03-12 18:38:21 +00:00
Samuel Pitoiset
f65290f6f9 radv: advertise VK_KHR_copy_memory_indirect on GFX8+
GFX6-7 don't support indirect unaligned dispatches.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37634>
2026-03-12 12:33:04 +00:00
Samuel Pitoiset
99b3f4c7ab radv: implement VK_KHR_copy_memory_indirect
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37634>
2026-03-12 12:33:02 +00:00
Samuel Pitoiset
6b4a04505f radv/meta: make some functions non-static
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37634>
2026-03-12 12:33:02 +00:00
Marek Olšák
796e1749c6 ac: replace some packet field definitions in sid.h by generated ones
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40183>
2026-03-11 18:54:20 +00:00
Georg Lehmann
07d5c2cbaa radv: set no_signed_zero for FS store_output when format doesn't care
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Or when blending is enabled, because blending doesn't require IEEE math.

Foz-DB Navi21:
Totals from 367 (0.32% of 114627) affected shaders:
MaxWaves: 7884 -> 7876 (-0.10%); split: +0.20%, -0.30%
Instrs: 354948 -> 354386 (-0.16%); split: -0.16%, +0.00%
CodeSize: 1905980 -> 1903172 (-0.15%); split: -0.15%, +0.00%
VGPRs: 20208 -> 20216 (+0.04%); split: -0.08%, +0.12%
Latency: 1855670 -> 1854973 (-0.04%); split: -0.06%, +0.02%
InvThroughput: 540792 -> 539688 (-0.20%); split: -0.20%, +0.00%
PreSGPRs: 18426 -> 18366 (-0.33%)
PreVGPRs: 17213 -> 17249 (+0.21%); split: -0.05%, +0.26%
VALU: 258793 -> 258237 (-0.21%); split: -0.22%, +0.00%
SALU: 35168 -> 35166 (-0.01%); split: -0.01%, +0.01%

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40323>
2026-03-11 16:47:15 +00:00
Samuel Pitoiset
dfdaf6a277 radv: rewrite a comment explaining why PFP waits for ME with streamout
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40327>
2026-03-11 07:34:45 +00:00