summaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2017-01-24 15:54:29 -0700
committerMark Young <marky@lunarg.com>2017-01-25 00:16:36 -0700
commita0e9f396a87159e1a99a6b455d2e555b6d2e5689 (patch)
tree4ed2198cd99e479f70ff2c6d5b4af2e82009ab00 /loader
parent593f84b63934f07483e5e5a20fd352df8ab4f8c9 (diff)
loader: Fix EnumPhysDev bug
Fix a bug found by Piers with regards to vkEnumeratePhysicalDevices. Basically, if the application called the function without first calling it with NULL pPhysicalDevices, the count would be wrong. Change-Id: If3a4ba60b17c64df2133d31d3692ee6da21c6a01
Diffstat (limited to 'loader')
-rw-r--r--loader/trampoline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/loader/trampoline.c b/loader/trampoline.c
index 4d14f581..207a7476 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -549,7 +549,7 @@ vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
goto out;
}
- if (pPhysicalDevices == NULL) {
+ if (NULL == pPhysicalDevices || 0 == inst->total_gpu_count) {
// Call down. At the lower levels, this will setup the terminator
// structures in the loader.
res = disp->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount,
@@ -559,7 +559,9 @@ vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
"vkEnumeratePhysicalDevices: Failed in dispatch call"
" used to determine number of available GPUs");
}
+ }
+ if (NULL == pPhysicalDevices) {
// Goto out, even on success since we don't need to fill in the rest.
goto out;
}