summaryrefslogtreecommitdiff
path: root/vulkan
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-07-17 04:54:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-07-17 04:54:22 +0000
commit6aa5a3b5c2cbfcf3c7101409b9e866ccde9adf4e (patch)
tree6a4b37937a77c24692a1414a8a36850709217bd3 /vulkan
parent6c420207c528ac887cefecfbe00cf1fd686ad7db (diff)
parentc889d3c5763d34ecfff99cff8df1c6e85aac00d0 (diff)
downloadnative-6aa5a3b5c2cbfcf3c7101409b9e866ccde9adf4e.tar.gz
Merge "libvulkan: make vkEnumerateInstanceVersion trigger driver loading"
Diffstat (limited to 'vulkan')
-rw-r--r--vulkan/libvulkan/api.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/vulkan/libvulkan/api.cpp b/vulkan/libvulkan/api.cpp
index 5b9affd03a..80166c8434 100644
--- a/vulkan/libvulkan/api.cpp
+++ b/vulkan/libvulkan/api.cpp
@@ -1256,7 +1256,7 @@ VkResult EnumerateInstanceLayerProperties(uint32_t* pPropertyCount,
ATRACE_CALL();
if (!EnsureInitialized())
- return VK_ERROR_INITIALIZATION_FAILED;
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
uint32_t count = GetLayerCount();
@@ -1280,7 +1280,7 @@ VkResult EnumerateInstanceExtensionProperties(
ATRACE_CALL();
if (!EnsureInitialized())
- return VK_ERROR_INITIALIZATION_FAILED;
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
if (pLayerName) {
const Layer* layer = FindLayer(pLayerName);
@@ -1456,6 +1456,11 @@ VkResult EnumerateDeviceExtensionProperties(
VkResult EnumerateInstanceVersion(uint32_t* pApiVersion) {
ATRACE_CALL();
+ // Load the driver here if not done yet. This api will be used in Zygote
+ // for Vulkan driver pre-loading because of the minimum overhead.
+ if (!EnsureInitialized())
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+
*pApiVersion = VK_API_VERSION_1_1;
return VK_SUCCESS;
}