From 92a43a10cbcf6becb916b5b00d513e677147766a Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sun, 3 Mar 2019 23:29:26 +1100 Subject: [PATCH] tools/spec: use the correct handle for EnumeratePhysicalDevice --- tools/spec.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/spec.py b/tools/spec.py index afbfc0f..6906207 100644 --- a/tools/spec.py +++ b/tools/spec.py @@ -921,10 +921,19 @@ def write_dispatch(dst: TextIO, q: List[Type], reg: Registry): auto wrapped = std::make_unique> (); wrapped->handle = res[i]; - #define GET(NAME) wrapped->table.NAME = wrapped->table.NAME ?: reinterpret_cast (entry->table.vkGetInstanceProcAddr (instance, #NAME)); + #define GET(NAME) wrapped->table.NAME = wrapped->table.NAME ?: reinterpret_cast (entry->table.vkGetInstanceProcAddr (entry->handle, #NAME)); MAP_INSTANCE_COMMANDS(GET) #undef GET + #define GET(NAME) wrapped->table.NAME = wrapped->table.NAME ?: reinterpret_cast (cruft::vk::load::v_table->vk_icdGetInstanceProcAddr (entry->handle, #NAME)); + MAP_INSTANCE_COMMANDS(GET) + #undef GET + + #define GET(NAME) wrapped->table.NAME = wrapped->table.NAME ?: reinterpret_cast (cruft::vk::load::v_table->vk_icdGetPhysicalDeviceProcAddr (entry->handle, #NAME)); + MAP_INSTANCE_COMMANDS(GET) + #undef GET + + std::clog << "physical_device[" << i << "]; wrapped: " << wrapped.get() << ", native: " << (void*)wrapped->handle << '\\n'; pPhysicalDevices[i] = (VkPhysicalDevice)wrapped.release (); }