aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiers Daniell <pdaniell@nvidia.com>2016-03-31 15:00:59 -0600
committerJon Ashburn <jon@lunarg.com>2016-04-01 11:23:38 -0600
commit62cef16bdf6155f136202daae711a80a1deb0351 (patch)
tree0a6a417d1eca67665628cd8cb8b53b0f7c1a02da
parentc267cd99847863b77d83e1b82bdb3b3d37fe7b2c (diff)
downloadusermoji-62cef16bdf6155f136202daae711a80a1deb0351.tar.xz
loader: Trampoline vkEnumeratePhysDev should use layer-returned physDev count
Modify the trampoline vkEnumeratePhysicalDevices() implementation to enumerate the number of physical devices based on what the top-most layer reports and not what the terminator_EnumeratePhysicalDevices counted. This allows intermediate layers to modify the physical device count. Change-Id: Ifd5c3c8c4db53cf97b976feefe18de7cfef47e35
-rw-r--r--loader/trampoline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/loader/trampoline.c b/loader/trampoline.c
index dd015795..0622dcea 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -511,7 +511,8 @@ vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
}
if (inst->phys_devs)
loader_heap_free(inst, inst->phys_devs);
- count = inst->total_gpu_count;
+ count = min(inst->total_gpu_count, *pPhysicalDeviceCount);
+ *pPhysicalDevices = count;
inst->phys_devs = (struct loader_physical_device_tramp *)loader_heap_alloc(
inst, count * sizeof(struct loader_physical_device_tramp),
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);