summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspencer-lunarg <spencer@lunarg.com>2023-08-28 11:15:36 +0900
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2023-08-27 21:19:59 -0600
commit6087a5844480e1f9cce9c645c2123f07314ce574 (patch)
tree33d87ba69403554852f1c910288a350e0baa4162
parent3f141894d2d9e7edfc2fb5596af0cf3e23de9597 (diff)
downloadVulkan-Tools-6087a5844480e1f9cce9c645c2123f07314ce574.tar.gz
Vulkan-Tools-6087a5844480e1f9cce9c645c2123f07314ce574.tar.bz2
Vulkan-Tools-6087a5844480e1f9cce9c645c2123f07314ce574.zip
icd: Add VkSurfacePresentModeCompatibilityEXT support
-rw-r--r--icd/generated/function_definitions.h12
-rw-r--r--scripts/mock_icd_generator.py12
2 files changed, 24 insertions, 0 deletions
diff --git a/icd/generated/function_definitions.h b/icd/generated/function_definitions.h
index 9006570d..d7885403 100644
--- a/icd/generated/function_definitions.h
+++ b/icd/generated/function_definitions.h
@@ -3461,6 +3461,18 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(
VkSurfaceCapabilities2KHR* pSurfaceCapabilities)
{
GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, pSurfaceInfo->surface, &pSurfaceCapabilities->surfaceCapabilities);
+
+ auto *present_mode_compatibility = lvl_find_mod_in_chain<VkSurfacePresentModeCompatibilityEXT>(pSurfaceCapabilities->pNext);
+ if (present_mode_compatibility) {
+ if (!present_mode_compatibility->pPresentModes) {
+ present_mode_compatibility->presentModeCount = 3;
+ } else {
+ // arbitrary
+ present_mode_compatibility->pPresentModes[0] = VK_PRESENT_MODE_IMMEDIATE_KHR;
+ present_mode_compatibility->pPresentModes[1] = VK_PRESENT_MODE_FIFO_KHR;
+ present_mode_compatibility->pPresentModes[2] = VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR;
+ }
+ }
return VK_SUCCESS;
}
diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py
index 636205c6..ce1e3135 100644
--- a/scripts/mock_icd_generator.py
+++ b/scripts/mock_icd_generator.py
@@ -300,6 +300,18 @@ CUSTOM_C_INTERCEPTS = {
''',
'vkGetPhysicalDeviceSurfaceCapabilities2KHR': '''
GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, pSurfaceInfo->surface, &pSurfaceCapabilities->surfaceCapabilities);
+
+ auto *present_mode_compatibility = lvl_find_mod_in_chain<VkSurfacePresentModeCompatibilityEXT>(pSurfaceCapabilities->pNext);
+ if (present_mode_compatibility) {
+ if (!present_mode_compatibility->pPresentModes) {
+ present_mode_compatibility->presentModeCount = 3;
+ } else {
+ // arbitrary
+ present_mode_compatibility->pPresentModes[0] = VK_PRESENT_MODE_IMMEDIATE_KHR;
+ present_mode_compatibility->pPresentModes[1] = VK_PRESENT_MODE_FIFO_KHR;
+ present_mode_compatibility->pPresentModes[2] = VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR;
+ }
+ }
return VK_SUCCESS;
''',
'vkGetInstanceProcAddr': '''