Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2015-2016 The Khronos Group Inc. |
| 2 | * Copyright (c) 2015-2016 Valve Corporation |
| 3 | * Copyright (c) 2015-2016 LunarG, Inc. |
Michael Lentine | 584ccab | 2016-02-03 16:51:46 -0600 | [diff] [blame] | 4 | * Copyright (c) 2015-2016 Google, Inc. |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 5 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and/or associated documentation files (the "Materials"), to |
| 8 | * deal in the Materials without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Materials, and to permit persons to whom the Materials |
| 11 | * are furnished to do so, subject to the following conditions: |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 12 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 13 | * The above copyright notice(s) and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Materials. |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 15 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 16 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 19 | * |
| 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 21 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 22 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 23 | * USE OR OTHER DEALINGS IN THE MATERIALS |
Courtney Goeltzenleuchter | 96cd795 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 24 | * |
| 25 | * Author: Tobin Ehlis <tobin@lunarg.com> |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 26 | */ |
| 27 | #include <assert.h> |
| 28 | #include <unordered_map> |
| 29 | #include "vk_dispatch_table_helper.h" |
David Pinedo | 329ca9e | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 30 | #include "vulkan/vk_layer.h" |
Tobin Ehlis | 56d204a | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 31 | #include "vk_layer_table.h" |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 32 | static device_table_map tableMap; |
| 33 | static instance_table_map tableInstanceMap; |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 34 | |
Jon Ashburn | 4ec582f | 2015-06-15 09:30:12 -0600 | [diff] [blame] | 35 | #define DISPATCH_MAP_DEBUG 0 |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 36 | |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 37 | // Map lookup must be thread safe |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 38 | VkLayerDispatchTable *device_dispatch_table(void *object) { |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 39 | dispatch_key key = get_dispatch_key(object); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 40 | device_table_map::const_iterator it = tableMap.find((void *)key); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 41 | assert(it != tableMap.end() && "Not able to find device dispatch entry"); |
| 42 | return it->second; |
| 43 | } |
| 44 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 45 | VkLayerInstanceDispatchTable *instance_dispatch_table(void *object) { |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 46 | dispatch_key key = get_dispatch_key(object); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 47 | instance_table_map::const_iterator it = tableInstanceMap.find((void *)key); |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 48 | #if DISPATCH_MAP_DEBUG |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 49 | if (it != tableInstanceMap.end()) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 50 | fprintf(stderr, "instance_dispatch_table: map: %p, object: %p, key: %p, table: %p\n", &tableInstanceMap, object, key, |
| 51 | it->second); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 52 | } else { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 53 | fprintf(stderr, "instance_dispatch_table: map: %p, object: %p, key: %p, table: UNKNOWN\n", &tableInstanceMap, object, key); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 54 | } |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 55 | #endif |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 56 | assert(it != tableInstanceMap.end() && "Not able to find instance dispatch entry"); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 57 | return it->second; |
| 58 | } |
| 59 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 60 | void destroy_dispatch_table(device_table_map &map, dispatch_key key) { |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 61 | #if DISPATCH_MAP_DEBUG |
Michael Lentine | 584ccab | 2016-02-03 16:51:46 -0600 | [diff] [blame] | 62 | device_table_map::const_iterator it = map.find((void *)key); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 63 | if (it != map.end()) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 64 | fprintf(stderr, "destroy device dispatch_table: map: %p, key: %p, table: %p\n", &map, key, it->second); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 65 | } else { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 66 | fprintf(stderr, "destroy device dispatch table: map: %p, key: %p, table: UNKNOWN\n", &map, key); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 67 | assert(it != map.end()); |
| 68 | } |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 69 | #endif |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 70 | map.erase(key); |
| 71 | } |
| 72 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 73 | void destroy_dispatch_table(instance_table_map &map, dispatch_key key) { |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 74 | #if DISPATCH_MAP_DEBUG |
Michael Lentine | 584ccab | 2016-02-03 16:51:46 -0600 | [diff] [blame] | 75 | instance_table_map::const_iterator it = map.find((void *)key); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 76 | if (it != map.end()) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 77 | fprintf(stderr, "destroy instance dispatch_table: map: %p, key: %p, table: %p\n", &map, key, it->second); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 78 | } else { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 79 | fprintf(stderr, "destroy instance dispatch table: map: %p, key: %p, table: UNKNOWN\n", &map, key); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 80 | assert(it != map.end()); |
| 81 | } |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 82 | #endif |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 83 | map.erase(key); |
| 84 | } |
| 85 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 86 | void destroy_device_dispatch_table(dispatch_key key) { destroy_dispatch_table(tableMap, key); } |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 87 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 88 | void destroy_instance_dispatch_table(dispatch_key key) { destroy_dispatch_table(tableInstanceMap, key); } |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 89 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 90 | VkLayerDispatchTable *get_dispatch_table(device_table_map &map, void *object) { |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 91 | dispatch_key key = get_dispatch_key(object); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 92 | device_table_map::const_iterator it = map.find((void *)key); |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 93 | #if DISPATCH_MAP_DEBUG |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 94 | if (it != map.end()) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 95 | fprintf(stderr, "device_dispatch_table: map: %p, object: %p, key: %p, table: %p\n", &tableInstanceMap, object, key, |
| 96 | it->second); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 97 | } else { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 98 | fprintf(stderr, "device_dispatch_table: map: %p, object: %p, key: %p, table: UNKNOWN\n", &tableInstanceMap, object, key); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 99 | } |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 100 | #endif |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 101 | assert(it != map.end() && "Not able to find device dispatch entry"); |
| 102 | return it->second; |
| 103 | } |
| 104 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 105 | VkLayerInstanceDispatchTable *get_dispatch_table(instance_table_map &map, void *object) { |
| 106 | // VkLayerInstanceDispatchTable *pDisp = *(VkLayerInstanceDispatchTable **) object; |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 107 | dispatch_key key = get_dispatch_key(object); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 108 | instance_table_map::const_iterator it = map.find((void *)key); |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 109 | #if DISPATCH_MAP_DEBUG |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 110 | if (it != map.end()) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 111 | fprintf(stderr, "instance_dispatch_table: map: %p, object: %p, key: %p, table: %p\n", &tableInstanceMap, object, key, |
| 112 | it->second); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 113 | } else { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 114 | fprintf(stderr, "instance_dispatch_table: map: %p, object: %p, key: %p, table: UNKNOWN\n", &tableInstanceMap, object, key); |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 115 | } |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 116 | #endif |
Courtney Goeltzenleuchter | fde3a53 | 2015-06-13 21:18:30 -0600 | [diff] [blame] | 117 | assert(it != map.end() && "Not able to find instance dispatch entry"); |
| 118 | return it->second; |
| 119 | } |
| 120 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 121 | VkLayerInstanceCreateInfo *get_chain_info(const VkInstanceCreateInfo *pCreateInfo, VkLayerFunction func) { |
| 122 | VkLayerInstanceCreateInfo *chain_info = (VkLayerInstanceCreateInfo *)pCreateInfo->pNext; |
| 123 | while (chain_info && !(chain_info->sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO && chain_info->function == func)) { |
| 124 | chain_info = (VkLayerInstanceCreateInfo *)chain_info->pNext; |
Courtney Goeltzenleuchter | cfbccd8 | 2016-01-08 11:52:37 -0700 | [diff] [blame] | 125 | } |
| 126 | assert(chain_info != NULL); |
| 127 | return chain_info; |
| 128 | } |
| 129 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 130 | VkLayerDeviceCreateInfo *get_chain_info(const VkDeviceCreateInfo *pCreateInfo, VkLayerFunction func) { |
| 131 | VkLayerDeviceCreateInfo *chain_info = (VkLayerDeviceCreateInfo *)pCreateInfo->pNext; |
| 132 | while (chain_info && !(chain_info->sType == VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO && chain_info->function == func)) { |
| 133 | chain_info = (VkLayerDeviceCreateInfo *)chain_info->pNext; |
Courtney Goeltzenleuchter | cfbccd8 | 2016-01-08 11:52:37 -0700 | [diff] [blame] | 134 | } |
| 135 | assert(chain_info != NULL); |
| 136 | return chain_info; |
| 137 | } |
| 138 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 139 | /* Various dispatchable objects will use the same underlying dispatch table if they |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 140 | * are created from that "parent" object. Thus use pointer to dispatch table |
| 141 | * as the key to these table maps. |
| 142 | * Instance -> PhysicalDevice |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 143 | * Device -> CommandBuffer or Queue |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 144 | * If use the object themselves as key to map then implies Create entrypoints have to be intercepted |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 145 | * and a new key inserted into map */ |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 146 | VkLayerInstanceDispatchTable *initInstanceTable(VkInstance instance, const PFN_vkGetInstanceProcAddr gpa, instance_table_map &map) { |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 147 | VkLayerInstanceDispatchTable *pTable; |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 148 | dispatch_key key = get_dispatch_key(instance); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 149 | instance_table_map::const_iterator it = map.find((void *)key); |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 150 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 151 | if (it == map.end()) { |
| 152 | pTable = new VkLayerInstanceDispatchTable; |
| 153 | map[(void *)key] = pTable; |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 154 | #if DISPATCH_MAP_DEBUG |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 155 | fprintf(stderr, "New, Instance: map: %p, key: %p, table: %p\n", &map, key, pTable); |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 156 | #endif |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 157 | } else { |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 158 | #if DISPATCH_MAP_DEBUG |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 159 | fprintf(stderr, "Instance: map: %p, key: %p, table: %p\n", &map, key, it->second); |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 160 | #endif |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 161 | return it->second; |
| 162 | } |
| 163 | |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 164 | layer_init_instance_dispatch_table(instance, pTable, gpa); |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 165 | |
| 166 | return pTable; |
| 167 | } |
| 168 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 169 | VkLayerInstanceDispatchTable *initInstanceTable(VkInstance instance, const PFN_vkGetInstanceProcAddr gpa) { |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 170 | return initInstanceTable(instance, gpa, tableInstanceMap); |
Courtney Goeltzenleuchter | 1f1fbbd | 2015-06-14 12:03:26 -0600 | [diff] [blame] | 171 | } |
| 172 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 173 | VkLayerDispatchTable *initDeviceTable(VkDevice device, const PFN_vkGetDeviceProcAddr gpa, device_table_map &map) { |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 174 | VkLayerDispatchTable *pTable; |
| 175 | dispatch_key key = get_dispatch_key(device); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 176 | device_table_map::const_iterator it = map.find((void *)key); |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 177 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 178 | if (it == map.end()) { |
| 179 | pTable = new VkLayerDispatchTable; |
| 180 | map[(void *)key] = pTable; |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 181 | #if DISPATCH_MAP_DEBUG |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 182 | fprintf(stderr, "New, Device: map: %p, key: %p, table: %p\n", &map, key, pTable); |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 183 | #endif |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 184 | } else { |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 185 | #if DISPATCH_MAP_DEBUG |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 186 | fprintf(stderr, "Device: map: %p, key: %p, table: %p\n", &map, key, it->second); |
Courtney Goeltzenleuchter | 2906bb5 | 2015-06-13 21:48:26 -0600 | [diff] [blame] | 187 | #endif |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 188 | return it->second; |
| 189 | } |
| 190 | |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 191 | layer_init_device_dispatch_table(device, pTable, gpa); |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 192 | |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 193 | return pTable; |
Courtney Goeltzenleuchter | 1f1fbbd | 2015-06-14 12:03:26 -0600 | [diff] [blame] | 194 | } |
| 195 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 196 | VkLayerDispatchTable *initDeviceTable(VkDevice device, const PFN_vkGetDeviceProcAddr gpa) { |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 197 | return initDeviceTable(device, gpa, tableMap); |
Jon Ashburn | 5a10d21 | 2015-06-01 10:02:09 -0600 | [diff] [blame] | 198 | } |