Commit graph

8303 commits

Author SHA1 Message Date
Samuel Pitoiset
bead3f2ec3 radv: allow RADV_PERFTEST=shader_object on GFX9/VEGA10
It's passing VKCTS on VEGA10 but for some reasons RENOIR currently
hangs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27433>
2024-02-13 09:14:21 +00:00
Rhys Perry
926d9f1cef radv: support minmax filter for more formats
Support should be the same as AMDVLK, except for these formats:
- VK_FORMAT_R4G4_UNORM_PACK8
- VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT
- VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT
- VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR
- VK_FORMAT_A8_UNORM_KHR
- VK_FORMAT_X8_D24_UNORM_PACK32
- VK_FORMAT_D24_UNORM_S8_UINT
And the various emulated compressed formats.

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/27551>
2024-02-12 20:05:27 +00:00
Konstantin Seurer
fb62bffcda radv: Wire up ac_gather_context_rolls
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27322>
2024-02-12 14:04:24 +00:00
Samuel Pitoiset
6cab5559f9 radv: add support for emitting TES+GS compiled separately on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27432>
2024-02-12 08:09:28 +00:00
Samuel Pitoiset
dd92f5f664 radv: bind the vertex input SGPR only for relevant stages
Otherwise, user_data_0 is wrong if merged shaders are compiled
separately and if we have GS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27432>
2024-02-12 08:09:28 +00:00
Samuel Pitoiset
d64d7373f3 radv: declare AC_UD_TES_STATE for separate compilation of GS on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27432>
2024-02-12 08:09:28 +00:00
Samuel Pitoiset
e15d1ed7cb radv: declare streamout buffers for TES+GS compiled separately on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27432>
2024-02-12 08:09:28 +00:00
Samuel Pitoiset
83bc7e27a5 radv: force GS stage for TES as ES compiled separately on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27432>
2024-02-12 08:09:28 +00:00
Samuel Pitoiset
b58de424f4 radv: fix RGP barrier reason for RP barriers inserted by the runtime
Without that, RGP is confused and it's reporting CmdPipelineBarrier()
instead of CmdRenderPassSync().

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27546>
2024-02-12 07:50:16 +00:00
Hans-Kristian Arntzen
8b4259e69b wsi/x11: Disable vk_xwayland_wait_ready by default on most drivers.
Venus is special and still requires extra waits.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27074>
2024-02-10 11:47:22 +00:00
Pierre-Eric Pelloux-Prayer
6c3a294eef radv: don't remove the blit queue from the device queues
I don't remember why I implemented it like this in !13959, but
AFAICT there's no need to manually remove this queue from vk_device's
queues list.

On the other hand, this hack causes issues if syncobj timeline isn't
supported; amdgpu always support timeline, but amdgpu over virtio-gpu
doesn't.

The issue is as follow: the sequence in vk_queue.c:

   case VK_QUEUE_SUBMIT_MODE_DEFERRED:
      vk_queue_push_submit(queue, submit);
      return vk_device_flush(queue->base.device);

Would fail to produce the expected result, because vk_device_flush would
fail to realize that the blit queue has some pending work because
"vk_foreach_queue(queue, device)" would never process the queue.

