Commit Graph

10635 Commits

Author SHA1 Message Date
Samuel Pitoiset 5aba130eab radv: check if SQTT is enabled before calling radv_describe_draw()
This is faster.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37005>
2025-08-27 06:19:14 +00:00
Samuel Pitoiset a3f9d85270 radv: add a new state for forced VRS rates
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37005>
2025-08-27 06:19:14 +00:00
Samuel Pitoiset 6d1e7c2ddf radv: clear descriptors state dirty bit outside of the caller
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37005>
2025-08-27 06:19:13 +00:00
Samuel Pitoiset 9b912f00c7 radv: handle fbfetch output after binding graphics shaders
uses_fbfetch_output might be updated when a fragment shader is bound.
This would only affect ESO and I'm not sure it's possible though.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37005>
2025-08-27 06:19:13 +00:00
Samuel Pitoiset 664c9697aa radv: clear RADV_CMD_DIRTY_xxx bits outside of the caller in more cases
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37005>
2025-08-27 06:19:13 +00:00
Autumn Ashton 8e1734d2f2 radv: Allow MUTABLE_FORMAT and EXTENDED_USAGE for qp_map images
Signed-off-by: Autumn Ashton <misyl@froggi.es>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36943>
2025-08-26 23:19:58 +00:00
Autumn Ashton f4597930ef radv: Support VK_IMAGE_TILING_OPTIMAL for quantization maps
Saw this when implementing something else, that I could just add the handling here to radv_choose_tiling in order to expose OPTIMAL.

Signed-off-by: Autumn Ashton <misyl@froggi.es>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36943>
2025-08-26 23:19:58 +00:00
Samuel Pitoiset b9221c7c89 radv: advertise VK_KHR_shader_untyped_pointers
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36677>
2025-08-26 13:47:08 +00:00
Samuel Pitoiset c5a5c8818c radv/nir/lower_cmat: handle untyped pointers for load/store
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36677>
2025-08-26 13:47:07 +00:00
Samuel Pitoiset f08ad89e44 radv: run nir_opt_memcpy before nir_opt_copy_prop_vars
Because nir_opt_copy_prop_vars doesn't handle casts well with
nir_intrinsic_memcpy_deref.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36677>
2025-08-26 13:47:07 +00:00
Samuel Pitoiset bfd84562a0 radv: run nir_lower_memcpy after spirv->nir
To make sure all memcpy are lowered correctly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36677>
2025-08-26 13:47:07 +00:00
Samuel Pitoiset 944e26eae7 radv: fix hashing graphics pipeline when no stages are compiled
It's possible with GPL.

