summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan
diff options
context:
space:
mode:
author Yiwei Zhang <zzyiwei@google.com> 2018-03-13 17:12:11 -0700
committer Chris Forbes <chrisforbes@google.com> 2018-04-12 16:59:24 +0000
commitdb67cc7bcfbb5cb1692ca491f8698d91c072ce70 (patch)
treeca99b86724977ec43c2a7c8d79b12582d7c90c6b /vulkan/libvulkan
parent1f0622ed9717f9b6f9735e4b9634f182a0d79b4d (diff)
libvulkan: correctly expose VK_KHR_shared_presentable_image
The current libvulkan still make VK_KHR_shared_presentable_image depends on VK_KHR_get_physical_device_properties2 even with proper VK1.1. This change makes a change in code-generator.tmpl which results in adding vkGetPhysicalDeviceProperties2 into the driver table. Test: dEQP-VK.wsi.android.shared_presentable_image* Bug: b/74605332 Change-Id: I5925dbc438decdc841ed4131c4f3df2a9dd1805a (cherry picked from commit 922b1e377d4247ab40f2c7c0467b3cda60b4fd7c)
Diffstat (limited to 'vulkan/libvulkan')
-rw-r--r--vulkan/libvulkan/code-generator.tmpl1
-rw-r--r--vulkan/libvulkan/driver.cpp11
-rw-r--r--vulkan/libvulkan/driver_gen.cpp1
-rw-r--r--vulkan/libvulkan/driver_gen.h1
4 files changed, 11 insertions, 3 deletions
diff --git a/vulkan/libvulkan/code-generator.tmpl b/vulkan/libvulkan/code-generator.tmpl
index 84644a9ada..1f4df1e59d 100644
--- a/vulkan/libvulkan/code-generator.tmpl
+++ b/vulkan/libvulkan/code-generator.tmpl
@@ -983,6 +983,7 @@ VK_ANDROID_external_memory_android_hardware_buffer
{{else if eq $.Name "vkDestroyImage"}}true
{{else if eq $.Name "vkGetPhysicalDeviceProperties"}}true
+ {{else if eq $.Name "vkGetPhysicalDeviceProperties2"}}true
{{else if eq $.Name "vkGetPhysicalDeviceProperties2KHR"}}true
{{end}}
diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp
index 741fbb812b..56bc35ec70 100644
--- a/vulkan/libvulkan/driver.cpp
+++ b/vulkan/libvulkan/driver.cpp
@@ -848,7 +848,8 @@ bool QueryPresentationProperties(
const InstanceData& data = GetData(physicalDevice);
// GPDP2 must be present and enabled on the instance.
- if (!data.driver.GetPhysicalDeviceProperties2KHR)
+ if (!data.driver.GetPhysicalDeviceProperties2KHR &&
+ !data.driver.GetPhysicalDeviceProperties2)
return false;
// Request the android-specific presentation properties via GPDP2
@@ -866,8 +867,12 @@ bool QueryPresentationProperties(
presentation_properties->pNext = nullptr;
presentation_properties->sharedImage = VK_FALSE;
- data.driver.GetPhysicalDeviceProperties2KHR(physicalDevice,
- &properties);
+ if (data.driver.GetPhysicalDeviceProperties2KHR) {
+ data.driver.GetPhysicalDeviceProperties2KHR(physicalDevice,
+ &properties);
+ } else {
+ data.driver.GetPhysicalDeviceProperties2(physicalDevice, &properties);
+ }
return true;
}
diff --git a/vulkan/libvulkan/driver_gen.cpp b/vulkan/libvulkan/driver_gen.cpp
index 51e3abf262..ec98b9fe04 100644
--- a/vulkan/libvulkan/driver_gen.cpp
+++ b/vulkan/libvulkan/driver_gen.cpp
@@ -494,6 +494,7 @@ bool InitDriverTable(VkInstance instance,
INIT_PROC(true, instance, CreateDevice);
INIT_PROC(true, instance, EnumerateDeviceExtensionProperties);
INIT_PROC(false, instance, EnumeratePhysicalDeviceGroups);
+ INIT_PROC(false, instance, GetPhysicalDeviceProperties2);
INIT_PROC_EXT(EXT_debug_report, true, instance, CreateDebugReportCallbackEXT);
INIT_PROC_EXT(EXT_debug_report, true, instance, DestroyDebugReportCallbackEXT);
INIT_PROC_EXT(EXT_debug_report, true, instance, DebugReportMessageEXT);
diff --git a/vulkan/libvulkan/driver_gen.h b/vulkan/libvulkan/driver_gen.h
index 99dc8898d0..14c3aba75a 100644
--- a/vulkan/libvulkan/driver_gen.h
+++ b/vulkan/libvulkan/driver_gen.h
@@ -69,6 +69,7 @@ struct InstanceDriverTable {
PFN_vkCreateDevice CreateDevice;
PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups;
+ PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2;
PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
PFN_vkDebugReportMessageEXT DebugReportMessageEXT;