Then, the call to vk_drm_syncobj_export_sync_file() would fail, because
the syncobj handle was never used in a submit.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27412>
2024-02-09 09:20:52 +01:00
Samuel Pitoiset
61a125647b radv: add radv_disable_ngg_gs and enable it for Persona 3 Reload
Persona 3 Reload is largely affected by the way amplification works with
NGG GS and disabling it drastically improve performance.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27518>
2024-02-09 07:24:16 +00:00
Samuel Pitoiset
69d734a8d5 radv: add RADV_DEBUG=nongg_gs for GFX10/GFX10.3
NGG GS doesn't perform well in some cases and having an option to
disable it for performance experiments is very useful.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27518>
2024-02-09 07:24:16 +00:00
Daniel Schürmann
932b9e6a23 radv: enable VK_KHR_shader_quad_control
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27277>
2024-02-09 05:32:35 +00:00
Daniel Schürmann
e546f2a55d radv: enable VK_KHR_shader_maximal_reconvergence
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27277>
2024-02-09 05:32:35 +00:00
Philip Rebohle
7b0fd4cc05 radv: Remove dead shared variables after optimization loop.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27104>
2024-02-08 18:27:57 +00:00
Samuel Pitoiset
63b238e84e radv: only load 3x32-bit elements when emitting draws with mesh shader
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27488>
2024-02-08 18:04:15 +00:00
Samuel Pitoiset
0296196d32 radv: remove unused radv_indirect_command_layout::state_offset
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27488>
2024-02-08 18:04:15 +00:00
Samuel Pitoiset
bde272349d radv: add support for emitting VS+GS compiled separately on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27388>
2024-02-08 13:33:34 +00:00
Samuel Pitoiset
416b20d381 radv: force GS stage for VS as ES compiled separately on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27388>
2024-02-08 13:33:34 +00:00
Samuel Pitoiset
8ef4c049ec radv: declare streamout buffers for VS+GS compiled separately on GFX9+
The shader input arguments must match.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27388>
2024-02-08 13:33:34 +00:00
Samuel Pitoiset
a68e19204e radv: rework shader arguments for separate compilation of VS+GS on GFX9+
The shader input args must match for VS+GS compiled separately.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27388>
2024-02-08 13:33:34 +00:00
Samuel Pitoiset
482dbacdeb radv/nir: lower esgs_vertex_stride for GS compiled separately on GFX9+
The ESGS vertex stride would be emitted at draw time using the number
of VS/TES outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27388>
2024-02-08 13:33:34 +00:00
Samuel Pitoiset
d777cbf66c radv: add a new user SGPR for the ESGS ring item size
With shader object, when VS+GS or TES+GS are compiled separately and
the VS has written (but unused) outputs, the ESGS vertex stride
must be passed through an user SGPR. This is because when the GS is
compiled we can't know the number of ES outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27388>
2024-02-08 13:33:34 +00:00
Eric Engestrom
faad4ffe97 radv: enable VK_EXT_headless_surface on all platforms except Windows
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27448>
2024-02-06 20:32:38 +00:00
Samuel Pitoiset
ffbd3e5b2d radv: change the user SGPR idx of AC_UD_TES_STATE
When GS will be compiled separately, we will have to always declare
both VS and TES user SGPRs because we can't know the previous stage,
and the shader input arguments must match and mustn't overlap.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27431>
2024-02-06 20:12:38 +00:00
Samuel Pitoiset
3e9815173a radv: set the default workgroup size for VS/TES as ES
If shaders are linked, the optimal value would be computed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27431>
2024-02-06 20:12:38 +00:00
Samuel Pitoiset
90e354afb0 radv: determine the workgroup size for GS non-NGG earlier
The wavesize for VS/TES/GS is always the same, so this can be computed
earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27431>
2024-02-06 20:12:38 +00:00
Samuel Pitoiset
35c9631162 radv: determine the ES stage earlier when processing binary config
This will help implementing VS+GS and TES+GS compiled separately on
GFX9+ because the shader config will need to be combined.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27431>
2024-02-06 20:12:38 +00:00
Samuel Pitoiset
03314b2a86 radv: check for MESA_SHADER_TESS_EVAL in radv_fill_shader_info_ngg()
This seems clearer to me.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27470>
2024-02-06 19:53:24 +00:00
Samuel Pitoiset
34572d535e radv: use next_stage to determine the NGG stage
This shouldn't change anything, except that it will help for ESO.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27470>
2024-02-06 19:53:24 +00:00
Samuel Pitoiset
31f006d352 radv: always set GS as NGG if present on GFX11
GFX11 is full NGG.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27470>
2024-02-06 19:53:24 +00:00
Samuel Pitoiset
55093270ed radv: squash GFX10/GFX10.3 NGG restrictions in the same condition
They don't apply on GFX11.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27470>
2024-02-06 19:53:24 +00:00
Samuel Pitoiset
237ab5db86 radv: remove one indentation level in radv_fill_shader_info_ngg()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27470>
2024-02-06 19:53:24 +00:00
Samuel Pitoiset
d15a43c9a9 radv: limit maxIndirectCommandsTokenCount to 512
512 is already large enough but UIN32_MAX is definitely too large.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27466>
2024-02-06 11:23:29 +00:00
Friedrich Vock
d4c094dfb4 radv/rt: Optimize update shader VGPR usage
Brings VGPR allocation down from 72 (absolutely insane) to 32.