This fixes a NULL pointer dereference with updated pipeline binaries
tests in VKCTS.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36999>
2025-08-26 07:37:40 +00:00
Dave Airlie a6e0cbd110 radv: consolidate cooperative matrix array sizes enumeration
Share the code between khr and nv paths to not have to recreate it.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36544>
2025-08-25 18:55:08 +00:00
Dave Airlie a55c036450 radv: add support for coopmat2 flexible dimensions
This allows matricies that are multiples of a base size.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36544>
2025-08-25 18:55:08 +00:00
Samuel Pitoiset 102892a458 radv: clear RADV_CMD_DIRTY_xxx bits outside of the caller in most cases
Prevent risks if an early return is added at some point.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:39 +00:00
Samuel Pitoiset 3ecf9a17f8 radv: stop abusing dirty_dynamic when binding a NULL fragment shader
RADV_DYNAMIC_RASTERIZATION_SAMPLES triggers the following states:
- FS (not needed when FS is NULL)
- MSAA (already triggered)
- BINNING (use radv_get_ps_iter_samples() on GFX9)
- OCCLUSION_QUERY (doesn't use the PS)
- DB_SHADER_CONTROL (already triggered)
- RAST_SAMPLES (use radv_get_ps_iter_samples())
- NGGC (doesn't use the PS)

So this can be simplified to BINNING (gfx9) | RAST_SAMPLES.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:38 +00:00
Samuel Pitoiset 19c712c8ef radv: rename rast_prim to vgt_outprim_type everywhere
To avoid confusion between the primitive topology and the output
rasterized primitive.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:38 +00:00
Samuel Pitoiset 5dec043cee radv: dirty the rast samples state when VRS is forced to 1x1
Only these two states use force_sample_iter_shading_rate.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:37 +00:00
Samuel Pitoiset 8120d14ee0 radv: dirty RADV_CMD_DIRTY_xx states when binding sample shading state
This reduces the number of states that are re-emitted but the logic
is mostly duplicated because sample shading can be set from the
fragment shader or the graphics pipeline. Could be refactored
eventually.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:34 +00:00
Samuel Pitoiset 4afff72e91 radv: dirty the rast sample states for VRS att/OOO rast
These fields are only used by radv_emit_rast_samples_state().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:32 +00:00
Samuel Pitoiset 4dd05c9a91 radv: remove dead code when setting dynamic primitive topology
This is already handled slightly above in the same function. Also
state->dirty isn't for RADV_DYNAMIC_xxx and there is no corresponding
RADV_CMD_DIRTY_xxx either.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:31 +00:00
Samuel Pitoiset dbcc9aa942 radv: remove radv_cmd_buffer_flush_dynamic_state()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:31 +00:00
Samuel Pitoiset 12f8508363 radv: add a new dirty bit for the VGT prim state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:31 +00:00
Samuel Pitoiset 4096009ea1 radv: add a new dirty bit for the patch control points state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:30 +00:00
Samuel Pitoiset 0c3680bea3 radv: add a new dirty bit for the tess domain origin state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:29 +00:00
Samuel Pitoiset 99b287bde5 radv: add missing L2 invalidate cache flush for non-coherent images
Images aren't always coherent with L2 and AMD generations have
different rules, see radv_image_is_l2_coherent() for the full picture.

This fixes a rendering issue on GFX9 because depth/stencil images
aren't coherent, but this also affects color images.

This also fixes a cache coherency issue with an ongoing extension.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12274
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36815>
2025-08-25 07:28:50 +00:00
Konstantin Seurer 906b541567 radv/bvh: Copy parent_id during updates on GFX12
Fixes: cc0dc4b5 ("radv: Store parent node IDs inside nodes on GFX12")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13567
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36898>
2025-08-24 13:45:29 +00:00
Faith Ekstrand 9a023b3615 vulkan/wsi: Make get_blit_queue return a struct vk_queue *
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:03 +00:00
Autumn Ashton ae6ea69c85 radv: Implement VK_KHR_video_encode_quantization_map
Implement VK_KHR_video_encode_quantization_map on < VCN5.

Passes CTS for `*quantization_map*`.

Signed-off-by: Autumn Ashton <misyl@froggi.es>
Reviewed-by: David Rosca <david.rosca@amd.com>
Closes: #13717
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36797>
2025-08-22 16:31:59 +00:00
Georg Lehmann 8360c3e81c radv: shrink shared arrays
Foz-DB Navi21:
Totals from 2 (0.00% of 80255) affected shaders:
No stat changes.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26388>
2025-08-22 13:47:47 +00:00
David Rosca 8ac9a9afee radv/video: Disable H264 encode 8x8 transform when CABAC is disabled
VCN5 only supports it with CABAC enabled.

Fixes: 960f63596f ("radv/video: Add VCN5 encode support")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36881>
2025-08-22 12:38:23 +00:00
Samuel Pitoiset db298d1b50 radv: make radv_cmd_state::dirty a 64-bit field
More RADV_CMD_DIRTY states will be added later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:05 +00:00
Samuel Pitoiset 772f185fc0 radv: add a new dirty bit for the scissor state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:05 +00:00
Samuel Pitoiset 54b79d0f50 radv: add a new dirty bit for the sample locations state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:04 +00:00
Samuel Pitoiset dc3371332e radv: add a new dirty bit for the blend constants state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:04 +00:00
Samuel Pitoiset 1be9cd43a8 radv: add a new dirty bit for the VS prolog state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:03 +00:00
Samuel Pitoiset cc7b5ab0c9 radv: dirty more states when rendering begins
radv_get_ps_iter_samples() is used by :
- binning state
- rast samples state
- FS state
- MSAA state

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:02 +00:00
Samuel Pitoiset 80e8cb196f radv: dirty the cb render state when rendering begins
RADV_DYNAMIC_COLOR_BLEND_ENABLE trigger the cb render state, the db
shader control state and PS epilogs. Though, it's unecessary to re-emit
the db shader control and PS epilogs are already triggered when the
fb is dirty.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:02 +00:00
Samuel Pitoiset 1db3d4f182 radv: dirty the depth stencil state when rendering begins
RADV_DYNAMIC_STENCIL_TEST_ENABLE only triggers
RADV_CMD_DIRTY_DEPTH_STENCIL_STATE but it's better to dirty the RADV
state than the dynamic one.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:01 +00:00
Samuel Pitoiset 7694ad969e radv: add a new dirty bit for the depth bias state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36901>
2025-08-22 08:12:00 +00:00
Yonggang Luo de1a2a3537 util: Remove the __declspec(dllexport) on win32 for PUBLIC export macro
As on Windows, all DLLs are exported use def files, there is no need do __declspec(dllexport) on the function marker.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36863>
2025-08-22 02:05:57 +00:00
Samuel Pitoiset cbe42a4c43 radv: rename RADV_CMD_DIRTY_TESS_STATE to RADV_CMD_DIRTY_TCS_TES_STATE
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:35 +00:00
Samuel Pitoiset 3d1efbce98 radv: add a new dirty bit for the rast samples state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:35 +00:00
Samuel Pitoiset ea6cb5e7bf radv: add a new dirty bit for the FSR state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:35 +00:00
Samuel Pitoiset 604296a282 radv: add a new dirty bit for the ngg culling state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:34 +00:00
Samuel Pitoiset d9d9052c56 radv: validate dynamic states for the db shader control state earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:34 +00:00
Samuel Pitoiset 02ecb70e7f radv: validate dynamic states for the occlusion query state earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:33 +00:00
Samuel Pitoiset 81af123ab1 radv: optimize re-emitting the occlusion query state on GFX12
The number of samples is only needed on older generations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:33 +00:00
Samuel Pitoiset 5db8a16053 radv: add a new dirty bit for the binning state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:32 +00:00
Samuel Pitoiset c4c44187f9 radv: only re-emit needed states when PS inner coverage changes
It's emitted as part of the MSAA state but re-emitting the NGG culling
state isn't necessary because ps.reads_fully_covered isn't used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36875>
2025-08-21 18:36:32 +00:00