From 0ed8c5eb4cf03cd9acc4626ebf2e19d76c08041a Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 15 Nov 2023 14:42:07 +0000 Subject: [PATCH] Limit device core vulkan version to declared instance version * This prevents us from returning function pointers that should be NULL for core functionality (or promoted extension functionality) which an application may see and then try to call. The spec requires us to return NULL for these cases (except for non-maint5 future core versions, but we can legally return NULL there and that's the correct thing to do as the maint5 feature bit is stupid). --- renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index 190aaa47a..122bbb1f8 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -4159,7 +4159,8 @@ VkResult WrappedVulkan::vkCreateDevice(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties physProps; ObjDisp(physicalDevice)->GetPhysicalDeviceProperties(Unwrap(physicalDevice), &physProps); - record->instDevInfo->vulkanVersion = physProps.apiVersion; + record->instDevInfo->vulkanVersion = + RDCMIN(physProps.apiVersion, GetRecord(m_Instance)->instDevInfo->vulkanVersion); #undef CheckExt #define CheckExt(name, ver) \