Commit Graph

159041 Commits

Author SHA1 Message Date
Jason Ekstrand 44ab076fea vulkan: Add a vk_command_buffer_ops struct
This is the standard pattern in the kernel for providing vfunc tables
for C objects.  We're using it in the pipeline cache code but we're
about to start adding more stuff and so it really helps if we have it
for command buffers as well.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18324>
2022-09-01 20:17:25 +00:00
Jason Ekstrand 5c143b132a vulkan: Re-order arguments to vk_command_buffer_init
Most other init functions follow the Vulkan API convention of putting
the parent object first.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18324>
2022-09-01 20:17:25 +00:00
Jason Ekstrand f90e2af996 vulkan: Re-order arguments to vk_command_pool_init
Most other init functions follow the Vulkan API convention of putting
the parent object first.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18324>
2022-09-01 20:17:25 +00:00
Jason Ekstrand ea9e7ecdc1 vulkan: Add a concept of recycling an object
This is not necessarily a full re-initialization of the object but is
whatever is necessary/expedient for the client to see it as a new object
and not the one it has seen before.  For vk_base_object, this removes
any private data and resets the object name to NULL.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18324>
2022-09-01 20:17:25 +00:00
Chia-I Wu 63b1290c2f turnip: add some cpu tracepionts
Add tracepoints for pipeline creations and queue submits.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18262>
2022-09-01 19:30:13 +00:00
Chia-I Wu 89d49bb9de vulkan/wsi: add cpu tracepoints for internal waits
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18262>
2022-09-01 19:30:13 +00:00
Chia-I Wu 7d5227341c vulkan/wsi: add cpu tracepoints to swapchain functions
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18262>
2022-09-01 19:30:13 +00:00
Connor Abbott f640661e54 tu/lrz: Fix multiple depth attachment case with secondaries
This is a counterpart to the previous commit. When we have multiple
depth attachments, in the secondary we currently don't disable LRZ and
so we may need a valid LRZ fast-clear base.

Fixes: 4b5f0d98 ("tu: Overhaul LRZ, implement on-GPU dir tracking and LRZ fast-clear")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18369>
2022-09-01 19:11:19 +00:00
Connor Abbott bf09a5881b tu/lrz: Fix multiple subpass case with secondaries
In
dEQP-VK.renderpass.dedicated_allocation.attachment_allocation.input_output.94
we have the following:

- There is more than one subpass, but only one depth attachment.
- The first subpass doesn't use depth.
- The subpass that does use depth has a draw call in a secondary.

We wouldn't hit the case where there's more than one depth attachment,
but because tu_begin_resumed_renderpass() only looked at the first
subpass it wouldn't find the depth attachment and would leave LRZ
invalid and thus a NULL LRZ fast-clear base. Then
tu_begin_secondary_cmdbuf() would leave LRZ enabled and the draw would
have LRZ enabled, leading to a hang.

Fix this by making tu_begin_resumed_renderpass() match
tu_begin_renderpass() with how it finds the depth attachment.

