summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vulkan/nulldrv/null_driver.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/vulkan/nulldrv/null_driver.cpp b/vulkan/nulldrv/null_driver.cpp
index 67147791f3..6814ae611c 100644
--- a/vulkan/nulldrv/null_driver.cpp
+++ b/vulkan/nulldrv/null_driver.cpp
@@ -343,9 +343,14 @@ void DestroyInstance(VkInstance instance,
VkResult EnumeratePhysicalDevices(VkInstance instance,
uint32_t* physical_device_count,
VkPhysicalDevice* physical_devices) {
- if (physical_devices && *physical_device_count >= 1)
+ if (!physical_devices)
+ *physical_device_count = 1;
+ else if (*physical_device_count == 0)
+ return VK_INCOMPLETE;
+ else {
physical_devices[0] = &instance->physical_device;
- *physical_device_count = 1;
+ *physical_device_count = 1;
+ }
return VK_SUCCESS;
}