summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
authorChia-I Wu <olv@google.com>2016-05-27 10:18:25 +0800
committerChia-I Wu <olv@google.com>2016-05-27 10:37:48 +0800
commit61b25fdffc360ab70e1f33be0bb43c911150277b (patch)
tree90b69526c875fef02ca6dc12c7f49d9a4cbe3978 /vulkan/libvulkan/api.cpp
parentb9be0cf397eb6053fb5b472d91cf2d6a22c6693f (diff)
vulkan: fix crash when only non-global layers are enabled
We fail to set up get_instance_proc_addr_ and get_device_proc_addr_ when there are layers but only non-global ones. Bug: 28990561 Change-Id: I82704f946deb5a76640f9dfb792e6fd118c78aa7
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
-rw-r--r--vulkan/libvulkan/api.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/vulkan/libvulkan/api.cpp b/vulkan/libvulkan/api.cpp
index 805366820f..b699fe97fc 100644
--- a/vulkan/libvulkan/api.cpp
+++ b/vulkan/libvulkan/api.cpp
@@ -602,6 +602,13 @@ VkResult LayerChain::ActivateLayers(VkPhysicalDevice physical_dev,
new (&layers_[layer_count_++]) ActiveLayer{GetLayerRef(l), {}};
}
+ // this may happen when all layers are non-global ones
+ if (!layer_count_) {
+ get_instance_proc_addr_ = driver::GetInstanceProcAddr;
+ get_device_proc_addr_ = driver::GetDeviceProcAddr;
+ return VK_SUCCESS;
+ }
+
SetupLayerLinks();
return VK_SUCCESS;