diff options
| author | Courtney Goeltzenleuchter <courtneygo@google.com> | 2016-01-08 12:18:43 -0700 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2016-01-20 18:04:55 -0700 |
| commit | a1de4b2dffb98222ca59f4a70c301d22bb4c089e (patch) | |
| tree | b5d9e5235b444d8995f2c122637280b8e32ef72d /layers/vk_layer_table.h | |
| parent | e974568a65f7243dbc1eeb69d94174d0563c9d65 (diff) | |
| download | usermoji-a1de4b2dffb98222ca59f4a70c301d22bb4c089e.tar.xz | |
loader: implement new layer init method
New layer init method requires the construction of
Link information for CreateInstance and CreateDevice
that is accessible to layers via the CreateInfo.pNext pointer.
The layer can then use the Get*ProcAddr from the Link
structure to initialize their dispatch table if the
call down the chain returns successfully.
This removes the need to do special initialization work
at Get*ProcAddr time.
Layer Get*ProcAddr now return their internal function
pointers regardless of the value of instance or device.
Only need to have valid instance & device when looking
up extensions or when passing the request down the chain.
This mechanism allows us to remove object wrapping used
by the loader previously. Also simplifies the dispatch table
setup.
Conflicts:
layers/device_limits.cpp
layers/draw_state.cpp
loader/loader.c
loader/trampoline.c
Diffstat (limited to 'layers/vk_layer_table.h')
| -rw-r--r-- | layers/vk_layer_table.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/layers/vk_layer_table.h b/layers/vk_layer_table.h index 04ea2661..0011c857 100644 --- a/layers/vk_layer_table.h +++ b/layers/vk_layer_table.h @@ -29,10 +29,11 @@ typedef std::unordered_map<void *, VkLayerDispatchTable *> device_table_map; typedef std::unordered_map<void *, VkLayerInstanceDispatchTable *> instance_table_map; -VkLayerDispatchTable * initDeviceTable(const VkBaseLayerObject *devw); -VkLayerDispatchTable * initDeviceTable(device_table_map &map, const VkBaseLayerObject *devw); -VkLayerInstanceDispatchTable * initInstanceTable(const VkBaseLayerObject *instancew); -VkLayerInstanceDispatchTable * initInstanceTable(instance_table_map &map, const VkBaseLayerObject *instancew); +VkLayerDispatchTable * initDeviceTable(VkDevice device, const PFN_vkGetDeviceProcAddr gpa, device_table_map &map); +VkLayerDispatchTable * initDeviceTable(VkDevice device, const PFN_vkGetDeviceProcAddr gpa); +VkLayerInstanceDispatchTable * initInstanceTable(VkInstance instance, const PFN_vkGetInstanceProcAddr gpa, instance_table_map &map); +VkLayerInstanceDispatchTable * initInstanceTable(VkInstance instance, const PFN_vkGetInstanceProcAddr gpa); + typedef void *dispatch_key; @@ -49,8 +50,8 @@ VkLayerDispatchTable *get_dispatch_table(device_table_map &map, void* object); VkLayerInstanceDispatchTable *get_dispatch_table(instance_table_map &map, void* object); -VkLayerInstanceCreateInfo *get_chain_info(const VkInstanceCreateInfo *pCreateInfo); -VkLayerDeviceCreateInfo *get_chain_info(const VkDeviceCreateInfo *pCreateInfo); +VkLayerInstanceCreateInfo *get_chain_info(const VkInstanceCreateInfo *pCreateInfo, VkLayerFunction func); +VkLayerDeviceCreateInfo *get_chain_info(const VkDeviceCreateInfo *pCreateInfo, VkLayerFunction func); void destroy_device_dispatch_table(dispatch_key key); void destroy_instance_dispatch_table(dispatch_key key); |
