Commit graph

11573 commits

Author SHA1 Message Date
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
Samuel Pitoiset
d9420eed9e radv: fix missing L2 cache invalidation with streamout on GFX12
COPY_DATA emitted from the CP isn't coherent with L2, in case the
buffer filled size needs to be copied.

This fixes rare and random flickering with Mafia 3 Definitive Edition
on RDNA4.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14697
Cc: mesa-stable
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
Samuel Pitoiset
6c1d9612ef radv: only emit FORCE_S_VALID(1) for MSAA depth/stencil images
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This affects GFX12 only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40303>
2026-03-10 17:38:55 +00:00
Samuel Pitoiset
7cd3d40f86 radv: set {color,ds}_samples for inherited rendering state
There is no distinction for secondaries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40303>
2026-03-10 17:38:55 +00:00
Samuel Pitoiset
0da3714bd3 ac,radv,radeonsi: add has_db_force_stencil_valid_bug
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40303>
2026-03-10 17:38:54 +00:00
Samuel Pitoiset
cb5f2a0521 radv: initialize HiZ for UNDEFINED transitions on transfer queue
This doesn't consider layers/mips because it doesn't seem possible,
but it doesn't hurt correctness either, it just means HiZ is disabled.

This fixes dEQP-VK.api.copy_and_blit.core.use_after_copy.*_tq on GFX12.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40304>
2026-03-10 16:51:57 +00:00
Samuel Pitoiset
e293993fff radv: optimize clipping performance with PA_SU_HARDWARE_SCREEN_OFFSET
This optimization was missing in RADV for a very long time.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6492
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40249>
2026-03-10 12:07:46 +00:00
Samuel Pitoiset
c7cfa5324d radv: use common guardband computations
That shouldn't change anything.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40249>
2026-03-10 12:07:46 +00:00
Benjamin Cheng
8f1ace0571 radv: Disable video features for some DRM modifiers
Filter out video decode/encode format features when the DRM modifier
doesn't support video operations. Along with a CTS fix, this will fix
dEQP-VK.video.formats.* on UVD/VCN1 (which do not support swizzled
input).

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40203>
2026-03-09 23:27:46 +00:00
Samuel Pitoiset
8f10e2886c radv: dump the PS epilog in the GPU hang report
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40219>
2026-03-09 09:53:27 +00:00
Samuel Pitoiset
4c7958ae6c radv: apply the 1D workgroup optimization for mesh/task shaders too
Suggested-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40194>
2026-03-09 09:29:35 +00:00
Samuel Pitoiset
3c4cb16159 radv: fix local invocation index for mesh/task and quad derivatives on GFX12
It must be lowered.

This fixes
dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.{mesh,task}.*.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40194>
2026-03-09 09:29:34 +00:00
Samuel Pitoiset
4428541c54 radv/meta: fix HTILE fixup after copying depth/stencil image copies
Typo, it should be false because it's after the copy.

Fixes: 4f41818194 ("radv/meta: add a function to fixup HTILE metadata for copies on compute queue")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40270>
2026-03-09 09:07:09 +00:00
Samuel Pitoiset
fff16a9748 radv: replace radv_sdma_surf by ac_sdma_surf
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:47 +00:00
Samuel Pitoiset
c40225e490 radv: tidy up radv_sdma_surf
Adjust few things before replacing it by ac_sdma_surf.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:47 +00:00
Samuel Pitoiset
0616fd22a5 radv: simplify getting bpe for SDMA surfaces
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:46 +00:00
Samuel Pitoiset
9893ac3674 radv: remove unnecessary radv_sdma_surf::{blk_w,blk_h}
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:46 +00:00
Samuel Pitoiset
94acb7edd5 radv: simplify computing offset/extent of SDMA surfaces
By computing in elements earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:45 +00:00
Samuel Pitoiset
5923a7b8c6 radv: use vk_image_buffer_copy_layout() for SDMA buf layout
For consistency with non-SDMA paths.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:45 +00:00
Samuel Pitoiset
02d047099e radv: simplify 96-bit copies with SDMA
By adjusting offset/extent earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:45 +00:00
Samuel Pitoiset
6f3b9a62b3 radv: remove redundant radv_sdma_surf::is_linear
is_linear is never used for buffers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:44 +00:00
Samuel Pitoiset
dba9809e0c radv: remove redundant radv_sdma_surf::is_3d
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40186>
2026-03-09 08:40:44 +00:00
Samuel Pitoiset
1a00587c44 radv: fix a GPU hang with PS epilogs and secondary command buffers
If the secondary changes the fragment output state and if the same
PS epilog used before ExecuteCommands() is re-bind immediately after
that call, the PS epilog state wouldn't be re-emitted.

