Merge "vulkan: fix crash when only non-global layers are enabled" into nyc-dev am: a101f6a446
am: ad442de7cf
* commit 'ad442de7cf7af7f1cc933db26f6a1b83677fddad':
vulkan: fix crash when only non-global layers are enabled
Change-Id: Id0ad83f1674342e6bcc2fa1445e774bb2c8bb060
diff --git a/vulkan/libvulkan/api.cpp b/vulkan/libvulkan/api.cpp
index 8053668..b699fe9 100644
--- a/vulkan/libvulkan/api.cpp
+++ b/vulkan/libvulkan/api.cpp
@@ -602,6 +602,13 @@
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;