summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/VulkanManager.cpp
diff options
context:
space:
mode:
authorGreg Daniel <egdaniel@google.com>2018-10-01 14:42:56 -0400
committerGreg Daniel <egdaniel@google.com>2018-10-02 10:47:19 -0400
commit962596257c787163c8a89ee6272a874fe872e7d0 (patch)
tree1b989b01faa9d96ef423cc836b8a1be8365f6858 /libs/hwui/renderthread/VulkanManager.cpp
parent52ac7e2d211c056fa7202ea81246a6f975d64df4 (diff)
Minor clean up/fixes of VulkanManager api version checks.
Test: manual build and run Change-Id: I04b0ed0b6c344cc8aac662b1a2a277d1aea0cd2c
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.cpp')
-rw-r--r--libs/hwui/renderthread/VulkanManager.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index 83e9db359356..b0d45052ca49 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -78,7 +78,7 @@ bool VulkanManager::setupDevice(GrVkExtensions& grExtensions, VkPhysicalDeviceFe
0, // applicationVersion
"android framework", // pEngineName
0, // engineVerison
- VK_MAKE_VERSION(1, 0, 0), // apiVersion
+ VK_MAKE_VERSION(1, 1, 0), // apiVersion
};
std::vector<const char*> instanceExtensions;
@@ -133,6 +133,7 @@ bool VulkanManager::setupDevice(GrVkExtensions& grExtensions, VkPhysicalDeviceFe
GET_INST_PROC(DestroyInstance);
GET_INST_PROC(EnumeratePhysicalDevices);
+ GET_INST_PROC(GetPhysicalDeviceProperties);
GET_INST_PROC(GetPhysicalDeviceQueueFamilyProperties);
GET_INST_PROC(GetPhysicalDeviceFeatures2);
GET_INST_PROC(CreateDevice);
@@ -164,6 +165,13 @@ bool VulkanManager::setupDevice(GrVkExtensions& grExtensions, VkPhysicalDeviceFe
return false;
}
+ VkPhysicalDeviceProperties physDeviceProperties;
+ mGetPhysicalDeviceProperties(mPhysicalDevice, &physDeviceProperties);
+ if (physDeviceProperties.apiVersion < VK_MAKE_VERSION(1, 1, 0)) {
+ this->destroy();
+ return false;
+ }
+
// query to get the initial queue props size
uint32_t queueCount;
mGetPhysicalDeviceQueueFamilyProperties(mPhysicalDevice, &queueCount, nullptr);