Check physical device version to make sure physical device supports 1.1
Bug: skia:7789
Change-Id: I605a225c30ffc15ec2183213d8683a804951c47f
Reviewed-on: https://skia-review.googlesource.com/119946
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/tests/VkHardwareBufferTest.cpp b/tests/VkHardwareBufferTest.cpp
index af33f36..169918d 100644
--- a/tests/VkHardwareBufferTest.cpp
+++ b/tests/VkHardwareBufferTest.cpp
@@ -589,15 +589,12 @@
ACQUIRE_VK_PROC(DestroyInstance, fInst, VK_NULL_HANDLE);
ACQUIRE_INST_VK_PROC(EnumeratePhysicalDevices);
ACQUIRE_INST_VK_PROC(GetPhysicalDeviceProperties);
- ACQUIRE_INST_VK_PROC(GetPhysicalDeviceMemoryProperties2);
ACQUIRE_INST_VK_PROC(GetPhysicalDeviceQueueFamilyProperties);
ACQUIRE_INST_VK_PROC(GetPhysicalDeviceFeatures);
ACQUIRE_INST_VK_PROC(CreateDevice);
ACQUIRE_INST_VK_PROC(GetDeviceQueue);
ACQUIRE_INST_VK_PROC(DeviceWaitIdle);
ACQUIRE_INST_VK_PROC(DestroyDevice);
- ACQUIRE_INST_VK_PROC(GetPhysicalDeviceImageFormatProperties2);
- ACQUIRE_INST_VK_PROC(GetPhysicalDeviceExternalSemaphoreProperties);
uint32_t gpuCount;
err = fVkEnumeratePhysicalDevices(fInst, &gpuCount, nullptr);
@@ -654,6 +651,15 @@
fVkGetPhysicalDeviceProperties(fPhysDev, &physDevProperties);
int physDevVersion = physDevProperties.apiVersion;
+ if (physDevVersion < VK_MAKE_VERSION(1, 1, 0)) {
+ return false;
+ }
+
+ // Physical-Device-level functions added in 1.1
+ ACQUIRE_INST_VK_PROC(GetPhysicalDeviceMemoryProperties2);
+ ACQUIRE_INST_VK_PROC(GetPhysicalDeviceImageFormatProperties2);
+ ACQUIRE_INST_VK_PROC(GetPhysicalDeviceExternalSemaphoreProperties);
+
extensions.initDevice(physDevVersion, fInst, fPhysDev);
SkTArray<const char*> deviceLayerNames;