MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / initInstanceTable

Function initInstanceTable

layersvt/vk_layer_table.cpp:104–123  ·  view source on GitHub ↗

Various dispatchable objects will use the same underlying dispatch table if they * are created from that "parent" object. Thus use pointer to dispatch table * as the key to these table maps. * Instance -> PhysicalDevice * Device -> CommandBuffer or Queue * If use the object themselves as key to map then implies Create entrypoints have to be intercepted * and a new key inserted into map

Source from the content-addressed store, hash-verified

102 * If use the object themselves as key to map then implies Create entrypoints have to be intercepted
103 * and a new key inserted into map */
104VkuInstanceDispatchTable *initInstanceTable(VkInstance instance, const PFN_vkGetInstanceProcAddr gpa, instance_table_map &map) {
105 VkuInstanceDispatchTable *pTable;
106 dispatch_key key = get_dispatch_key(instance);
107 instance_table_map::const_iterator it = map.find((void *)key);
108
109 if (it == map.end()) {
110 pTable = new VkuInstanceDispatchTable;
111 map[(void *)key] = pTable;
112 } else {
113 return it->second;
114 }
115
116 vkuInitInstanceDispatchTable(instance, pTable, gpa);
117
118 // Setup func pointers that are required but not externally exposed. These won't be added to the instance dispatch table by
119 // default.
120 pTable->GetPhysicalDeviceProcAddr = (PFN_GetPhysicalDeviceProcAddr)gpa(instance, "vk_layerGetPhysicalDeviceProcAddr");
121
122 return pTable;
123}
124
125VkuInstanceDispatchTable *initInstanceTable(VkInstance instance, const PFN_vkGetInstanceProcAddr gpa) {
126 return initInstanceTable(instance, gpa, tableInstanceMap);

Callers 2

vkCreateInstanceFunction · 0.85
CreateInstanceFunction · 0.85

Calls 1

get_dispatch_keyFunction · 0.85

Tested by

no test coverage detected