diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 36a1aa2bb..b3870170b 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -742,6 +742,10 @@ static const VkExtensionProperties supportedExtensions[] = { VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME, VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION, }, #endif + { + VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, + VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION, + }, { VK_KHR_MAINTENANCE1_EXTENSION_NAME, VK_KHR_MAINTENANCE1_SPEC_VERSION, }, diff --git a/renderdoc/driver/vulkan/vk_core.h b/renderdoc/driver/vulkan/vk_core.h index 29699d61b..443a45a09 100644 --- a/renderdoc/driver/vulkan/vk_core.h +++ b/renderdoc/driver/vulkan/vk_core.h @@ -1407,4 +1407,22 @@ public: // VK_KHR_maintenance1 void vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags); + + // VK_KHR_get_physical_device_properties2 + void vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2KHR *pFeatures); + void vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2KHR *pProperties); + void vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, + VkFormatProperties2KHR *pFormatProperties); + VkResult vkGetPhysicalDeviceImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, + VkImageFormatProperties2KHR *pImageFormatProperties); + void vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pCount, + VkQueueFamilyProperties2KHR *pQueueFamilyProperties); + void vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties); + void vkGetPhysicalDeviceSparseImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, + uint32_t *pPropertyCount, VkSparseImageFormatProperties2KHR *pProperties); }; diff --git a/renderdoc/driver/vulkan/vk_hookset_defs.h b/renderdoc/driver/vulkan/vk_hookset_defs.h index 4c8ce4db1..2e1ec2c8a 100644 --- a/renderdoc/driver/vulkan/vk_hookset_defs.h +++ b/renderdoc/driver/vulkan/vk_hookset_defs.h @@ -249,15 +249,16 @@ // for simplicity and since the check itself is platform agnostic, // these aren't protected in platform defines -#define CheckInstanceExts() \ - CheckExt(VK_KHR_xlib_surface); \ - CheckExt(VK_KHR_xcb_surface); \ - CheckExt(VK_KHR_win32_surface); \ - CheckExt(VK_KHR_android_surface); \ - CheckExt(VK_KHR_surface); \ - CheckExt(VK_EXT_debug_report); \ - CheckExt(VK_KHR_display); \ - CheckExt(VK_NV_external_memory_capabilities); +#define CheckInstanceExts() \ + CheckExt(VK_KHR_xlib_surface); \ + CheckExt(VK_KHR_xcb_surface); \ + CheckExt(VK_KHR_win32_surface); \ + CheckExt(VK_KHR_android_surface); \ + CheckExt(VK_KHR_surface); \ + CheckExt(VK_EXT_debug_report); \ + CheckExt(VK_KHR_display); \ + CheckExt(VK_NV_external_memory_capabilities); \ + CheckExt(VK_KHR_get_physical_device_properties2); #define CheckDeviceExts() \ CheckExt(VK_EXT_debug_marker); \ @@ -268,24 +269,33 @@ CheckExt(VK_NV_win32_keyed_mutex); \ CheckExt(VK_KHR_maintenance1); -#define HookInitVulkanInstanceExts() \ - HookInitExtension(VK_KHR_surface, DestroySurfaceKHR); \ - HookInitExtension(VK_KHR_surface, GetPhysicalDeviceSurfaceSupportKHR); \ - HookInitExtension(VK_KHR_surface, GetPhysicalDeviceSurfaceCapabilitiesKHR); \ - HookInitExtension(VK_KHR_surface, GetPhysicalDeviceSurfaceFormatsKHR); \ - HookInitExtension(VK_KHR_surface, GetPhysicalDeviceSurfacePresentModesKHR); \ - HookInitExtension(VK_EXT_debug_report, CreateDebugReportCallbackEXT); \ - HookInitExtension(VK_EXT_debug_report, DestroyDebugReportCallbackEXT); \ - HookInitExtension(VK_EXT_debug_report, DebugReportMessageEXT); \ - HookInitExtension(VK_KHR_display, GetPhysicalDeviceDisplayPropertiesKHR); \ - HookInitExtension(VK_KHR_display, GetPhysicalDeviceDisplayPlanePropertiesKHR); \ - HookInitExtension(VK_KHR_display, GetDisplayPlaneSupportedDisplaysKHR); \ - HookInitExtension(VK_KHR_display, GetDisplayModePropertiesKHR); \ - HookInitExtension(VK_KHR_display, CreateDisplayModeKHR); \ - HookInitExtension(VK_KHR_display, GetDisplayPlaneCapabilitiesKHR); \ - HookInitExtension(VK_KHR_display, CreateDisplayPlaneSurfaceKHR); \ - HookInitExtension(VK_NV_external_memory_capabilities, \ - GetPhysicalDeviceExternalImageFormatPropertiesNV); \ +#define HookInitVulkanInstanceExts() \ + HookInitExtension(VK_KHR_surface, DestroySurfaceKHR); \ + HookInitExtension(VK_KHR_surface, GetPhysicalDeviceSurfaceSupportKHR); \ + HookInitExtension(VK_KHR_surface, GetPhysicalDeviceSurfaceCapabilitiesKHR); \ + HookInitExtension(VK_KHR_surface, GetPhysicalDeviceSurfaceFormatsKHR); \ + HookInitExtension(VK_KHR_surface, GetPhysicalDeviceSurfacePresentModesKHR); \ + HookInitExtension(VK_EXT_debug_report, CreateDebugReportCallbackEXT); \ + HookInitExtension(VK_EXT_debug_report, DestroyDebugReportCallbackEXT); \ + HookInitExtension(VK_EXT_debug_report, DebugReportMessageEXT); \ + HookInitExtension(VK_KHR_display, GetPhysicalDeviceDisplayPropertiesKHR); \ + HookInitExtension(VK_KHR_display, GetPhysicalDeviceDisplayPlanePropertiesKHR); \ + HookInitExtension(VK_KHR_display, GetDisplayPlaneSupportedDisplaysKHR); \ + HookInitExtension(VK_KHR_display, GetDisplayModePropertiesKHR); \ + HookInitExtension(VK_KHR_display, CreateDisplayModeKHR); \ + HookInitExtension(VK_KHR_display, GetDisplayPlaneCapabilitiesKHR); \ + HookInitExtension(VK_KHR_display, CreateDisplayPlaneSurfaceKHR); \ + HookInitExtension(VK_NV_external_memory_capabilities, \ + GetPhysicalDeviceExternalImageFormatPropertiesNV); \ + HookInitExtension(VK_KHR_get_physical_device_properties2, GetPhysicalDeviceFeatures2KHR); \ + HookInitExtension(VK_KHR_get_physical_device_properties2, GetPhysicalDeviceProperties2KHR); \ + HookInitExtension(VK_KHR_get_physical_device_properties2, GetPhysicalDeviceFormatProperties2KHR); \ + HookInitExtension(VK_KHR_get_physical_device_properties2, \ + GetPhysicalDeviceImageFormatProperties2KHR); \ + HookInitExtension(VK_KHR_get_physical_device_properties2, \ + GetPhysicalDeviceQueueFamilyProperties2KHR); \ + HookInitExtension(VK_KHR_get_physical_device_properties2, \ + GetPhysicalDeviceSparseImageFormatProperties2KHR); \ HookInitInstance_PlatformSpecific() #define HookInitVulkanDeviceExts() \ @@ -655,6 +665,22 @@ VkExternalImageFormatPropertiesNV *, pExternalImageFormatProperties); \ HookDefine3(void, vkTrimCommandPoolKHR, VkDevice, device, VkCommandPool, commandPool, \ VkCommandPoolTrimFlagsKHR, flags); \ + HookDefine2(void, vkGetPhysicalDeviceFeatures2KHR, VkPhysicalDevice, physicalDevice, \ + VkPhysicalDeviceFeatures2KHR *, pFeatures); \ + HookDefine2(void, vkGetPhysicalDeviceProperties2KHR, VkPhysicalDevice, physicalDevice, \ + VkPhysicalDeviceProperties2KHR *, pProperties); \ + HookDefine3(void, vkGetPhysicalDeviceFormatProperties2KHR, VkPhysicalDevice, physicalDevice, \ + VkFormat, format, VkFormatProperties2KHR *, pFormatProperties); \ + HookDefine3(VkResult, vkGetPhysicalDeviceImageFormatProperties2KHR, VkPhysicalDevice, \ + physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *, pImageFormatInfo, \ + VkImageFormatProperties2KHR *, pImageFormatProperties); \ + HookDefine3(void, vkGetPhysicalDeviceQueueFamilyProperties2KHR, VkPhysicalDevice, physicalDevice, \ + uint32_t *, pCount, VkQueueFamilyProperties2KHR *, pQueueFamilyProperties); \ + HookDefine2(void, vkGetPhysicalDeviceMemoryProperties2KHR, VkPhysicalDevice, physicalDevice, \ + VkPhysicalDeviceMemoryProperties2KHR *, pMemoryProperties); \ + HookDefine4(void, vkGetPhysicalDeviceSparseImageFormatProperties2KHR, VkPhysicalDevice, \ + physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *, pFormatInfo, \ + uint32_t *, pPropertyCount, VkSparseImageFormatProperties2KHR *, pProperties); \ HookDefine_PlatformSpecific() struct VkLayerInstanceDispatchTableExtended : VkLayerInstanceDispatchTable diff --git a/renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp index 821b930f3..86b84d1e3 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_get_funcs.cpp @@ -254,3 +254,57 @@ VkResult WrappedVulkan::vkGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory return ObjDisp(device)->GetMemoryWin32HandleNV(Unwrap(device), Unwrap(memory), handleType, pHandle); } #endif + +void WrappedVulkan::vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2KHR *pFeatures) +{ + return ObjDisp(physicalDevice)->GetPhysicalDeviceFeatures2KHR(Unwrap(physicalDevice), pFeatures); +} + +void WrappedVulkan::vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceProperties2KHR *pProperties) +{ + return ObjDisp(physicalDevice)->GetPhysicalDeviceProperties2KHR(Unwrap(physicalDevice), pProperties); +} + +void WrappedVulkan::vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, + VkFormat format, + VkFormatProperties2KHR *pFormatProperties) +{ + return ObjDisp(physicalDevice) + ->GetPhysicalDeviceFormatProperties2KHR(Unwrap(physicalDevice), format, pFormatProperties); +} + +VkResult WrappedVulkan::vkGetPhysicalDeviceImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, + VkImageFormatProperties2KHR *pImageFormatProperties) +{ + return ObjDisp(physicalDevice) + ->GetPhysicalDeviceImageFormatProperties2KHR(Unwrap(physicalDevice), pImageFormatInfo, + pImageFormatProperties); +} + +void WrappedVulkan::vkGetPhysicalDeviceQueueFamilyProperties2KHR( + VkPhysicalDevice physicalDevice, uint32_t *pCount, + VkQueueFamilyProperties2KHR *pQueueFamilyProperties) +{ + return ObjDisp(physicalDevice) + ->GetPhysicalDeviceQueueFamilyProperties2KHR(Unwrap(physicalDevice), pCount, + pQueueFamilyProperties); +} + +void WrappedVulkan::vkGetPhysicalDeviceMemoryProperties2KHR( + VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) +{ + return ObjDisp(physicalDevice) + ->GetPhysicalDeviceMemoryProperties2KHR(Unwrap(physicalDevice), pMemoryProperties); +} + +void WrappedVulkan::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, + uint32_t *pPropertyCount, VkSparseImageFormatProperties2KHR *pProperties) +{ + return ObjDisp(physicalDevice) + ->GetPhysicalDeviceSparseImageFormatProperties2KHR(Unwrap(physicalDevice), pFormatInfo, + pPropertyCount, pProperties); +}