aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_device.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2020-02-26 13:59:05 +0100
committerSamuel Pitoiset <[email protected]>2020-03-10 09:57:53 +0100
commitf4fbcfe8183b7253b411dd7ac2aadecd47bd76e4 (patch)
tree7dad626d4441127850daf0be6ddd860d9ae10b82 /src/amd/vulkan/radv_device.c
parent9c88e4a272adaf94082b36b4b94ce0c475e5f779 (diff)
radv: use device entrypoints from the SQTT layer if enabled
This allows to override RADV device entrypoints if the prefix is 'sqtt' instead of 'radv'. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
Diffstat (limited to 'src/amd/vulkan/radv_device.c')
-rw-r--r--src/amd/vulkan/radv_device.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index c55e219e6c8..1391456e8df 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2846,7 +2846,14 @@ static void
radv_device_init_dispatch(struct radv_device *device)
{
const struct radv_instance *instance = device->physical_device->instance;
+ const struct radv_device_dispatch_table *dispatch_table_layer = NULL;
bool unchecked = instance->debug_flags & RADV_DEBUG_ALL_ENTRYPOINTS;
+ int radv_thread_trace = radv_get_int_debug_option("RADV_THREAD_TRACE", -1);
+
+ if (radv_thread_trace >= 0) {
+ /* Use device entrypoints from the SQTT layer if enabled. */
+ dispatch_table_layer = &sqtt_device_dispatch_table;
+ }
for (unsigned i = 0; i < ARRAY_SIZE(device->dispatch.entrypoints); i++) {
/* Vulkan requires that entrypoints for extensions which have not been
@@ -2857,6 +2864,10 @@ radv_device_init_dispatch(struct radv_device *device)
&instance->enabled_extensions,
&device->enabled_extensions)) {
device->dispatch.entrypoints[i] = NULL;
+ } else if (dispatch_table_layer &&
+ dispatch_table_layer->entrypoints[i]) {
+ device->dispatch.entrypoints[i] =
+ dispatch_table_layer->entrypoints[i];
} else {
device->dispatch.entrypoints[i] =
radv_device_dispatch_table.entrypoints[i];