tools/spec: use the correct handle for EnumeratePhysicalDevice

This commit is contained in:
Danny Robson 2019-03-03 23:29:26 +11:00
parent 253d5414da
commit 92a43a10cb

View File

@ -921,10 +921,19 @@ def write_dispatch(dst: TextIO, q: List[Type], reg: Registry):
auto wrapped = std::make_unique<indirect<VkPhysicalDevice,cruft::vk::load::instance_table>> ();
wrapped->handle = res[i];
#define GET(NAME) wrapped->table.NAME = wrapped->table.NAME ?: reinterpret_cast<decltype(&NAME)> (entry->table.vkGetInstanceProcAddr (instance, #NAME));
#define GET(NAME) wrapped->table.NAME = wrapped->table.NAME ?: reinterpret_cast<decltype(&NAME)> (entry->table.vkGetInstanceProcAddr (entry->handle, #NAME));
MAP_INSTANCE_COMMANDS(GET)
#undef GET
#define GET(NAME) wrapped->table.NAME = wrapped->table.NAME ?: reinterpret_cast<decltype(&NAME)> (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<decltype(&NAME)> (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 ();
}