From 4982a145415a43d29117e051f199c49e8374efcb Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Tue, 31 Aug 2021 03:11:36 +0200 Subject: [PATCH] aux/vk: Add Tegra detection --- src/xrt/auxiliary/vk/vk_helpers.c | 6 ++++++ src/xrt/auxiliary/vk/vk_helpers.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/xrt/auxiliary/vk/vk_helpers.c b/src/xrt/auxiliary/vk/vk_helpers.c index 3c96fabb6..b01295243 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.c +++ b/src/xrt/auxiliary/vk/vk_helpers.c @@ -1061,6 +1061,12 @@ vk_select_physical_device(struct vk_bundle *vk, int forced_index) snprintf(title, 20, "Selected GPU: %d\n", gpu_index); vk_print_device_info_debug(vk, &pdp, gpu_index, title); + char *tegra_substr = strstr(pdp.deviceName, "Tegra"); + if (tegra_substr) { + vk->is_tegra = true; + VK_DEBUG(vk, "Detected Tegra, using Tegra specific workarounds!"); + } + // Fill out the device memory props as well. vk->vkGetPhysicalDeviceMemoryProperties(vk->physical_device, &vk->device_memory_props); diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index 92830cc87..a6eaae58f 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -52,6 +52,8 @@ struct vk_bundle bool has_EXT_global_priority; bool has_VK_EXT_robustness2; + bool is_tegra; + VkDebugReportCallbackEXT debug_report_cb; VkPhysicalDeviceMemoryProperties device_memory_props;