Commit graph

10755 commits

Author SHA1 Message Date
Samuel Pitoiset
62c92a0516 radv: rework the optimal packet order for task/mesh draws
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37013>
2025-09-05 07:28:13 +00:00
Samuel Pitoiset
f5bbe5228f radv: rework the optimal packet order for "normal" draws
This idea comes from RadeonSI but RADV was already implementing
something similar. Except that it checked for wait-for-idle but this
shouldn't be necessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37013>
2025-09-05 07:28:12 +00:00
Samuel Pitoiset
f289e8eddc radv: only expose permitted global queue priorities
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It's the responsability of the application to check for
VK_ERROR_NOT_PERMITTED, but filtering not permitted priorities seems
better.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13775
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37076>
2025-09-05 06:34:36 +00:00
Samuel Pitoiset
43cba046e6 radv/amdgpu: add a function to query permitted context priorities
The only way I know of is to create a context to verify if a priority
is permitted or not.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37076>
2025-09-05 06:34:36 +00:00
Samuel Pitoiset
57deff5658 radv: fix vk_error in radv_update_preambles()
This needs to be a vk object, otherwise it asserts or crashes.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37179>
2025-09-05 06:14:49 +00:00
Samuel Pitoiset
44541e84e9 radv: move misc related drirc to radv_drirc::misc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:17 +00:00
Samuel Pitoiset
8e4d5743d2 radv: move debug related drirc to radv_drirc::debug
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:17 +00:00
Samuel Pitoiset
f13b181791 radv: move performance related drirc to radv_drirc::performance
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:16 +00:00
Samuel Pitoiset
d575b91b3a radv: move features related drirc to radv_drirc::features
For better organization.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:16 +00:00
Samuel Pitoiset
d915f24cb2 radv: move drirc options to a separate struct
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:15 +00:00
Samuel Pitoiset
d98e31eab6 radv: mark RADV_DEBUG=nongg_gs as deprecated
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:15 +00:00
Samuel Pitoiset
7304423b5c radv: mark RADV_DEBUG=splitfma as deprecated
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:14 +00:00
Samuel Pitoiset
4748ecb238 radv: mark RADV_DEBUG=invariantgeom as deprecated
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:13 +00:00
Samuel Pitoiset
a8a8bfee1f radv: mark RADV_DEBUG=nodynamicbounds as deprecated
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
2025-09-05 05:56:13 +00:00
Georg Lehmann
83326af899 nir/builder: add nir_inverse_ballot_imm
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37178>
2025-09-04 14:03:56 +00:00
Georg Lehmann
ef8c364d3d nir: make inverse_ballot 1bit only
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37178>
2025-09-04 14:03:56 +00:00
Yiwei Zhang
94d8a4a465 radv: bind aliased wsi image at memory offset zero
This aligns with common wsi, and also obeys dedicated alloc requirement.

Fixes: 825c05a7e8 ("radv: adopt wsi_common_get_memory")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37152>
2025-09-03 16:29:34 +00:00
Rhys Perry
7f5c84d7ac radv: fix shift overflow in radv_pipeline_init_dynamic_state
Fixes UBSan error with thewitness/005aa77325a11410:
runtime error: left shift of 15 by 28 places cannot be represented in type 'int'

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37055>
2025-09-03 11:47:00 +00:00
Samuel Pitoiset
3cb77cb144 radv/rt: fix a potential issue with RADV_PERFTEST=dmashaders
Shaders must be synchronized before doing anything.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37126>
2025-09-03 06:16:14 +00:00
Samuel Pitoiset
decf9af472 radv/rt: only use one user SGPR for the traversal shader addr
All shaders are allocated in the 32-bit addr space. To avoid an issue
with alignment, and also for future work, there is an unused user SGPR.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37133>
2025-09-03 05:53:41 +00:00
Daniel Schürmann
fcf8899c9e radv/rt: use ACCESS_CAN_REORDER when loading SBT entries
Totals from 56 (0.07% of 79839) affected shaders: (Navi48)

