Commit Graph

29 Commits

Author SHA1 Message Date
Tatsuyuki Ishi
b2e8095d6d radv: Add workaround to allow sparse binding on gfx queues.
For working around improper usage of sparse in DOOM Eternal.

When fully explicit sync sparse binding is implemented, this path will
remain implicit sync to also deal with the improper semaphore usage.
radv_queue_submit_bind_sparse_memory will likely get a bool parameter to
control explicit / implicit sync in that case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26464>
2023-12-07 11:40:38 +00:00
Rhys Perry
4d2a3b9573 radv: add radv_disable_trunc_coord option
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25911>
2023-11-17 15:15:27 +00:00
Samuel Pitoiset
9b840df9f6 radv: add drirc options to force re-compilation of shaders when needed
On Steam Deck, shaders are pre-compiled for better performance (less
stuttering, less CPU usage, etc). But when a compiler fix needs to be
backported, there is currently no way to handle this properly.

This introduces 3 drirc options
radv_override_{graphics,compute,ray_tracing}_shader_version in order to
force the driver to re-compile pipelines when needed. By default, the
shader version is 0 for all pipelines.

When one drirc is set for a specific game, RADV will re-compile all
pipelines only once with the compiler fix included (because the
pipeline key would be different).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26094>
2023-11-13 10:47:26 +00:00
Rhys Perry
2011b678c5 radv: disable gs_fast_launch=2 by default
This currently causes severe performance problems in Remnant 2 and
Alan Wake 2.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 28ebe62af2 ("radv: enable mesh shader gs_fast_launch=2 and multi-row export")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10071
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26090>
2023-11-07 19:54:47 +00:00
Jesse Natalie
228329f4da vulkan: Consolidate common ICD methods
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
Samuel Pitoiset
a97160cad8 radv: add RADV_DEBUG=nomeshshader
This option will be used to disable VK_EXT_mesh_shader in Mesa CI
for GFX11 because running task shader tests in parallel can hang the
GPU.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10051
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25969>
2023-11-01 08:49:35 +01:00
Samuel Pitoiset
eb47e07782 radv: remove NGG streamout support for RDNA1-2
This was useful for experimenting it on RDNA2 and during RNDA3 bringup,
but now the support is rock solid on RDNA3 and it's useless to keep the
RADV_PERFTEST=ngg_streamout option.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25903>
2023-10-30 08:51:51 +00:00
Samuel Pitoiset
1b0fbcbe1c radv: remove outdated RADV_DEBUG=vmfaults support
It's been a very long time since this was useless because dmesg
required sudo access for a while.

This will be replaced by the new GPUVM fault interface which allows
to query from the kernel directly instead of trying to parse dmesg.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>
2023-10-25 15:29:22 +00:00
Chia-I Wu
567c32b55c radv, drirc: rename radv_require_{etc2,astc}
Rename them to vk_require_{etc2,astc}.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:39 +00:00
Yogesh Mohan Marimuthu
f97b449e9e radv: integrate meta astc compute decoder to radv
this patch calls the init and finish functions of the vk
runtime astc decoder. initializes emulate_astc flag. sets
up the additional plane to store decoded texture.

v2: fix _tex_dataformat() and _tex_numformat() (Chia-I Wu)
    use correct function for bufferToImage (Chia-I Wu)
v3: add radv_is_layout_emulated() (Chia-I Wu)
    avoid repeated pattern (Chia-I Wu)
v4: not create all pipelines on_demand (Chia-I Wu)
v5: current code does not support astc hdr (Chia-I Wu)
v6: keep luts in staging buffer only (Chia-I Wu)
v7: use 2DArray for both input and output
v8: document todo to use fp16 (Chia-I Wu)
    not required to move meta init anymore (Chia-I Wu)
    move astc_emulation_format to vk_texcompress_astc.h (Chia-I Wu)
v9: remove LAYOUT check (Chia-I Wu)
    check on iview->vk.view_format
    move setting tiled flags for astc (Chia-I Wu)
    remove is format emulated check in radv_is_storage_image* (Chia-I Wu)
    use LAYOUT_ASTC for if check (Chia-I Wu)
    no 1D support (Chia-I Wu)
    calculate start end offset in 2x blk size
v10: remove old wrong code (Chia-I Wu)
v11: use existing defined local format variable (Chia-I Wu)
     dst image layout is always VK_IMAGE_LAYOUT_GENERAL (Chia-I Wu)

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:40 +00:00
Samuel Pitoiset
67ed899cd6 radv: remove absolute_depth_bias workaround
This was only used with Path of Exile and the game bug seems fixed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25198>
2023-09-19 07:53:51 +00:00
antonino
aa657247ce vulkan/wsi: add vk_wsi_force_swapchain_to_current_extent driconf
Add a driconf to force the swapchain size to match
`VkSurfaceCapabilities2KHR::currentExtent` as a workaround for
misbehaved games