Apply the same change for VS prologs, although the logic is slightly
different and the bug shouldn't occur. The whole logic of secondaries
should be completely rewritten because it's definitely not robust.

This fixes a GPU hang in Where Winds Meet, see
https://github.com/doitsujin/dxvk/issues/5436.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40221>
2026-03-09 08:16:49 +00:00
Samuel Pitoiset
ac3fd06987 radv: always enable DISABLE_CONSERVATIVE_ZPASS_COUNTS on GFX11
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This might cause incorrect occlusion queries count.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40235>
2026-03-09 07:26:25 +00:00
Georg Lehmann
406935c6fe radv: use nir_opt_fp_math_ctrl
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Foz-DB Navi21:
Totals from 10833 (9.63% of 112497) affected shaders:
Instrs: 10090308 -> 10043030 (-0.47%); split: -0.48%, +0.01%
CodeSize: 53681564 -> 53556756 (-0.23%); split: -0.25%, +0.01%
VGPRs: 511568 -> 511296 (-0.05%); split: -0.08%, +0.03%
SpillSGPRs: 2442 -> 2438 (-0.16%); split: -0.20%, +0.04%
Latency: 58989785 -> 58935280 (-0.09%); split: -0.18%, +0.09%
InvThroughput: 15142587 -> 15067217 (-0.50%); split: -0.52%, +0.02%
VClause: 200588 -> 200410 (-0.09%); split: -0.20%, +0.11%
SClause: 257273 -> 257262 (-0.00%); split: -0.20%, +0.19%
Copies: 741430 -> 741397 (-0.00%); split: -0.22%, +0.22%
Branches: 211023 -> 211020 (-0.00%); split: -0.00%, +0.00%
PreSGPRs: 491752 -> 491663 (-0.02%); split: -0.02%, +0.00%
PreVGPRs: 418558 -> 418089 (-0.11%); split: -0.12%, +0.01%
VALU: 7064149 -> 7017847 (-0.66%); split: -0.66%, +0.01%
SALU: 1227287 -> 1226639 (-0.05%); split: -0.13%, +0.07%
SMEM: 449268 -> 449343 (+0.02%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40098>
2026-03-07 08:16:29 +01:00
Samuel Pitoiset
395132432b radv: initialize HiZ also for depth-only images
This is actually needed to initialize it to full expanded HiZ range.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40213>
2026-03-05 13:58:18 +00:00
Samuel Pitoiset
eaa51f4737 radv: remove unused radv_gfx12_get_hiz_clear_value()
This isn't necessary because depth/stencil clears use graphics.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40213>
2026-03-05 13:58:18 +00:00
Samuel Pitoiset
ab3ae53906 radv: add radv_image_has_hiz_metadata()
And rename few things.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40213>
2026-03-05 13:58:18 +00:00
Samuel Pitoiset
6358e48820 radv: add radv_image_has_hiz()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40213>
2026-03-05 13:58:17 +00:00
Rhys Perry
7de3552f3f radv: don't mask PS epilog spi_shader_col_format with dual source blending
In case the FS only writes one output.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
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/40005>
2026-03-05 09:38:24 +00:00
Rhys Perry
b4dc39f632 ac/nir: fix when both dual source outputs are unwritten
When this is the case. we shouldn't hang or crash.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
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/40005>
2026-03-05 09:38:23 +00:00
Samuel Pitoiset
783c065f3b radv: always fast-clear non-MSAA color image with comp-to-single on GFX10-10.3
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This should enable fast-clear for color images with the GENERAL layout
on GFX10-10.3. This seems important because DXVK tends to use that
layout more often now.

There are still issues with MSAA images, so it's only enabled for
single-sampled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40145>
2026-03-05 08:34:43 +00:00
Samuel Pitoiset
9de465da81 radv: remove radv_disable_depth_storage drirc
This was only for TW3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40214>
2026-03-05 07:55:27 +00:00
Samuel Pitoiset
74defc5f24 radv: disable STORAGE for depth-only formats
This is actually not needed because nobody is using storage with
depth-only formats and compression doesn't work at all anyways.

PAL and native don't allow this either.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40214>
2026-03-05 07:55:26 +00:00
Marek Olšák
f421eecebe radv,radeonsi: PA_SC_BINNER changes for gfx12
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/40022>
2026-03-04 21:14:56 +00:00
Marek Olšák
22f3761579 radv: make radv_postprocess_binary_config more correct and more readable
- don't set fields that don't exist on some generations
- add gfx_level checks for MEM_ORDERED even when it's technically not needed

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/40022>
2026-03-04 21:14:56 +00:00
Marek Olšák
fd6941650c ac: add ac_cu_info::has_fmask, adjust FMASK checks
Some of these should check has_fmask, others should check < GFX11.

v2: move to ac_cu_info

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/40022>
2026-03-04 21:14:56 +00:00
Samuel Pitoiset
37ba573877 radv/meta: set the depth/stencil resolve region depth to 1
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
No 3D.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40135>
2026-03-04 15:12:54 +00:00
Samuel Pitoiset
4d3549d372 radv/meta: rework the barrier for depth/stencil resolves
Yes, COLOR_ATTACHMENT_WRITE_BIT can be used to synchronize ds resolves.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40135>
2026-03-04 15:12:54 +00:00
Samuel Pitoiset
e7d135ae51 radv/meta: optimize synchronization with compute resolves
It's only required to synchronize at the end, so that all compute
resolves can run in parallel.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40135>
2026-03-04 15:12:53 +00:00
Samuel Pitoiset
fc0c3f6d84 radv/meta: remove an useless barrier before color resolves with graphics
No reason to require a barrier either because there is already one
before doing resolves and decompressions should already be correctly
synchronized.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40135>
2026-03-04 15:12:53 +00:00
Samuel Pitoiset
c9c16d62dd radv/meta: remove an useless barrier after color resolves with graphics
The app must synchronize with
VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT anyways.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40135>
2026-03-04 15:12:52 +00:00
Samuel Pitoiset
421b15cd3a radv/meta: remove redundant barriers in vkCmdResolveImage2()
The source image layout must be either TRANSFER_SRC or GENERAL and the
application must emit the image layout transition. There is no reason
the source image wouldn't be readable by shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40135>
2026-03-04 15:12:52 +00:00
Rhys Perry
5c3b5688a1 amd: rename ac_cu_info to ac_compiler_info
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/40042>
2026-03-03 08:50:12 +00:00
Rhys Perry
a65089dfce ac/nir: pass ac_cu_info to ac_nir_compute_tess_wg_info
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/40042>
2026-03-03 08:50:11 +00:00
Rhys Perry
8801ca188d ac/nir: don't pass radeon_info to ac_nir_set_options
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/40042>
2026-03-03 08:50:10 +00:00
Rhys Perry
5a8a7dbb22 ac/nir: don't pass radeon_info to NGG lowering
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/40042>
2026-03-03 08:50:09 +00:00
Rhys Perry
36feec61c8 ac/nir: use ac_nir_lower_ngg_options for ac_nir_lower_ngg_mesh
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/40042>
2026-03-03 08:50:09 +00:00
Samuel Pitoiset
27b6ad994a radv: fix computing pitch/slice_pitch for compressed block formats
Also there is no need to multiply for dividing later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40121>
2026-03-02 14:44:14 +00:00
Samuel Pitoiset
67c985d754 radv: mark linear images for SDMA as potentially compressed on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40121>
2026-03-02 14:44:14 +00:00