Fixes: 4b5f0d98 ("tu: Overhaul LRZ, implement on-GPU dir tracking and LRZ fast-clear")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18369>
2022-09-01 19:11:19 +00:00
Samuel Pitoiset 23fca58ef3 radv: constify radv_shader_info where it's missing
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 72a8319471 radv: determine as_ls/as_es in radv_link_shaders_info()
This is a link shader info step somehow.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 4d756d8ae3 radv: remove unused parameters in radv_fill_shader_info()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset be9cded237 radv: add and use a helper that merges shader info for merged stages on GFX9+
It looks much cleaner and it's pretty small.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 60a7115b4e radv: cleanup computing the workgroup size for all stages
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 5082918d65 radv: simplify determining if NGG passthrough can be enabled
NGG can't be enabled with XFB, so this check is redundant now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset dda00dd40b radv: move determining other NGG settings in radv_link_shaders_info()
At least, everything is at the same place now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset dfdd875b06 radv: refactor radv_nir_shader_info_link()
To use the similar producer/consumer logic we do when linking shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 2f9b30f30c radv: move computing NGG info and GS info to radv_nir_shader_info_link()
It's a link step somehow, except for VS only on GFX10+ but keep it
there anyways.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 13af51b2f3 radv: move computing wave_size/ballot_bit_size to the shader info pass
NGG helpers need to know this information.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 19308db39d radv: cleanup helpers that compute NGG info and GS info on GFX9+
Before moving them to the shader info link step.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 5cfd5c10eb radv: stop setting esgs_itemsize to the GS stage
It's never read.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset b7adf82928 radv: stop setting num_tess_patches for the GS stage
It's never read.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset e9fb732d0a radv: stop setting as_es for the GS stage
This doesn't make sense and it was assigned because the shader info
stuff was a complete mess.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset 0591ff4e5f radv: stop setting as_ls for the TCS stage
This doesn't make sense and it was assigned because the shader info
stuff was a complete mess. LS is only a thing on GFX6-8, on GFX9+
it's a merged VS+TCS to HS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:17 +00:00
Samuel Pitoiset df997cf47d aco: remove unused isel_context::tcs_num_patches
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18278>
2022-09-01 17:02:16 +00:00
Samuel Pitoiset 047738daa7 radv: fix bogus assertion with RADV_FORCE_VRS
It supports VS, TES and GS.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18345>
2022-09-01 16:09:37 +00:00
Friedrich Vock f0d10d0352 radv: Free geometry infos in radv_CmdBuildAccelerationStructuresKHR
Fixes: 97ffaea5 ("radv: Add Radeon Raytracing Analyzer capturing layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18370>
2022-09-01 15:46:20 +00:00
Friedrich Vock 4f846468e1 radv: Use radv_CmdUpdateBuffer instead of radv_update_buffer_cp for geometry info writes
This fixes some hangs and avoids an assert if geometry infos are bigger than 1KB.

Fixes: 97ffaea5 ("radv: Add Radeon Raytracing Analyzer capturing layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18370>
2022-09-01 15:46:20 +00:00
Alyssa Rosenzweig e55b60d0bb panfrost: Route shader-db to debug, not stderr
This brings us in line with the rest of Mesa, fixing multithreaded shader-db
reports and the Total CPU Time report at the end.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
2022-09-01 14:50:24 +00:00
Alyssa Rosenzweig 70e269ac6f r300: Use u_default_set_debug_callback
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
2022-09-01 14:50:24 +00:00
Alyssa Rosenzweig a7aa8fbf7a etnaviv: Use u_default_set_debug_callback
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
2022-09-01 14:50:24 +00:00
Alyssa Rosenzweig 161e35e156 lima: Use u_default_set_debug_callback
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
2022-09-01 14:50:24 +00:00
Alyssa Rosenzweig 741c8d8c77 softpipe: Use u_default_set_debug_callback
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
2022-09-01 14:50:24 +00:00
Alyssa Rosenzweig ad5f0592cc vc4: Use u_default_set_debug_callback
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
2022-09-01 14:50:24 +00:00
Alyssa Rosenzweig e9b54e1000 v3d: Use u_default_set_debug_callback
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
2022-09-01 14:50:24 +00:00
Alyssa Rosenzweig c4b3dee8f3 gallium: Add u_default_set_debug_callback
Drivers that don't use compile queues can use a common implementation. Drivers
that do can tail call into the common implementation.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
2022-09-01 14:50:24 +00:00
Dave Airlie 8318f73384 dozen: move to use common command buffer result code.
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>
2022-09-01 14:11:55 +00:00
Dave Airlie a43b6d9ae2 panvk: use common command buffer record result.
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>
2022-09-01 14:11:55 +00:00
Dave Airlie 3c092f5cd8 turnip: use common command record result.
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>
2022-09-01 14:11:55 +00:00
Dave Airlie b644c7ca9f radv: move to using common record_result.
v2 (Jason Ekstrand):
 - Handle rename to vk_command_buffer_set_error
 - Add more instances, especially in device generated commands

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>
2022-09-01 14:11:55 +00:00
Jason Ekstrand cc6ad491ea vulkan/cmd_queue: Drop vk_cmd_queue::error
Instead, we return errors from each of the enqueue functions and record
those errors (if any) in vk_command_buffer::record_result.  This also
involves some awkward changes to each of the three drivers that uses
vk_cmd_queue but those are resolved in later commits as we convert those
drivers to the common error tracking.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>
2022-09-01 14:11:55 +00:00
Jason Ekstrand 541be28099 vulkan/cmd_buffer: add record_state to the common command buffer.
This pulls the record state out of the cmd queue into the command
buffer. It can be used here by other drivers.

v2: add some get/set api: not set only sets the first error.

v3 (Jason Ekstrand):
 - Rename set_record_result to set_error
 - Automatically log the set error
 - Add a new vk_command_bufer_has_error() helper
 - Split out vk_cmd_queue changes into their own commit

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>
2022-09-01 14:11:55 +00:00
Alyssa Rosenzweig 7d9df64b07 panfrost/ci: Update G72 xflakes list
I can't reproduce this locally on Mali-G52 and don't have Mali-G72 hardware.
Unless someone wants to investigate the flakes here in #7149, add a bigger
wildcard to the gathers xflakes list so we don't fail pipelines.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7149
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18348>
2022-09-01 13:48:17 +00:00
Konstantin Seurer cce8e60a31 radv: Proper handling for inactive instance nodes
We only skipped the `accelerationStructureReference == 0` case
which could lead to reading uninitialized memory.
This patch introduces a NULL_NODE_ID constant and uses it
to handle inactive nodes properly.
I do not think, that this case is common in practice.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18141>
2022-09-01 12:54:13 +00:00
Friedrich Vock 938b65aff1 docs: Add documentation about RADV RRA tracing
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>
2022-09-01 12:10:58 +00:00
Friedrich Vock 2bdb1b4641 radv: Enable Radeon Raytracing Analyzer traces
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>
2022-09-01 12:10:58 +00:00
Friedrich Vock 97ffaea52e radv: Add Radeon Raytracing Analyzer capturing layer
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>
2022-09-01 12:10:58 +00:00
Friedrich Vock 5749806754 radv: Add Radeon Raytracing Analyzer trace dumping utilities
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>
2022-09-01 12:10:58 +00:00
Friedrich Vock 07eceb4fe4 radv: Add metadata to acceleration structures
This metadata is used for dumping RRA traces.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>
2022-09-01 12:10:58 +00:00
Friedrich Vock 0fefdadbd3 radv: Generalize instance count in BVH states to leaf node count
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>
2022-09-01 12:10:58 +00:00