We can now reach the theoretical maximum occupancy of 16 waves per SIMD.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27472>
2024-02-05 21:14:45 +01:00
Georg Lehmann
2ad3b83d23 radv: report rotate subgroup feature bits
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27444>
2024-02-05 11:20:28 +00:00
Dave Airlie
47c725b53e radv: don't submit 0 length on UVD either.
The kernel checks for UVD msgs and if there aren't any gets upset,
so don't submit 0 length on UVD rings either to avoid that.

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186>
2024-02-05 08:14:26 +00:00
Dave Airlie
df9bc11589 radv/uvd: uvd kernel checks for full dpb allocation.
The CTS image allocation sometimes doesn't try to allocate a complete
DPB, but the amdgpu kernel module checks for this, so always make
the DPB max sized on uvd instances.

Fixes part of video decode on Fiji/Polaris

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186>
2024-02-05 08:14:26 +00:00
Dave Airlie
bba36df84d radv: init decoder ip block earlier.
This makes the queue decisions later correct.

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186>
2024-02-05 08:14:26 +00:00
Dave Airlie
6065671a7f radv: fix correct padding on uvd
Fixes: 8a29291dbe ("radv/video: add h264 support for uvd")

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27186>
2024-02-05 08:14:26 +00:00
Samuel Pitoiset
c6286e39ec radv/sqtt: fix describing queue submits for RGP
The submit_sub_index field is used by RGP to determine the number of
submits. Previously, it was incorrectly reporting the same number of
submits than command buffers.

Fixes: 88cbe32048 ("radv: add support for RGP queue events")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27439>
2024-02-05 07:32:48 +00:00
Konstantin Seurer
b10ee44308 radv/rra: Implement ahit/isec counters
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 12:59:47 +01:00
Konstantin Seurer
767f628079 radv/rra: Dump basic ray history tokens
This only dumps the begin tokens. Tokens are written to a buffer
containing a 12 byte header at the beginning.

We use an intermediate format for the ray history tokens because the RRA
format is very inefficient.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 12:59:47 +01:00
Konstantin Seurer
26939f016d radv/rra: Refactor error handling
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 11:29:58 +01:00
Konstantin Seurer
46dddb57f9 radv/rra: Remove useless variable
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 11:29:58 +01:00
Konstantin Seurer
dc813288c3 radv/rra: Use memcpy for chunk descriptions
The identifier is not null terminated. "HistoryTokensRaw" does not fit
otherwise.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 11:29:58 +01:00
Konstantin Seurer
71c363acc3 radv/rra: Rename rra_chunk_type to rra_chunk_version
Found by inspecting RRA source.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25548>
2024-02-03 11:29:58 +01:00
Samuel Pitoiset
9698d5f0fd radv: add a workaround for mipmaps and minLOD on GFX6-8
This is spurious and it looks like we should be able to uses non-zero
base level everytime on GFX6-8 but it doesn't always work.

This fixes the remaining CTS failures on GFX6-8.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26290>
2024-02-02 18:06:25 +00:00
Samuel Pitoiset
f977501a7c radv: do not allow to enable VK_EXT_shader_object with LLVM
This isn't expected to work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27415>
2024-02-02 17:14:56 +00:00