Commit graph

10725 commits

Author SHA1 Message Date
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
Samuel Pitoiset
4022b5c94a radv: bind the vertex input state like a normal dynamic state
This is much cleaner.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37025>
2025-08-28 17:46:26 +00:00
Samuel Pitoiset
2f7e8751ea radv: replace an assertion with a check when emitting VS prolog
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37025>
2025-08-28 17:46:26 +00:00
Samuel Pitoiset
d29087d353 radv: use the dynamic state to store vertex input state
This is also a dynamic state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37025>
2025-08-28 17:46:26 +00:00
Samuel Pitoiset
d48096aed4 radv: remove unused parameter to radv_pipeline_init_dynamic_state()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37025>
2025-08-28 17:46:25 +00:00
Samuel Pitoiset
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/37025>
2025-08-28 17:46:25 +00:00
Samuel Pitoiset
53ce957983 radv: move radv_vertex_input_state to radv_pipeline_graphics.h
Like other similar states that are shared between graphics pipeline
and command buffers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37025>
2025-08-28 17:46:24 +00:00
Samuel Pitoiset
d7f401c2bb radv: bind the vertex binding strides like a normal dynamic state
This is much cleaner.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37025>
2025-08-28 17:46:24 +00:00
Samuel Pitoiset
9a5c540b75 radv: use the dynamic state to store vertex binding strides
This is a dynamic state. This also replaces the stride by a 16-bit
value because it's required to not exceed
VkPhysicalDeviceLimits::maxVertexInputBindingStride which is defined
to 2048.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37025>
2025-08-28 17:46:24 +00:00
Samuel Pitoiset
9597a3c13f radv: only update vertex stride if pStrides is non-NULL when binding VBO
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37025>
2025-08-28 17:46:23 +00:00
Georg Lehmann
acd879f096 radv: set ACCESS_CAN_SPECULATE for smem buffer loads with known good descriptors
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Foz-DB GFX1201:
Totals from 2872 (3.59% of 80098) affected shaders:
MaxWaves: 78208 -> 78234 (+0.03%); split: +0.21%, -0.18%
Instrs: 6214171 -> 6193701 (-0.33%); split: -0.40%, +0.07%
CodeSize: 33121244 -> 33113692 (-0.02%); split: -0.18%, +0.16%
VGPRs: 151680 -> 152016 (+0.22%); split: -0.25%, +0.47%
SpillSGPRs: 775 -> 776 (+0.13%)
Latency: 46080905 -> 45955331 (-0.27%); split: -0.55%, +0.28%
InvThroughput: 6235954 -> 6250598 (+0.23%); split: -0.25%, +0.48%
VClause: 111125 -> 110955 (-0.15%); split: -0.17%, +0.02%
SClause: 221845 -> 214761 (-3.19%); split: -3.20%, +0.01%
Copies: 501387 -> 488215 (-2.63%); split: -2.96%, +0.33%
Branches: 191455 -> 178574 (-6.73%)
PreSGPRs: 146364 -> 146923 (+0.38%); split: -0.12%, +0.50%
PreVGPRs: 120813 -> 121073 (+0.22%)
VALU: 3139282 -> 3137471 (-0.06%); split: -0.11%, +0.05%
SALU: 1079863 -> 1083158 (+0.31%); split: -0.55%, +0.86%
VMEM: 182255 -> 182247 (-0.00%)
SMEM: 293409 -> 290233 (-1.08%)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36938>
2025-08-27 09:45:19 +00:00
Samuel Pitoiset
81142f4574 radv: add radv_cmd_set_color_blend_equation()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:43 +00:00
Samuel Pitoiset
7a196d05a3 radv: add radv_cmd_set_sample_locations()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:43 +00:00
Samuel Pitoiset
62574e956c radv: add radv_cmd_set_rendering_input_attachment_indices()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:42 +00:00
Samuel Pitoiset
64daa52e9c radv: add radv_cmd_set_rendering_attachment_locations()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:42 +00:00
Samuel Pitoiset
0975d0ace9 radv: add radv_cmd_set_color_blend_enable()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:41 +00:00
Samuel Pitoiset
ea3bfcf29f radv: pre-compute color blend enable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:41 +00:00
Samuel Pitoiset
73f7253a70 radv: make radv_ps_epilog_state::color_blend_enable a 8-bit field
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:40 +00:00
Samuel Pitoiset
a4434eefd5 radv: add radv_cmd_set_viewport()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:38 +00:00
Samuel Pitoiset
d7e898868d radv: add radv_cmd_set_scissor()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:38 +00:00
Samuel Pitoiset
6fc5bfcbaa radv: add radv_cmd_set_scissor_with_count()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:37 +00:00
Samuel Pitoiset
5b351e76e0 radv: add radv_cmd_set_viewport_with_count()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:37 +00:00
Samuel Pitoiset
665dc09d08 radv: make use of RADV_DYNAMIC_{VIEWPORT,SCISSOR}_WITH_COUNT
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:37 +00:00
Samuel Pitoiset
c8b80d495c radv: add radv_cmd_set_discard_rectangle()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:36 +00:00
Samuel Pitoiset
a62b58cc66 radv: add radv_cmd_set_stencil_op()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:35 +00:00
Samuel Pitoiset
5e44081470 radv: add radv_cmd_set_stencil_test_enable()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:35 +00:00
Samuel Pitoiset
8602433d9f radv: add radv_cmd_set_depth_bounds_test_enable()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:34 +00:00
Samuel Pitoiset
0acbc86863 radv: add radv_cmd_set_depth_compare_op()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:34 +00:00
Samuel Pitoiset
e2145bd0c6 radv: add radv_cmd_set_depth_write_enable()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:33 +00:00
Samuel Pitoiset
d2aa54c76f radv: add radv_cmd_set_depth_test_enable()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:33 +00:00
Samuel Pitoiset
3bb31bc060 radv: add radv_cmd_set_discard_rectangle_enable()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36979>
2025-08-27 09:22:32 +00:00