Fixes: 6139493ae3 ("vulkan/wsi: return VK_SUBOPTIMAL_KHR for sw/x11 on window resize")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24818>
2023-09-06 00:10:41 +00:00
Rhys Perry
e88c077096 radv: workaround WWZ exporting index=1 through location=1
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 290c3d360e ("aco,radv: lower outputs to exports when nir for monolithic ps")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9232
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24354>
2023-07-31 11:38:14 +00:00
Friedrich Vock
d92520e19c Revert "Revert "radv: Enable ray tracing pipelines by default""
This reverts commit 49b400423c.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23978>
2023-07-08 10:10:15 +00:00
Konstantin Seurer
e0641ed59f radv/rgp: Use common trace trigger
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20573>
2023-06-27 06:25:56 +00:00
Konstantin Seurer
15d6618a12 radv: Add radv_trace_mode
...and add the RADV specific trace modes to the VK instance.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20573>
2023-06-27 06:25:56 +00:00
Eric Engestrom
8b319c6db8 radv: reformat according to its .clang-format
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23253>
2023-06-16 19:59:52 +00:00
Konstantin Seurer
49b400423c Revert "radv: Enable ray tracing pipelines by default"
This partially reverts commit 374bd4e1be.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23677>
2023-06-16 16:13:34 +00:00
Friedrich Vock
374bd4e1be radv: Enable ray tracing pipelines by default
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23603>
2023-06-13 19:38:27 +00:00
Friedrich Vock
fa7c7791ee radv: Add RADV_DEBUG=nort
This makes vkCmdTraceRaysKHR and ray queries no-ops and is useful
for triaging GPU hangs with raytracing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23603>
2023-06-13 19:38:27 +00:00
Friedrich Vock
496ea57d41 radv: Add driconf to force wave64 for RT
...and enable it for Hellblade: Senua's Sacrifice.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23585>
2023-06-12 18:36:56 +00:00
Dave Airlie
1a2a330483 radv/video: add debug flag to enable dpb image array on newer GPUs.
This is useful to test the paths on newer GPUs that work on older GPUs.

Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23227>
2023-05-30 02:53:32 +00:00
Vitaliy Triang3l Kuzmin
4ed2616ac3 radv: Fix vk_instance_init vk_error instance use-after-free
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22887>
2023-05-08 14:09:49 +00:00
Friedrich Vock
0b251d4362 radv: Add driconf to always drain waves before writing timestamps
UE4's Vulkan backend uses vkCmdWriteTimestamp with TOP_OF_PIPE
to measure how long a workload took in the GPU Benchmark. This is wrong
and writes the timestamp before the workload is actually finished,
making it seem like the GPU is much faster than it actually is.
This caused subsequent benchmark passes to contain way too big workloads,
which caused soft hangs on slower GPUs.

Fixes GPU hangs with Splitgate during automatic settings configuration.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22823>
2023-05-03 15:24:00 +00:00
Samuel Pitoiset
6476abd821 radv: enable VK_EXT_graphics_pipeline_library by default
You won't get your money back!

It's been a very long time but everything should be working great now.

This replaces RADV_PERFTEST=gpl by RADV_DEBUG=nogpl to disable the
extension for debugging purposes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22362>
2023-04-10 10:02:32 +00:00
Timur Kristóf
faf8375fc3 radv: Don't expose NV_mesh_shader and don't use it in CI.
Signed-off-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/22139>
2023-03-29 15:08:55 +00:00
Pierre-Eric Pelloux-Prayer
c1050b5330 radv: add RADV_DEBUG=extra_md
This enables the use of UMD metadata v2. This allows tools (eg umr)
import buffers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Tatsuyuki Ishi
a8c5fd3b1b radv: Upload shaders to invisible VRAM on small BAR systems.
Following PAL's implementation, this patch avoids allocating shader code
buffers in BAR and use SDMA to upload them to invisible VRAM
directly.

For some games like HZD, shaders can take as much as 400MB, which exceeds
the non-resizable BAR size (256MB) and cause inconsistent spilling
behavior. The kernel will normally move these to invisible VRAM on its own,
but there are a few cases that it does not reliably happen. This patch does
the moving explicitly in the driver to ensure predictable results.

In this patch, we upload the shaders synchronously; so the shader will be
ready as soon as vkCreate*Pipeline returns. A following patch will make
this asynchronous and don't block until we see a use of the pipeline.

As a side effect, when SQTT is used we now store the shaders on a cacheable
buffer which would speed up writing the trace to the disk.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:57 +00:00
Samuel Pitoiset
06fa90e14e radv: move instance related code to radv_instance.c
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767>
2023-03-08 16:21:10 +00:00