tools/spec: prefer PhysicalDeviceGetProcAddr

This commit is contained in:
Danny Robson 2019-03-04 10:51:12 +11:00
parent 99f8e0ff4d
commit 114e960810

View File

@ -884,6 +884,7 @@ def write_dispatch(dst: TextIO, q: List[Type], reg: Registry):
""",
'vkGetInstanceProcAddr': """
std::clog << "InstanceProcAddr: " << pName << '\\n';
#define ATTEMPT(NAME) if (!strcmp (#NAME, pName)) return reinterpret_cast<PFN_vkVoidFunction> (&NAME);
MAP_INSTANCE_COMMANDS(ATTEMPT)
#undef ATTEMPT
@ -922,15 +923,15 @@ 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 (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
#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));
#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