Instrs: 2790220 -> 2790130 (-0.00%); split: -0.00%, +0.00%
CodeSize: 14704952 -> 14704292 (-0.00%)
Latency: 13994383 -> 13953444 (-0.29%); split: -0.29%, +0.00%
InvThroughput: 2717973 -> 2710748 (-0.27%); split: -0.27%, +0.00%
VClause: 68783 -> 68687 (-0.14%)
SClause: 51910 -> 52007 (+0.19%)
Copies: 223192 -> 223190 (-0.00%); split: -0.01%, +0.01%
VALU: 1557513 -> 1557451 (-0.00%); split: -0.00%, +0.00%
VMEM: 118789 -> 118692 (-0.08%)
SMEM: 66498 -> 66595 (+0.15%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36933>
2025-09-02 19:07:30 +00:00
David Rosca
3f317348c2 radv/video: Fix VP9 loop filter and segmentation params
Fixes: b8ac2d47e7 ("radv/video: add KHR_video_decode_vp9 support.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13801
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37080>
2025-09-02 10:46:23 +00:00
Samuel Pitoiset
ff0197d44a radv: disable VK_EXT_image_compression_control on GFX12
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This extension is mostly only used by vkd3d-proton to disable DCC for
game bugs. On GFX12 DCC is completely transparent to the userspace
driver, so exposing this extension isn't very useful.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37122>
2025-09-02 06:36:16 +00:00
Samuel Pitoiset
9b90d3fa4d radv: remove unnecessary radv_graphics_pipeline::is_ngg
Use the last VGT shader to know if it's using NGG.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37120>
2025-09-02 06:18:05 +00:00
Samuel Pitoiset
2ccdae24cf radv: remove set but unused radv_graphics_pipeline fields
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37120>
2025-09-02 06:18:05 +00:00
Samuel Pitoiset
478cbb6113 radv: remove set but unused has_nggc in radv_cmd_state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37120>
2025-09-02 06:18:05 +00:00
Samuel Pitoiset
8958acb424 radv: remove unused radv_pipeline::user_data_0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37120>
2025-09-02 06:18:04 +00:00
David Rosca
e394244a89 radv: Use extra context for video encode queue with multiple VCN instances
amdgpu does VCN instance scheduling per context, so we need to use
different context in order to allow decode to run on one instance
and encode on the other one.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36642>
2025-09-01 10:56:31 +00:00
Mike Blumenkrantz
213a63f236 radv: ALWAYS_INLINE radv_upload_graphics_shader_descriptors and relateds
Reduce the CPU overhead of these functions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:53:02 +00:00
Samuel Pitoiset
4046317040 radv: fix compiler warnings when uploading cmdbuf data might fail
Just need to return to avoid possible uninitialized variables.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:53:02 +00:00
Samuel Pitoiset
f3e0d4a60b radv: translate stencil op earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:53:01 +00:00
Samuel Pitoiset
a9cae4d43c radv: remove unnecessary ternary expressions in radv_emit_depth_stencil_state()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:53:01 +00:00
Samuel Pitoiset
1cbb9dc846 radv: rename DIRTY_PATCH_CONTROL_POINTS_STATE to DIRTY_LS_HS_CONFIG
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:53:00 +00:00
Samuel Pitoiset
41ad7e6eaf radv: do not trigger PATCH_CONTROL_POINTS_STATE on GFX12
The number of patch control points is emitted as part of VGT_PRIM_STATE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:53:00 +00:00
Samuel Pitoiset
47d2af814f radv: pre-compute tessellation num patches/lds size earlier
This will also pre-compute when the state is static but I think it's
less error prone like this and also more consistent.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:59 +00:00
Samuel Pitoiset
51d16e9aec radv: dirty the raster state when setting the primitive topology
Instead of the dynamic state which is equivalent but abusing
dirty_dynamic for stuff like that isn't a good idea.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:59 +00:00
Samuel Pitoiset
0e398ddc43 radv: cleanup configuring AUTO_RESET_CNTL
There is already a different branch for >= GFX12 and older gens.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:58 +00:00
Samuel Pitoiset
93d3427543 radv: emit BREAK_BATCH when the PS changes also for ESO
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:58 +00:00
Samuel Pitoiset
93ffb0db03 radv: add an early return to radv_flush_vertex_descriptors()
To prevent mesh shaders to potentially crash. Also remove the assertion
which is now useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:57 +00:00
Samuel Pitoiset
be8ccf6378 radv: use radv_get_vgt_outprim_type() for the NGG SGPRs state
Shouldn't change anything either but vgt_outprim_type will be
pre-computed later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:56 +00:00
Samuel Pitoiset
d14ff3eafe radv: use radv_get_vgt_outprim_type() to disable NGGC for points/lines
This shouldn't change anything because NGGC for points/lines are
disabled at compile time for TES/GS. It's only unconditionally enabled
for VS because with fast-GPL/ESO, the driver might not know the
primitive topology at compile time and it must be disabled dynamically
later.

Note that NGGC supports culling lines now, so it could be enabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:56 +00:00
Samuel Pitoiset
4cbadc85e0 radv: clear dynamic states earlier
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:55 +00:00
Samuel Pitoiset
12d618ef64 radv: split RADV_CMD_DIRTY_NGGC_STATE in two states
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:55 +00:00
Samuel Pitoiset
bc9a020dd3 radv: rename NGG culling user SGPRs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37022>
2025-09-01 08:52:55 +00:00
Samuel Pitoiset
0c6b39d4fb radv: add RADV_GFX12_HIZ_WA to select the HiZ wa behavior on GFX12
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Will be useful for benchmarking.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36839>
2025-09-01 07:02:24 +00:00
Samuel Pitoiset
e4ef804013 radv: allow to select a different HiZ workaround on GFX12
And describe all of them better.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36839>
2025-09-01 07:02:24 +00:00
Samuel Pitoiset
4ce8d471b5 radv: fix setting VBO misaligned mask in graphics pipelines
Typo.

Fixes: 3eed98d122 ("radv: move VBO misaligned/unaligned info to radv_vertex_input_state")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37078>
2025-09-01 06:24:55 +00:00
Marek Olšák
9e16ed7a13 ac/nir: switch nir_load_smem_amd uses to ac_nir_load_smem wrapper
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
ac_nir_load_smem will use load_global_amd

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37101>
2025-08-30 15:04:32 -04:00
Antonio Ospite
b39046b9ba radv: fix building with libdrm as a submodule
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When building with libdrm as an internal fallback dependency, i.e.
a submodule, meson does not find `amdgpu.h` from the installed external
dep, failing to build with the following error:

-----------------------------------------------------------------------
In file included from ../src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c:10:
In file included from ../src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h:18:
../src/amd/common/ac_linux_drm.h:14:10: fatal error: 'amdgpu.h' file not found
   14 | #include "amdgpu.h"
      |          ^~~~~~~~~~
1 error generated.
-----------------------------------------------------------------------

Make libvulkan_radeon depend explicitly on dep_libdrm_amdgpu to also use
the include_directories declared for that dependency in case it's an
internal dependency.

Acked-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36932>
2025-08-28 18:08:20 +00:00
Antonio Ospite
18ef7b82c6 radv: don't include amdgpu.h directly
Don't include amdgpu.h directly in AMDGPU/RADV code, the only libdrm
pieces that are needed are handled in src/amd/common/ac_linux_drm.h
which already includes amdgpu.h

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36932>
2025-08-28 18:08:20 +00:00