diff options
| -rw-r--r-- | layers/vk_layer_table.cpp | 20 | ||||
| -rw-r--r-- | layers/vk_layer_table.h | 4 |
2 files changed, 24 insertions, 0 deletions
diff --git a/layers/vk_layer_table.cpp b/layers/vk_layer_table.cpp index 1c4fa133..93d2fbf4 100644 --- a/layers/vk_layer_table.cpp +++ b/layers/vk_layer_table.cpp @@ -125,6 +125,26 @@ VkLayerInstanceDispatchTable *get_dispatch_table(instance_table_map &map, void* return it->second; } +VkLayerInstanceCreateInfo *get_chain_info(const VkInstanceCreateInfo *pCreateInfo) +{ + VkLayerInstanceCreateInfo *chain_info = (VkLayerInstanceCreateInfo *) pCreateInfo->pNext; + while (chain_info && chain_info->sType != VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO) { + chain_info = (VkLayerInstanceCreateInfo *) chain_info->pNext; + } + assert(chain_info != NULL); + return chain_info; +} + +VkLayerDeviceCreateInfo *get_chain_info(const VkDeviceCreateInfo *pCreateInfo) +{ + VkLayerDeviceCreateInfo *chain_info = (VkLayerDeviceCreateInfo *) pCreateInfo->pNext; + while (chain_info && chain_info->sType != VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO) { + chain_info = (VkLayerDeviceCreateInfo *) chain_info->pNext; + } + assert(chain_info != NULL); + return chain_info; +} + /* 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. diff --git a/layers/vk_layer_table.h b/layers/vk_layer_table.h index bccd7364..816b6a69 100644 --- a/layers/vk_layer_table.h +++ b/layers/vk_layer_table.h @@ -24,6 +24,7 @@ */ #pragma once +#include "vulkan/vulkan.h" #include <unordered_map> typedef std::unordered_map<void *, VkLayerDispatchTable *> device_table_map; @@ -48,5 +49,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); + void destroy_device_dispatch_table(dispatch_key key); void destroy_instance_dispatch_table(dispatch_key key); |
