From c04d2409da85805d6781ed4a795a91a4850cf7df Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Fri, 24 Jun 2022 11:56:36 +0200 Subject: [PATCH] Thunks/vulkan: Disable support for debug extensions as they require callback support --- ThunkLibs/libvulkan/Host.cpp | 13 +++++++++++++ ThunkLibs/libvulkan/libvulkan_interface.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ThunkLibs/libvulkan/Host.cpp b/ThunkLibs/libvulkan/Host.cpp index 09ed024ec..52776ce8a 100644 --- a/ThunkLibs/libvulkan/Host.cpp +++ b/ThunkLibs/libvulkan/Host.cpp @@ -12,6 +12,7 @@ $end_info$ #include "common/Host.h" +#include #include #include #include @@ -73,6 +74,18 @@ static void FEXFN_IMPL(vkFreeMemory)(VkDevice a_0, VkDeviceMemory a_1, const VkA LDR_PTR(vkFreeMemory)(a_0, a_1, nullptr); } +static VkResult FEXFN_IMPL(vkEnumerateInstanceExtensionProperties)(const char* a_0, uint32_t* a_1, VkExtensionProperties* a_2) { + auto ret = LDR_PTR(vkEnumerateInstanceExtensionProperties)(a_0, a_1, a_2); + if (a_2) { + const auto end = a_2 + *a_1; + auto it = std::remove_if(a_2, end, [](const VkExtensionProperties& prop) { return strcmp(prop.extensionName, "VK_EXT_debug_report") == 0 || strcmp(prop.extensionName, "VK_EXT_debug_utils") == 0; }); + // Replace by dummy entry and reduce extension count + std::fill(it, end, VkExtensionProperties {}); + *a_1 -= (end - it); + } + return ret; +} + static PFN_vkVoidFunction FEXFN_IMPL(vkGetDeviceProcAddr)(VkDevice a_0, const char* a_1) { // Just return the host facing function pointer // The guest will handle mapping if this exists diff --git a/ThunkLibs/libvulkan/libvulkan_interface.cpp b/ThunkLibs/libvulkan/libvulkan_interface.cpp index 707787513..4b25841e4 100644 --- a/ThunkLibs/libvulkan/libvulkan_interface.cpp +++ b/ThunkLibs/libvulkan/libvulkan_interface.cpp @@ -11,6 +11,7 @@ struct fex_gen_config; template<> struct fex_gen_config : fexgen::custom_host_impl, fexgen::custom_guest_entrypoint, fexgen::returns_guest_pointer {}; template<> struct fex_gen_config : fexgen::custom_host_impl, fexgen::custom_guest_entrypoint, fexgen::returns_guest_pointer {}; +template<> struct fex_gen_config : fexgen::custom_host_impl {}; namespace internal { @@ -255,7 +256,6 @@ template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; -template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {}; template<> struct fex_gen_config {};