Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1 | /* |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2 | * Vulkan |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2014 LunarG, Inc. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | * DEALINGS IN THE SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | #include <stdio.h> |
| 26 | #include <stdlib.h> |
| 27 | #include <string.h> |
| 28 | |
| 29 | #include <iostream> |
| 30 | #include <string> |
| 31 | #include <sstream> |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 32 | #include <unordered_map> |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 33 | #include <vector> |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 34 | |
Tobin Ehlis | b835d1b | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 35 | #include "vk_loader_platform.h" |
Tobin Ehlis | 0c6f9ee | 2015-07-03 09:42:57 -0600 | [diff] [blame] | 36 | #include "vk_layer.h" |
Tobin Ehlis | a0cb02e | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 37 | #include "vk_layer_config.h" |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 38 | #include "vk_enum_validate_helper.h" |
| 39 | #include "vk_struct_validate_helper.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 40 | //The following is #included again to catch certain OS-specific functions being used: |
Tobin Ehlis | b835d1b | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 41 | #include "vk_loader_platform.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 42 | |
Tobin Ehlis | a0cb02e | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 43 | #include "vk_layer_table.h" |
| 44 | #include "vk_layer_data.h" |
| 45 | #include "vk_layer_logging.h" |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 46 | #include "vk_layer_extension_utils.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 47 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 48 | typedef struct _layer_data { |
| 49 | debug_report_data *report_data; |
| 50 | VkDbgMsgCallback logging_callback; |
| 51 | } layer_data; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 52 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 53 | static std::unordered_map<void*, layer_data*> layer_data_map; |
| 54 | static device_table_map pc_device_table_map; |
| 55 | static instance_table_map pc_instance_table_map; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 56 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 57 | // "my instance data" |
| 58 | debug_report_data *mid(VkInstance object) |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 59 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 60 | dispatch_key key = get_dispatch_key(object); |
Tobin Ehlis | bfbac25 | 2015-09-01 11:46:36 -0600 | [diff] [blame] | 61 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 62 | #if DISPATCH_MAP_DEBUG |
| 63 | fprintf(stderr, "MID: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, data); |
| 64 | #endif |
Courtney Goeltzenleuchter | 876a4f5 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 65 | assert(data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 66 | |
| 67 | return data->report_data; |
| 68 | } |
| 69 | |
| 70 | // "my device data" |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 71 | debug_report_data *mdd(void* object) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 72 | { |
| 73 | dispatch_key key = get_dispatch_key(object); |
| 74 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 75 | #if DISPATCH_MAP_DEBUG |
| 76 | fprintf(stderr, "MDD: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, data); |
| 77 | #endif |
Courtney Goeltzenleuchter | 876a4f5 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 78 | assert(data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 79 | return data->report_data; |
| 80 | } |
| 81 | |
| 82 | static void InitParamChecker(layer_data *data) |
| 83 | { |
| 84 | uint32_t report_flags = getLayerOptionFlags("ParamCheckerReportFlags", 0); |
| 85 | |
| 86 | uint32_t debug_action = 0; |
| 87 | getLayerOptionEnum("ParamCheckerDebugAction", (uint32_t *) &debug_action); |
| 88 | if(debug_action & VK_DBG_LAYER_ACTION_LOG_MSG) |
| 89 | { |
| 90 | FILE *log_output = NULL; |
| 91 | const char* option_str = getLayerOption("ParamCheckerLogFilename"); |
| 92 | if(option_str) |
| 93 | { |
| 94 | log_output = fopen(option_str, "w"); |
| 95 | } |
Tobin Ehlis | b80b425 | 2015-09-01 11:59:36 -0600 | [diff] [blame] | 96 | if (log_output == NULL) { |
| 97 | if (option_str) |
| 98 | std::cout << std::endl << "ParamChecker ERROR: Bad output filename specified: " << option_str << ". Writing to STDOUT instead" << std::endl << std::endl; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 99 | log_output = stdout; |
| 100 | } |
| 101 | |
| 102 | layer_create_msg_callback(data->report_data, report_flags, log_callback, (void*)log_output, &data->logging_callback); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | VK_LAYER_EXPORT VkResult VKAPI vkDbgCreateMsgCallback( |
| 107 | VkInstance instance, |
| 108 | VkFlags msgFlags, |
| 109 | const PFN_vkDbgMsgCallback pfnMsgCallback, |
| 110 | void* pUserData, |
| 111 | VkDbgMsgCallback* pMsgCallback) |
| 112 | { |
| 113 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 114 | VkResult result = pTable->DbgCreateMsgCallback(instance, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 115 | |
| 116 | if (result == VK_SUCCESS) |
| 117 | { |
| 118 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 119 | result = layer_create_msg_callback(data->report_data, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 120 | } |
| 121 | |
| 122 | return result; |
| 123 | } |
| 124 | |
| 125 | VK_LAYER_EXPORT VkResult VKAPI vkDbgDestroyMsgCallback( |
| 126 | VkInstance instance, |
| 127 | VkDbgMsgCallback msgCallback) |
| 128 | { |
| 129 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 130 | VkResult result = pTable->DbgDestroyMsgCallback(instance, msgCallback); |
| 131 | |
| 132 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 133 | layer_destroy_msg_callback(data->report_data, msgCallback); |
| 134 | |
| 135 | return result; |
| 136 | } |
| 137 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 138 | static const VkLayerProperties pc_global_layers[] = { |
| 139 | { |
| 140 | "ParamChecker", |
| 141 | VK_API_VERSION, |
| 142 | VK_MAKE_VERSION(0, 1, 0), |
| 143 | "Validation layer: ParamChecker", |
| 144 | } |
| 145 | }; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 146 | |
| 147 | VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 148 | const char *pLayerName, |
| 149 | uint32_t *pCount, |
| 150 | VkExtensionProperties* pProperties) |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 151 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 152 | /* ParamChecker does not have any global extensions */ |
| 153 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 154 | } |
| 155 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 156 | VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalLayerProperties( |
| 157 | uint32_t *pCount, |
| 158 | VkLayerProperties* pProperties) |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 159 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 160 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), |
| 161 | pc_global_layers, |
| 162 | pCount, pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 166 | VkPhysicalDevice physicalDevice, |
| 167 | const char* pLayerName, |
| 168 | uint32_t* pCount, |
| 169 | VkExtensionProperties* pProperties) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 170 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 171 | /* ParamChecker does not have any physical device extensions */ |
| 172 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 173 | } |
| 174 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 175 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLayerProperties( |
| 176 | VkPhysicalDevice physicalDevice, |
| 177 | uint32_t* pCount, |
| 178 | VkLayerProperties* pProperties) |
| 179 | { |
| 180 | /* ParamChecker's physical device layers are the same as global */ |
| 181 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, |
| 182 | pCount, pProperties); |
| 183 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 184 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 185 | // Version: 0.138.2 |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 186 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 187 | static |
| 188 | std::string EnumeratorString(VkResult const& enumerator) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 189 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 190 | switch(enumerator) |
| 191 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 192 | case VK_RESULT_MAX_ENUM: |
| 193 | { |
| 194 | return "VK_RESULT_MAX_ENUM"; |
| 195 | break; |
| 196 | } |
| 197 | case VK_ERROR_INVALID_LAYER: |
| 198 | { |
| 199 | return "VK_ERROR_INVALID_LAYER"; |
| 200 | break; |
| 201 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 202 | case VK_ERROR_INCOMPATIBLE_DRIVER: |
| 203 | { |
| 204 | return "VK_ERROR_INCOMPATIBLE_DRIVER"; |
| 205 | break; |
| 206 | } |
| 207 | case VK_ERROR_MEMORY_UNMAP_FAILED: |
| 208 | { |
| 209 | return "VK_ERROR_MEMORY_UNMAP_FAILED"; |
| 210 | break; |
| 211 | } |
| 212 | case VK_ERROR_MEMORY_MAP_FAILED: |
| 213 | { |
| 214 | return "VK_ERROR_MEMORY_MAP_FAILED"; |
| 215 | break; |
| 216 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 217 | case VK_INCOMPLETE: |
| 218 | { |
| 219 | return "VK_INCOMPLETE"; |
| 220 | break; |
| 221 | } |
| 222 | case VK_ERROR_OUT_OF_HOST_MEMORY: |
| 223 | { |
| 224 | return "VK_ERROR_OUT_OF_HOST_MEMORY"; |
| 225 | break; |
| 226 | } |
| 227 | case VK_ERROR_UNKNOWN: |
| 228 | { |
| 229 | return "VK_ERROR_UNKNOWN"; |
| 230 | break; |
| 231 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 232 | case VK_ERROR_INITIALIZATION_FAILED: |
| 233 | { |
| 234 | return "VK_ERROR_INITIALIZATION_FAILED"; |
| 235 | break; |
| 236 | } |
| 237 | case VK_NOT_READY: |
| 238 | { |
| 239 | return "VK_NOT_READY"; |
| 240 | break; |
| 241 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 242 | case VK_ERROR_OUT_OF_DEVICE_MEMORY: |
| 243 | { |
| 244 | return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; |
| 245 | break; |
| 246 | } |
| 247 | case VK_EVENT_SET: |
| 248 | { |
| 249 | return "VK_EVENT_SET"; |
| 250 | break; |
| 251 | } |
| 252 | case VK_TIMEOUT: |
| 253 | { |
| 254 | return "VK_TIMEOUT"; |
| 255 | break; |
| 256 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 257 | case VK_EVENT_RESET: |
| 258 | { |
| 259 | return "VK_EVENT_RESET"; |
| 260 | break; |
| 261 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 262 | case VK_UNSUPPORTED: |
| 263 | { |
| 264 | return "VK_UNSUPPORTED"; |
| 265 | break; |
| 266 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 267 | case VK_ERROR_INCOMPATIBLE_DEVICE: |
| 268 | { |
| 269 | return "VK_ERROR_INCOMPATIBLE_DEVICE"; |
| 270 | break; |
| 271 | } |
| 272 | case VK_SUCCESS: |
| 273 | { |
| 274 | return "VK_SUCCESS"; |
| 275 | break; |
| 276 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 277 | case VK_ERROR_INVALID_EXTENSION: |
| 278 | { |
| 279 | return "VK_ERROR_INVALID_EXTENSION"; |
| 280 | break; |
| 281 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 282 | case VK_ERROR_DEVICE_LOST: |
| 283 | { |
| 284 | return "VK_ERROR_DEVICE_LOST"; |
| 285 | break; |
| 286 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 287 | default: |
| 288 | { |
| 289 | return "unrecognized enumerator"; |
| 290 | break; |
| 291 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 292 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 293 | } |
| 294 | |
| 295 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 296 | bool ValidateEnumerator(VkFormatFeatureFlagBits const& enumerator) |
| 297 | { |
Courtney Goeltzenleuchter | f1ece60 | 2015-09-10 16:25:49 -0600 | [diff] [blame] | 298 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 299 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | |
| 300 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 301 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | |
| 302 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 303 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | |
| 304 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | |
| 305 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 306 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | |
| 307 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 308 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 309 | VK_FORMAT_FEATURE_BLIT_SOURCE_BIT | |
| 310 | VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 311 | if(enumerator & (~allFlags)) |
| 312 | { |
| 313 | return false; |
| 314 | } |
| 315 | |
| 316 | return true; |
| 317 | } |
| 318 | |
| 319 | static |
| 320 | std::string EnumeratorString(VkFormatFeatureFlagBits const& enumerator) |
| 321 | { |
| 322 | if(!ValidateEnumerator(enumerator)) |
| 323 | { |
| 324 | return "unrecognized enumerator"; |
| 325 | } |
| 326 | |
| 327 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 328 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) |
| 329 | { |
| 330 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 331 | } |
| 332 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) |
| 333 | { |
| 334 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 335 | } |
| 336 | if(enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) |
| 337 | { |
| 338 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 339 | } |
| 340 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) |
| 341 | { |
| 342 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 343 | } |
| 344 | if(enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) |
| 345 | { |
| 346 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 347 | } |
| 348 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) |
| 349 | { |
| 350 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 351 | } |
| 352 | if(enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) |
| 353 | { |
| 354 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 355 | } |
| 356 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) |
| 357 | { |
| 358 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 359 | } |
| 360 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 361 | { |
| 362 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 363 | } |
| 364 | if(enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 365 | { |
| 366 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 367 | } |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 368 | if(enumerator & VK_FORMAT_FEATURE_BLIT_SOURCE_BIT) |
| 369 | { |
| 370 | strings.push_back("VK_FORMAT_FEATURE_BLIT_SOURCE_BIT"); |
| 371 | } |
| 372 | if(enumerator & VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT) |
| 373 | { |
| 374 | strings.push_back("VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT"); |
| 375 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 376 | |
| 377 | std::string enumeratorString; |
| 378 | for(auto const& string : strings) |
| 379 | { |
| 380 | enumeratorString += string; |
| 381 | |
| 382 | if(string != strings.back()) |
| 383 | { |
| 384 | enumeratorString += '|'; |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | return enumeratorString; |
| 389 | } |
| 390 | |
| 391 | static |
| 392 | bool ValidateEnumerator(VkImageUsageFlagBits const& enumerator) |
| 393 | { |
| 394 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)(VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 395 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 396 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 397 | VK_IMAGE_USAGE_STORAGE_BIT | |
| 398 | VK_IMAGE_USAGE_SAMPLED_BIT | |
| 399 | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT | |
| 400 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | |
Cody Northrop | 84fa790 | 2015-08-25 15:39:48 -0600 | [diff] [blame] | 401 | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 402 | if(enumerator & (~allFlags)) |
| 403 | { |
| 404 | return false; |
| 405 | } |
| 406 | |
| 407 | return true; |
| 408 | } |
| 409 | |
| 410 | static |
| 411 | std::string EnumeratorString(VkImageUsageFlagBits const& enumerator) |
| 412 | { |
| 413 | if(!ValidateEnumerator(enumerator)) |
| 414 | { |
| 415 | return "unrecognized enumerator"; |
| 416 | } |
| 417 | |
| 418 | std::vector<std::string> strings; |
| 419 | if(enumerator & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) |
| 420 | { |
| 421 | strings.push_back("VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT"); |
| 422 | } |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 423 | if(enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 424 | { |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 425 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 426 | } |
| 427 | if(enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) |
| 428 | { |
| 429 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 430 | } |
| 431 | if(enumerator & VK_IMAGE_USAGE_STORAGE_BIT) |
| 432 | { |
| 433 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 434 | } |
| 435 | if(enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) |
| 436 | { |
| 437 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 438 | } |
| 439 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) |
| 440 | { |
| 441 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT"); |
| 442 | } |
| 443 | if(enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) |
| 444 | { |
| 445 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 446 | } |
| 447 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) |
| 448 | { |
| 449 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT"); |
| 450 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 451 | |
| 452 | std::string enumeratorString; |
| 453 | for(auto const& string : strings) |
| 454 | { |
| 455 | enumeratorString += string; |
| 456 | |
| 457 | if(string != strings.back()) |
| 458 | { |
| 459 | enumeratorString += '|'; |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | return enumeratorString; |
| 464 | } |
| 465 | |
| 466 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 467 | bool ValidateEnumerator(VkQueueFlagBits const& enumerator) |
| 468 | { |
| 469 | VkQueueFlagBits allFlags = (VkQueueFlagBits)(VK_QUEUE_EXTENDED_BIT | |
| 470 | VK_QUEUE_DMA_BIT | |
| 471 | VK_QUEUE_COMPUTE_BIT | |
| 472 | VK_QUEUE_SPARSE_MEMMGR_BIT | |
| 473 | VK_QUEUE_GRAPHICS_BIT); |
| 474 | if(enumerator & (~allFlags)) |
| 475 | { |
| 476 | return false; |
| 477 | } |
| 478 | |
| 479 | return true; |
| 480 | } |
| 481 | |
| 482 | static |
| 483 | std::string EnumeratorString(VkQueueFlagBits const& enumerator) |
| 484 | { |
| 485 | if(!ValidateEnumerator(enumerator)) |
| 486 | { |
| 487 | return "unrecognized enumerator"; |
| 488 | } |
| 489 | |
| 490 | std::vector<std::string> strings; |
| 491 | if(enumerator & VK_QUEUE_EXTENDED_BIT) |
| 492 | { |
| 493 | strings.push_back("VK_QUEUE_EXTENDED_BIT"); |
| 494 | } |
| 495 | if(enumerator & VK_QUEUE_DMA_BIT) |
| 496 | { |
| 497 | strings.push_back("VK_QUEUE_DMA_BIT"); |
| 498 | } |
| 499 | if(enumerator & VK_QUEUE_COMPUTE_BIT) |
| 500 | { |
| 501 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 502 | } |
| 503 | if(enumerator & VK_QUEUE_SPARSE_MEMMGR_BIT) |
| 504 | { |
| 505 | strings.push_back("VK_QUEUE_SPARSE_MEMMGR_BIT"); |
| 506 | } |
| 507 | if(enumerator & VK_QUEUE_GRAPHICS_BIT) |
| 508 | { |
| 509 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 510 | } |
| 511 | |
| 512 | std::string enumeratorString; |
| 513 | for(auto const& string : strings) |
| 514 | { |
| 515 | enumeratorString += string; |
| 516 | |
| 517 | if(string != strings.back()) |
| 518 | { |
| 519 | enumeratorString += '|'; |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | return enumeratorString; |
| 524 | } |
| 525 | |
| 526 | static |
| 527 | bool ValidateEnumerator(VkMemoryPropertyFlagBits const& enumerator) |
| 528 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 529 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)(VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT | |
| 530 | VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 531 | VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT | |
| 532 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 533 | VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT | |
| 534 | VK_MEMORY_PROPERTY_DEVICE_ONLY); |
| 535 | if(enumerator & (~allFlags)) |
| 536 | { |
| 537 | return false; |
| 538 | } |
| 539 | |
| 540 | return true; |
| 541 | } |
| 542 | |
| 543 | static |
| 544 | std::string EnumeratorString(VkMemoryPropertyFlagBits const& enumerator) |
| 545 | { |
| 546 | if(!ValidateEnumerator(enumerator)) |
| 547 | { |
| 548 | return "unrecognized enumerator"; |
| 549 | } |
| 550 | |
| 551 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 552 | if(enumerator & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) |
| 553 | { |
| 554 | strings.push_back("VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT"); |
| 555 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 556 | if(enumerator & VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT) |
| 557 | { |
| 558 | strings.push_back("VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT"); |
| 559 | } |
| 560 | if(enumerator & VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT) |
| 561 | { |
| 562 | strings.push_back("VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT"); |
| 563 | } |
| 564 | if(enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) |
| 565 | { |
| 566 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 567 | } |
| 568 | if(enumerator & VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT) |
| 569 | { |
| 570 | strings.push_back("VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT"); |
| 571 | } |
| 572 | if(enumerator & VK_MEMORY_PROPERTY_DEVICE_ONLY) |
| 573 | { |
| 574 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_ONLY"); |
| 575 | } |
| 576 | |
| 577 | std::string enumeratorString; |
| 578 | for(auto const& string : strings) |
| 579 | { |
| 580 | enumeratorString += string; |
| 581 | |
| 582 | if(string != strings.back()) |
| 583 | { |
| 584 | enumeratorString += '|'; |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | return enumeratorString; |
| 589 | } |
| 590 | |
| 591 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 592 | bool ValidateEnumerator(VkMemoryHeapFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 593 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 594 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_HOST_LOCAL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 595 | if(enumerator & (~allFlags)) |
| 596 | { |
| 597 | return false; |
| 598 | } |
| 599 | |
| 600 | return true; |
| 601 | } |
| 602 | |
| 603 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 604 | std::string EnumeratorString(VkMemoryHeapFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 605 | { |
| 606 | if(!ValidateEnumerator(enumerator)) |
| 607 | { |
| 608 | return "unrecognized enumerator"; |
| 609 | } |
| 610 | |
| 611 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 612 | if(enumerator & VK_MEMORY_HEAP_HOST_LOCAL) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 613 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 614 | strings.push_back("VK_MEMORY_HEAP_HOST_LOCAL"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 615 | } |
| 616 | |
| 617 | std::string enumeratorString; |
| 618 | for(auto const& string : strings) |
| 619 | { |
| 620 | enumeratorString += string; |
| 621 | |
| 622 | if(string != strings.back()) |
| 623 | { |
| 624 | enumeratorString += '|'; |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | return enumeratorString; |
| 629 | } |
| 630 | |
| 631 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 632 | bool ValidateEnumerator(VkSparseImageFormatFlagBits const& enumerator) |
| 633 | { |
| 634 | VkSparseImageFormatFlagBits allFlags = (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT | |
| 635 | VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT | |
| 636 | VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT); |
| 637 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 638 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 639 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 640 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 641 | |
| 642 | return true; |
| 643 | } |
| 644 | |
| 645 | static |
| 646 | std::string EnumeratorString(VkSparseImageFormatFlagBits const& enumerator) |
| 647 | { |
| 648 | if(!ValidateEnumerator(enumerator)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 649 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 650 | return "unrecognized enumerator"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 651 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 652 | |
| 653 | std::vector<std::string> strings; |
| 654 | if(enumerator & VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 655 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 656 | strings.push_back("VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 657 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 658 | if(enumerator & VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 659 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 660 | strings.push_back("VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 661 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 662 | if(enumerator & VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 663 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 664 | strings.push_back("VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 665 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 666 | |
| 667 | std::string enumeratorString; |
| 668 | for(auto const& string : strings) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 669 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 670 | enumeratorString += string; |
| 671 | |
| 672 | if(string != strings.back()) |
| 673 | { |
| 674 | enumeratorString += '|'; |
| 675 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 676 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 677 | |
| 678 | return enumeratorString; |
| 679 | } |
| 680 | |
| 681 | static |
| 682 | bool ValidateEnumerator(VkSparseMemoryBindFlagBits const& enumerator) |
| 683 | { |
| 684 | VkSparseMemoryBindFlagBits allFlags = (VkSparseMemoryBindFlagBits)(VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT); |
| 685 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 686 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 687 | return false; |
| 688 | } |
| 689 | |
| 690 | return true; |
| 691 | } |
| 692 | |
| 693 | static |
| 694 | std::string EnumeratorString(VkSparseMemoryBindFlagBits const& enumerator) |
| 695 | { |
| 696 | if(!ValidateEnumerator(enumerator)) |
| 697 | { |
| 698 | return "unrecognized enumerator"; |
| 699 | } |
| 700 | |
| 701 | std::vector<std::string> strings; |
| 702 | if(enumerator & VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT) |
| 703 | { |
| 704 | strings.push_back("VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT"); |
| 705 | } |
| 706 | |
| 707 | std::string enumeratorString; |
| 708 | for(auto const& string : strings) |
| 709 | { |
| 710 | enumeratorString += string; |
| 711 | |
| 712 | if(string != strings.back()) |
| 713 | { |
| 714 | enumeratorString += '|'; |
| 715 | } |
| 716 | } |
| 717 | |
| 718 | return enumeratorString; |
| 719 | } |
| 720 | |
| 721 | static |
| 722 | bool ValidateEnumerator(VkFenceCreateFlagBits const& enumerator) |
| 723 | { |
| 724 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
| 725 | if(enumerator & (~allFlags)) |
| 726 | { |
| 727 | return false; |
| 728 | } |
| 729 | |
| 730 | return true; |
| 731 | } |
| 732 | |
| 733 | static |
| 734 | std::string EnumeratorString(VkFenceCreateFlagBits const& enumerator) |
| 735 | { |
| 736 | if(!ValidateEnumerator(enumerator)) |
| 737 | { |
| 738 | return "unrecognized enumerator"; |
| 739 | } |
| 740 | |
| 741 | std::vector<std::string> strings; |
| 742 | if(enumerator & VK_FENCE_CREATE_SIGNALED_BIT) |
| 743 | { |
| 744 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 745 | } |
| 746 | |
| 747 | std::string enumeratorString; |
| 748 | for(auto const& string : strings) |
| 749 | { |
| 750 | enumeratorString += string; |
| 751 | |
| 752 | if(string != strings.back()) |
| 753 | { |
| 754 | enumeratorString += '|'; |
| 755 | } |
| 756 | } |
| 757 | |
| 758 | return enumeratorString; |
| 759 | } |
| 760 | |
| 761 | static |
| 762 | bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 763 | { |
| 764 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)(VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT | |
| 765 | VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT | |
| 766 | VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT | |
| 767 | VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT | |
| 768 | VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT | |
| 769 | VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT | |
| 770 | VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT | |
| 771 | VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT | |
| 772 | VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT | |
| 773 | VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT | |
| 774 | VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT); |
| 775 | if(enumerator & (~allFlags)) |
| 776 | { |
| 777 | return false; |
| 778 | } |
| 779 | |
| 780 | return true; |
| 781 | } |
| 782 | |
| 783 | static |
| 784 | std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 785 | { |
| 786 | if(!ValidateEnumerator(enumerator)) |
| 787 | { |
| 788 | return "unrecognized enumerator"; |
| 789 | } |
| 790 | |
| 791 | std::vector<std::string> strings; |
| 792 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT) |
| 793 | { |
| 794 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT"); |
| 795 | } |
| 796 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT) |
| 797 | { |
| 798 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT"); |
| 799 | } |
| 800 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT) |
| 801 | { |
| 802 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT"); |
| 803 | } |
| 804 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT) |
| 805 | { |
| 806 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT"); |
| 807 | } |
| 808 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT) |
| 809 | { |
| 810 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT"); |
| 811 | } |
| 812 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT) |
| 813 | { |
| 814 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT"); |
| 815 | } |
| 816 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT) |
| 817 | { |
| 818 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT"); |
| 819 | } |
| 820 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT) |
| 821 | { |
| 822 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT"); |
| 823 | } |
| 824 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT) |
| 825 | { |
| 826 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT"); |
| 827 | } |
| 828 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT) |
| 829 | { |
| 830 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT"); |
| 831 | } |
| 832 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT) |
| 833 | { |
| 834 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT"); |
| 835 | } |
| 836 | |
| 837 | std::string enumeratorString; |
| 838 | for(auto const& string : strings) |
| 839 | { |
| 840 | enumeratorString += string; |
| 841 | |
| 842 | if(string != strings.back()) |
| 843 | { |
| 844 | enumeratorString += '|'; |
| 845 | } |
| 846 | } |
| 847 | |
| 848 | return enumeratorString; |
| 849 | } |
| 850 | |
| 851 | static |
| 852 | bool ValidateEnumerator(VkQueryResultFlagBits const& enumerator) |
| 853 | { |
| 854 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | |
| 855 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 856 | VK_QUERY_RESULT_WAIT_BIT | |
| 857 | VK_QUERY_RESULT_64_BIT | |
| 858 | VK_QUERY_RESULT_DEFAULT); |
| 859 | if(enumerator & (~allFlags)) |
| 860 | { |
| 861 | return false; |
| 862 | } |
| 863 | |
| 864 | return true; |
| 865 | } |
| 866 | |
| 867 | static |
| 868 | std::string EnumeratorString(VkQueryResultFlagBits const& enumerator) |
| 869 | { |
| 870 | if(!ValidateEnumerator(enumerator)) |
| 871 | { |
| 872 | return "unrecognized enumerator"; |
| 873 | } |
| 874 | |
| 875 | std::vector<std::string> strings; |
| 876 | if(enumerator & VK_QUERY_RESULT_PARTIAL_BIT) |
| 877 | { |
| 878 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 879 | } |
| 880 | if(enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) |
| 881 | { |
| 882 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 883 | } |
| 884 | if(enumerator & VK_QUERY_RESULT_WAIT_BIT) |
| 885 | { |
| 886 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 887 | } |
| 888 | if(enumerator & VK_QUERY_RESULT_64_BIT) |
| 889 | { |
| 890 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 891 | } |
| 892 | if(enumerator & VK_QUERY_RESULT_DEFAULT) |
| 893 | { |
| 894 | strings.push_back("VK_QUERY_RESULT_DEFAULT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 895 | } |
| 896 | |
| 897 | std::string enumeratorString; |
| 898 | for(auto const& string : strings) |
| 899 | { |
| 900 | enumeratorString += string; |
| 901 | |
| 902 | if(string != strings.back()) |
| 903 | { |
| 904 | enumeratorString += '|'; |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | return enumeratorString; |
| 909 | } |
| 910 | |
| 911 | static |
| 912 | bool ValidateEnumerator(VkBufferUsageFlagBits const& enumerator) |
| 913 | { |
| 914 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | |
| 915 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | |
| 916 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 917 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | |
| 918 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | |
| 919 | VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT | |
| 920 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | |
| 921 | VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT | |
Cody Northrop | 84fa790 | 2015-08-25 15:39:48 -0600 | [diff] [blame] | 922 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 923 | if(enumerator & (~allFlags)) |
| 924 | { |
| 925 | return false; |
| 926 | } |
| 927 | |
| 928 | return true; |
| 929 | } |
| 930 | |
| 931 | static |
| 932 | std::string EnumeratorString(VkBufferUsageFlagBits const& enumerator) |
| 933 | { |
| 934 | if(!ValidateEnumerator(enumerator)) |
| 935 | { |
| 936 | return "unrecognized enumerator"; |
| 937 | } |
| 938 | |
| 939 | std::vector<std::string> strings; |
| 940 | if(enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) |
| 941 | { |
| 942 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 943 | } |
| 944 | if(enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) |
| 945 | { |
| 946 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 947 | } |
| 948 | if(enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) |
| 949 | { |
| 950 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 951 | } |
| 952 | if(enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) |
| 953 | { |
| 954 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 955 | } |
| 956 | if(enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) |
| 957 | { |
| 958 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 959 | } |
| 960 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT) |
| 961 | { |
| 962 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT"); |
| 963 | } |
| 964 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) |
| 965 | { |
| 966 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 967 | } |
| 968 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT) |
| 969 | { |
| 970 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT"); |
| 971 | } |
| 972 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) |
| 973 | { |
| 974 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 975 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 976 | |
| 977 | std::string enumeratorString; |
| 978 | for(auto const& string : strings) |
| 979 | { |
| 980 | enumeratorString += string; |
| 981 | |
| 982 | if(string != strings.back()) |
| 983 | { |
| 984 | enumeratorString += '|'; |
| 985 | } |
| 986 | } |
| 987 | |
| 988 | return enumeratorString; |
| 989 | } |
| 990 | |
| 991 | static |
| 992 | bool ValidateEnumerator(VkBufferCreateFlagBits const& enumerator) |
| 993 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 994 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)(VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | |
| 995 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 996 | VK_BUFFER_CREATE_SPARSE_BINDING_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 997 | if(enumerator & (~allFlags)) |
| 998 | { |
| 999 | return false; |
| 1000 | } |
| 1001 | |
| 1002 | return true; |
| 1003 | } |
| 1004 | |
| 1005 | static |
| 1006 | std::string EnumeratorString(VkBufferCreateFlagBits const& enumerator) |
| 1007 | { |
| 1008 | if(!ValidateEnumerator(enumerator)) |
| 1009 | { |
| 1010 | return "unrecognized enumerator"; |
| 1011 | } |
| 1012 | |
| 1013 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1014 | if(enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) |
| 1015 | { |
| 1016 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 1017 | } |
| 1018 | if(enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) |
| 1019 | { |
| 1020 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 1021 | } |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1022 | if(enumerator & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1023 | { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1024 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1025 | } |
| 1026 | |
| 1027 | std::string enumeratorString; |
| 1028 | for(auto const& string : strings) |
| 1029 | { |
| 1030 | enumeratorString += string; |
| 1031 | |
| 1032 | if(string != strings.back()) |
| 1033 | { |
| 1034 | enumeratorString += '|'; |
| 1035 | } |
| 1036 | } |
| 1037 | |
| 1038 | return enumeratorString; |
| 1039 | } |
| 1040 | |
| 1041 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1042 | bool ValidateEnumerator(VkImageCreateFlagBits const& enumerator) |
| 1043 | { |
| 1044 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)(VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1045 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | |
| 1046 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1047 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1048 | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1049 | if(enumerator & (~allFlags)) |
| 1050 | { |
| 1051 | return false; |
| 1052 | } |
| 1053 | |
| 1054 | return true; |
| 1055 | } |
| 1056 | |
| 1057 | static |
| 1058 | std::string EnumeratorString(VkImageCreateFlagBits const& enumerator) |
| 1059 | { |
| 1060 | if(!ValidateEnumerator(enumerator)) |
| 1061 | { |
| 1062 | return "unrecognized enumerator"; |
| 1063 | } |
| 1064 | |
| 1065 | std::vector<std::string> strings; |
| 1066 | if(enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) |
| 1067 | { |
| 1068 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 1069 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1070 | if(enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) |
| 1071 | { |
| 1072 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 1073 | } |
| 1074 | if(enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) |
| 1075 | { |
| 1076 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 1077 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1078 | if(enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) |
| 1079 | { |
| 1080 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 1081 | } |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1082 | if(enumerator & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1083 | { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1084 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1085 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1086 | |
| 1087 | std::string enumeratorString; |
| 1088 | for(auto const& string : strings) |
| 1089 | { |
| 1090 | enumeratorString += string; |
| 1091 | |
| 1092 | if(string != strings.back()) |
| 1093 | { |
| 1094 | enumeratorString += '|'; |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | return enumeratorString; |
| 1099 | } |
| 1100 | |
| 1101 | static |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1102 | bool ValidateEnumerator(VkImageViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1103 | { |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1104 | VkImageViewCreateFlagBits allFlags = (VkImageViewCreateFlagBits)(VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT | |
| 1105 | VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1106 | if(enumerator & (~allFlags)) |
| 1107 | { |
| 1108 | return false; |
| 1109 | } |
| 1110 | |
| 1111 | return true; |
| 1112 | } |
| 1113 | |
| 1114 | static |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1115 | std::string EnumeratorString(VkImageViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1116 | { |
| 1117 | if(!ValidateEnumerator(enumerator)) |
| 1118 | { |
| 1119 | return "unrecognized enumerator"; |
| 1120 | } |
| 1121 | |
| 1122 | std::vector<std::string> strings; |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1123 | if(enumerator & VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1124 | { |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1125 | strings.push_back("VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1126 | } |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1127 | if(enumerator & VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1128 | { |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1129 | strings.push_back("VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1130 | } |
| 1131 | |
| 1132 | std::string enumeratorString; |
| 1133 | for(auto const& string : strings) |
| 1134 | { |
| 1135 | enumeratorString += string; |
| 1136 | |
| 1137 | if(string != strings.back()) |
| 1138 | { |
| 1139 | enumeratorString += '|'; |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | return enumeratorString; |
| 1144 | } |
| 1145 | |
| 1146 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1147 | bool ValidateEnumerator(VkChannelFlagBits const& enumerator) |
| 1148 | { |
| 1149 | VkChannelFlagBits allFlags = (VkChannelFlagBits)(VK_CHANNEL_A_BIT | |
| 1150 | VK_CHANNEL_B_BIT | |
| 1151 | VK_CHANNEL_G_BIT | |
| 1152 | VK_CHANNEL_R_BIT); |
| 1153 | if(enumerator & (~allFlags)) |
| 1154 | { |
| 1155 | return false; |
| 1156 | } |
| 1157 | |
| 1158 | return true; |
| 1159 | } |
| 1160 | |
| 1161 | static |
| 1162 | std::string EnumeratorString(VkChannelFlagBits const& enumerator) |
| 1163 | { |
| 1164 | if(!ValidateEnumerator(enumerator)) |
| 1165 | { |
| 1166 | return "unrecognized enumerator"; |
| 1167 | } |
| 1168 | |
| 1169 | std::vector<std::string> strings; |
| 1170 | if(enumerator & VK_CHANNEL_A_BIT) |
| 1171 | { |
| 1172 | strings.push_back("VK_CHANNEL_A_BIT"); |
| 1173 | } |
| 1174 | if(enumerator & VK_CHANNEL_B_BIT) |
| 1175 | { |
| 1176 | strings.push_back("VK_CHANNEL_B_BIT"); |
| 1177 | } |
| 1178 | if(enumerator & VK_CHANNEL_G_BIT) |
| 1179 | { |
| 1180 | strings.push_back("VK_CHANNEL_G_BIT"); |
| 1181 | } |
| 1182 | if(enumerator & VK_CHANNEL_R_BIT) |
| 1183 | { |
| 1184 | strings.push_back("VK_CHANNEL_R_BIT"); |
| 1185 | } |
| 1186 | |
| 1187 | std::string enumeratorString; |
| 1188 | for(auto const& string : strings) |
| 1189 | { |
| 1190 | enumeratorString += string; |
| 1191 | |
| 1192 | if(string != strings.back()) |
| 1193 | { |
| 1194 | enumeratorString += '|'; |
| 1195 | } |
| 1196 | } |
| 1197 | |
| 1198 | return enumeratorString; |
| 1199 | } |
| 1200 | |
| 1201 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1202 | bool ValidateEnumerator(VkPipelineCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1203 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1204 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)(VK_PIPELINE_CREATE_DERIVATIVE_BIT | |
| 1205 | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | |
| 1206 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1207 | if(enumerator & (~allFlags)) |
| 1208 | { |
| 1209 | return false; |
| 1210 | } |
| 1211 | |
| 1212 | return true; |
| 1213 | } |
| 1214 | |
| 1215 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1216 | std::string EnumeratorString(VkPipelineCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1217 | { |
| 1218 | if(!ValidateEnumerator(enumerator)) |
| 1219 | { |
| 1220 | return "unrecognized enumerator"; |
| 1221 | } |
| 1222 | |
| 1223 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1224 | if(enumerator & VK_PIPELINE_CREATE_DERIVATIVE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1225 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1226 | strings.push_back("VK_PIPELINE_CREATE_DERIVATIVE_BIT"); |
| 1227 | } |
| 1228 | if(enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) |
| 1229 | { |
| 1230 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 1231 | } |
| 1232 | if(enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) |
| 1233 | { |
| 1234 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1235 | } |
| 1236 | |
| 1237 | std::string enumeratorString; |
| 1238 | for(auto const& string : strings) |
| 1239 | { |
| 1240 | enumeratorString += string; |
| 1241 | |
| 1242 | if(string != strings.back()) |
| 1243 | { |
| 1244 | enumeratorString += '|'; |
| 1245 | } |
| 1246 | } |
| 1247 | |
| 1248 | return enumeratorString; |
| 1249 | } |
| 1250 | |
| 1251 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1252 | bool ValidateEnumerator(VkShaderStageFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1253 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1254 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)(VK_SHADER_STAGE_ALL | |
| 1255 | VK_SHADER_STAGE_FRAGMENT_BIT | |
| 1256 | VK_SHADER_STAGE_GEOMETRY_BIT | |
| 1257 | VK_SHADER_STAGE_COMPUTE_BIT | |
| 1258 | VK_SHADER_STAGE_TESS_EVALUATION_BIT | |
| 1259 | VK_SHADER_STAGE_TESS_CONTROL_BIT | |
| 1260 | VK_SHADER_STAGE_VERTEX_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1261 | if(enumerator & (~allFlags)) |
| 1262 | { |
| 1263 | return false; |
| 1264 | } |
| 1265 | |
| 1266 | return true; |
| 1267 | } |
| 1268 | |
| 1269 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1270 | std::string EnumeratorString(VkShaderStageFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1271 | { |
| 1272 | if(!ValidateEnumerator(enumerator)) |
| 1273 | { |
| 1274 | return "unrecognized enumerator"; |
| 1275 | } |
| 1276 | |
| 1277 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1278 | if(enumerator & VK_SHADER_STAGE_ALL) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1279 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1280 | strings.push_back("VK_SHADER_STAGE_ALL"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1281 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1282 | if(enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1283 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1284 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1285 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1286 | if(enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1287 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1288 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 1289 | } |
| 1290 | if(enumerator & VK_SHADER_STAGE_COMPUTE_BIT) |
| 1291 | { |
| 1292 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 1293 | } |
| 1294 | if(enumerator & VK_SHADER_STAGE_TESS_EVALUATION_BIT) |
| 1295 | { |
| 1296 | strings.push_back("VK_SHADER_STAGE_TESS_EVALUATION_BIT"); |
| 1297 | } |
| 1298 | if(enumerator & VK_SHADER_STAGE_TESS_CONTROL_BIT) |
| 1299 | { |
| 1300 | strings.push_back("VK_SHADER_STAGE_TESS_CONTROL_BIT"); |
| 1301 | } |
| 1302 | if(enumerator & VK_SHADER_STAGE_VERTEX_BIT) |
| 1303 | { |
| 1304 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1305 | } |
| 1306 | |
| 1307 | std::string enumeratorString; |
| 1308 | for(auto const& string : strings) |
| 1309 | { |
| 1310 | enumeratorString += string; |
| 1311 | |
| 1312 | if(string != strings.back()) |
| 1313 | { |
| 1314 | enumeratorString += '|'; |
| 1315 | } |
| 1316 | } |
| 1317 | |
| 1318 | return enumeratorString; |
| 1319 | } |
| 1320 | |
| 1321 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1322 | bool ValidateEnumerator(VkSubpassDescriptionFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1323 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1324 | VkSubpassDescriptionFlagBits allFlags = (VkSubpassDescriptionFlagBits)(VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1325 | if(enumerator & (~allFlags)) |
| 1326 | { |
| 1327 | return false; |
| 1328 | } |
| 1329 | |
| 1330 | return true; |
| 1331 | } |
| 1332 | |
| 1333 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1334 | std::string EnumeratorString(VkSubpassDescriptionFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1335 | { |
| 1336 | if(!ValidateEnumerator(enumerator)) |
| 1337 | { |
| 1338 | return "unrecognized enumerator"; |
| 1339 | } |
| 1340 | |
| 1341 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1342 | if(enumerator & VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1343 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1344 | strings.push_back("VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1345 | } |
| 1346 | |
| 1347 | std::string enumeratorString; |
| 1348 | for(auto const& string : strings) |
| 1349 | { |
| 1350 | enumeratorString += string; |
| 1351 | |
| 1352 | if(string != strings.back()) |
| 1353 | { |
| 1354 | enumeratorString += '|'; |
| 1355 | } |
| 1356 | } |
| 1357 | |
| 1358 | return enumeratorString; |
| 1359 | } |
| 1360 | |
| 1361 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1362 | bool ValidateEnumerator(VkPipelineStageFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1363 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1364 | VkPipelineStageFlagBits allFlags = (VkPipelineStageFlagBits)(VK_PIPELINE_STAGE_ALL_GRAPHICS | |
| 1365 | VK_PIPELINE_STAGE_HOST_BIT | |
| 1366 | VK_PIPELINE_STAGE_TRANSFER_BIT | |
| 1367 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | |
| 1368 | VK_PIPELINE_STAGE_ALL_GPU_COMMANDS | |
| 1369 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT | |
| 1370 | VK_PIPELINE_STAGE_TRANSITION_BIT | |
| 1371 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | |
| 1372 | VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT | |
| 1373 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | |
| 1374 | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT | |
| 1375 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | |
| 1376 | VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT | |
| 1377 | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | |
| 1378 | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | |
| 1379 | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | |
| 1380 | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1381 | if(enumerator & (~allFlags)) |
| 1382 | { |
| 1383 | return false; |
| 1384 | } |
| 1385 | |
| 1386 | return true; |
| 1387 | } |
| 1388 | |
| 1389 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1390 | std::string EnumeratorString(VkPipelineStageFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1391 | { |
| 1392 | if(!ValidateEnumerator(enumerator)) |
| 1393 | { |
| 1394 | return "unrecognized enumerator"; |
| 1395 | } |
| 1396 | |
| 1397 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1398 | if(enumerator & VK_PIPELINE_STAGE_ALL_GRAPHICS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1399 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1400 | strings.push_back("VK_PIPELINE_STAGE_ALL_GRAPHICS"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1401 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1402 | if(enumerator & VK_PIPELINE_STAGE_HOST_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1403 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1404 | strings.push_back("VK_PIPELINE_STAGE_HOST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1405 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1406 | if(enumerator & VK_PIPELINE_STAGE_TRANSFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1407 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1408 | strings.push_back("VK_PIPELINE_STAGE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1409 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1410 | if(enumerator & VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1411 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1412 | strings.push_back("VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1413 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1414 | if(enumerator & VK_PIPELINE_STAGE_ALL_GPU_COMMANDS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1415 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1416 | strings.push_back("VK_PIPELINE_STAGE_ALL_GPU_COMMANDS"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1417 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1418 | if(enumerator & VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1419 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1420 | strings.push_back("VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1421 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1422 | if(enumerator & VK_PIPELINE_STAGE_TRANSITION_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1423 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1424 | strings.push_back("VK_PIPELINE_STAGE_TRANSITION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1425 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1426 | if(enumerator & VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1427 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1428 | strings.push_back("VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1429 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1430 | if(enumerator & VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1431 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1432 | strings.push_back("VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1433 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1434 | if(enumerator & VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1435 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1436 | strings.push_back("VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1437 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1438 | if(enumerator & VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1439 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1440 | strings.push_back("VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT"); |
| 1441 | } |
| 1442 | if(enumerator & VK_PIPELINE_STAGE_VERTEX_SHADER_BIT) |
| 1443 | { |
| 1444 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_SHADER_BIT"); |
| 1445 | } |
| 1446 | if(enumerator & VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT) |
| 1447 | { |
| 1448 | strings.push_back("VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT"); |
| 1449 | } |
| 1450 | if(enumerator & VK_PIPELINE_STAGE_VERTEX_INPUT_BIT) |
| 1451 | { |
| 1452 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_INPUT_BIT"); |
| 1453 | } |
| 1454 | if(enumerator & VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT) |
| 1455 | { |
| 1456 | strings.push_back("VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT"); |
| 1457 | } |
| 1458 | if(enumerator & VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT) |
| 1459 | { |
| 1460 | strings.push_back("VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT"); |
| 1461 | } |
| 1462 | if(enumerator & VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) |
| 1463 | { |
| 1464 | strings.push_back("VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1465 | } |
| 1466 | |
| 1467 | std::string enumeratorString; |
| 1468 | for(auto const& string : strings) |
| 1469 | { |
| 1470 | enumeratorString += string; |
| 1471 | |
| 1472 | if(string != strings.back()) |
| 1473 | { |
| 1474 | enumeratorString += '|'; |
| 1475 | } |
| 1476 | } |
| 1477 | |
| 1478 | return enumeratorString; |
| 1479 | } |
| 1480 | |
| 1481 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1482 | bool ValidateEnumerator(VkMemoryOutputFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1483 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1484 | VkMemoryOutputFlagBits allFlags = (VkMemoryOutputFlagBits)(VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 1485 | VK_MEMORY_OUTPUT_TRANSFER_BIT | |
| 1486 | VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT | |
| 1487 | VK_MEMORY_OUTPUT_SHADER_WRITE_BIT | |
| 1488 | VK_MEMORY_OUTPUT_HOST_WRITE_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1489 | if(enumerator & (~allFlags)) |
| 1490 | { |
| 1491 | return false; |
| 1492 | } |
| 1493 | |
| 1494 | return true; |
| 1495 | } |
| 1496 | |
| 1497 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1498 | std::string EnumeratorString(VkMemoryOutputFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1499 | { |
| 1500 | if(!ValidateEnumerator(enumerator)) |
| 1501 | { |
| 1502 | return "unrecognized enumerator"; |
| 1503 | } |
| 1504 | |
| 1505 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1506 | if(enumerator & VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1507 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1508 | strings.push_back("VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1509 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1510 | if(enumerator & VK_MEMORY_OUTPUT_TRANSFER_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1511 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1512 | strings.push_back("VK_MEMORY_OUTPUT_TRANSFER_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1513 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1514 | if(enumerator & VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1515 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1516 | strings.push_back("VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT"); |
| 1517 | } |
| 1518 | if(enumerator & VK_MEMORY_OUTPUT_SHADER_WRITE_BIT) |
| 1519 | { |
| 1520 | strings.push_back("VK_MEMORY_OUTPUT_SHADER_WRITE_BIT"); |
| 1521 | } |
| 1522 | if(enumerator & VK_MEMORY_OUTPUT_HOST_WRITE_BIT) |
| 1523 | { |
| 1524 | strings.push_back("VK_MEMORY_OUTPUT_HOST_WRITE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1525 | } |
| 1526 | |
| 1527 | std::string enumeratorString; |
| 1528 | for(auto const& string : strings) |
| 1529 | { |
| 1530 | enumeratorString += string; |
| 1531 | |
| 1532 | if(string != strings.back()) |
| 1533 | { |
| 1534 | enumeratorString += '|'; |
| 1535 | } |
| 1536 | } |
| 1537 | |
| 1538 | return enumeratorString; |
| 1539 | } |
| 1540 | |
| 1541 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1542 | bool ValidateEnumerator(VkMemoryInputFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1543 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1544 | VkMemoryInputFlagBits allFlags = (VkMemoryInputFlagBits)(VK_MEMORY_INPUT_TRANSFER_BIT | |
| 1545 | VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 1546 | VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT | |
| 1547 | VK_MEMORY_INPUT_SHADER_READ_BIT | |
| 1548 | VK_MEMORY_INPUT_UNIFORM_READ_BIT | |
| 1549 | VK_MEMORY_INPUT_INDEX_FETCH_BIT | |
| 1550 | VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT | |
| 1551 | VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT | |
| 1552 | VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT | |
| 1553 | VK_MEMORY_INPUT_HOST_READ_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1554 | if(enumerator & (~allFlags)) |
| 1555 | { |
| 1556 | return false; |
| 1557 | } |
| 1558 | |
| 1559 | return true; |
| 1560 | } |
| 1561 | |
| 1562 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1563 | std::string EnumeratorString(VkMemoryInputFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1564 | { |
| 1565 | if(!ValidateEnumerator(enumerator)) |
| 1566 | { |
| 1567 | return "unrecognized enumerator"; |
| 1568 | } |
| 1569 | |
| 1570 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1571 | if(enumerator & VK_MEMORY_INPUT_TRANSFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1572 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1573 | strings.push_back("VK_MEMORY_INPUT_TRANSFER_BIT"); |
| 1574 | } |
| 1575 | if(enumerator & VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 1576 | { |
| 1577 | strings.push_back("VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 1578 | } |
| 1579 | if(enumerator & VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT) |
| 1580 | { |
| 1581 | strings.push_back("VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT"); |
| 1582 | } |
| 1583 | if(enumerator & VK_MEMORY_INPUT_SHADER_READ_BIT) |
| 1584 | { |
| 1585 | strings.push_back("VK_MEMORY_INPUT_SHADER_READ_BIT"); |
| 1586 | } |
| 1587 | if(enumerator & VK_MEMORY_INPUT_UNIFORM_READ_BIT) |
| 1588 | { |
| 1589 | strings.push_back("VK_MEMORY_INPUT_UNIFORM_READ_BIT"); |
| 1590 | } |
| 1591 | if(enumerator & VK_MEMORY_INPUT_INDEX_FETCH_BIT) |
| 1592 | { |
| 1593 | strings.push_back("VK_MEMORY_INPUT_INDEX_FETCH_BIT"); |
| 1594 | } |
| 1595 | if(enumerator & VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT) |
| 1596 | { |
| 1597 | strings.push_back("VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT"); |
| 1598 | } |
| 1599 | if(enumerator & VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT) |
| 1600 | { |
| 1601 | strings.push_back("VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT"); |
| 1602 | } |
| 1603 | if(enumerator & VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT) |
| 1604 | { |
| 1605 | strings.push_back("VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT"); |
| 1606 | } |
| 1607 | if(enumerator & VK_MEMORY_INPUT_HOST_READ_BIT) |
| 1608 | { |
| 1609 | strings.push_back("VK_MEMORY_INPUT_HOST_READ_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1610 | } |
| 1611 | |
| 1612 | std::string enumeratorString; |
| 1613 | for(auto const& string : strings) |
| 1614 | { |
| 1615 | enumeratorString += string; |
| 1616 | |
| 1617 | if(string != strings.back()) |
| 1618 | { |
| 1619 | enumeratorString += '|'; |
| 1620 | } |
| 1621 | } |
| 1622 | |
| 1623 | return enumeratorString; |
| 1624 | } |
| 1625 | |
| 1626 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1627 | bool ValidateEnumerator(VkCmdPoolCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1628 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1629 | VkCmdPoolCreateFlagBits allFlags = (VkCmdPoolCreateFlagBits)(VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | |
| 1630 | VK_CMD_POOL_CREATE_TRANSIENT_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1631 | if(enumerator & (~allFlags)) |
| 1632 | { |
| 1633 | return false; |
| 1634 | } |
| 1635 | |
| 1636 | return true; |
| 1637 | } |
| 1638 | |
| 1639 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1640 | std::string EnumeratorString(VkCmdPoolCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1641 | { |
| 1642 | if(!ValidateEnumerator(enumerator)) |
| 1643 | { |
| 1644 | return "unrecognized enumerator"; |
| 1645 | } |
| 1646 | |
| 1647 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1648 | if(enumerator & VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1649 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1650 | strings.push_back("VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1651 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1652 | if(enumerator & VK_CMD_POOL_CREATE_TRANSIENT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1653 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1654 | strings.push_back("VK_CMD_POOL_CREATE_TRANSIENT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1655 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1656 | |
| 1657 | std::string enumeratorString; |
| 1658 | for(auto const& string : strings) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1659 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1660 | enumeratorString += string; |
| 1661 | |
| 1662 | if(string != strings.back()) |
| 1663 | { |
| 1664 | enumeratorString += '|'; |
| 1665 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1666 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1667 | |
| 1668 | return enumeratorString; |
| 1669 | } |
| 1670 | |
| 1671 | static |
| 1672 | bool ValidateEnumerator(VkCmdPoolResetFlagBits const& enumerator) |
| 1673 | { |
| 1674 | VkCmdPoolResetFlagBits allFlags = (VkCmdPoolResetFlagBits)(VK_CMD_POOL_RESET_RELEASE_RESOURCES); |
| 1675 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1676 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1677 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1678 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1679 | |
| 1680 | return true; |
| 1681 | } |
| 1682 | |
| 1683 | static |
| 1684 | std::string EnumeratorString(VkCmdPoolResetFlagBits const& enumerator) |
| 1685 | { |
| 1686 | if(!ValidateEnumerator(enumerator)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1687 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1688 | return "unrecognized enumerator"; |
| 1689 | } |
| 1690 | |
| 1691 | std::vector<std::string> strings; |
| 1692 | if(enumerator & VK_CMD_POOL_RESET_RELEASE_RESOURCES) |
| 1693 | { |
| 1694 | strings.push_back("VK_CMD_POOL_RESET_RELEASE_RESOURCES"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1695 | } |
| 1696 | |
| 1697 | std::string enumeratorString; |
| 1698 | for(auto const& string : strings) |
| 1699 | { |
| 1700 | enumeratorString += string; |
| 1701 | |
| 1702 | if(string != strings.back()) |
| 1703 | { |
| 1704 | enumeratorString += '|'; |
| 1705 | } |
| 1706 | } |
| 1707 | |
| 1708 | return enumeratorString; |
| 1709 | } |
| 1710 | |
| 1711 | static |
| 1712 | bool ValidateEnumerator(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1713 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1714 | VkCmdBufferOptimizeFlagBits allFlags = (VkCmdBufferOptimizeFlagBits)(VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT | |
| 1715 | VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1716 | VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT | |
| 1717 | VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT | |
| 1718 | VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT); |
| 1719 | if(enumerator & (~allFlags)) |
| 1720 | { |
| 1721 | return false; |
| 1722 | } |
| 1723 | |
| 1724 | return true; |
| 1725 | } |
| 1726 | |
| 1727 | static |
| 1728 | std::string EnumeratorString(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1729 | { |
| 1730 | if(!ValidateEnumerator(enumerator)) |
| 1731 | { |
| 1732 | return "unrecognized enumerator"; |
| 1733 | } |
| 1734 | |
| 1735 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1736 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT) |
| 1737 | { |
| 1738 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT"); |
| 1739 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1740 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT) |
| 1741 | { |
| 1742 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT"); |
| 1743 | } |
| 1744 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT) |
| 1745 | { |
| 1746 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT"); |
| 1747 | } |
| 1748 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT) |
| 1749 | { |
| 1750 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT"); |
| 1751 | } |
| 1752 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT) |
| 1753 | { |
| 1754 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT"); |
| 1755 | } |
| 1756 | |
| 1757 | std::string enumeratorString; |
| 1758 | for(auto const& string : strings) |
| 1759 | { |
| 1760 | enumeratorString += string; |
| 1761 | |
| 1762 | if(string != strings.back()) |
| 1763 | { |
| 1764 | enumeratorString += '|'; |
| 1765 | } |
| 1766 | } |
| 1767 | |
| 1768 | return enumeratorString; |
| 1769 | } |
| 1770 | |
| 1771 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1772 | bool ValidateEnumerator(VkCmdBufferResetFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1773 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1774 | VkCmdBufferResetFlagBits allFlags = (VkCmdBufferResetFlagBits)(VK_CMD_BUFFER_RESET_RELEASE_RESOURCES); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1775 | if(enumerator & (~allFlags)) |
| 1776 | { |
| 1777 | return false; |
| 1778 | } |
| 1779 | |
| 1780 | return true; |
| 1781 | } |
| 1782 | |
| 1783 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1784 | std::string EnumeratorString(VkCmdBufferResetFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1785 | { |
| 1786 | if(!ValidateEnumerator(enumerator)) |
| 1787 | { |
| 1788 | return "unrecognized enumerator"; |
| 1789 | } |
| 1790 | |
| 1791 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1792 | if(enumerator & VK_CMD_BUFFER_RESET_RELEASE_RESOURCES) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1793 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1794 | strings.push_back("VK_CMD_BUFFER_RESET_RELEASE_RESOURCES"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1795 | } |
| 1796 | |
| 1797 | std::string enumeratorString; |
| 1798 | for(auto const& string : strings) |
| 1799 | { |
| 1800 | enumeratorString += string; |
| 1801 | |
| 1802 | if(string != strings.back()) |
| 1803 | { |
| 1804 | enumeratorString += '|'; |
| 1805 | } |
| 1806 | } |
| 1807 | |
| 1808 | return enumeratorString; |
| 1809 | } |
| 1810 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1811 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1812 | bool ValidateEnumerator(VkImageAspectFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1813 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1814 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_METADATA_BIT | |
| 1815 | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1816 | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 1817 | VK_IMAGE_ASPECT_COLOR_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1818 | if(enumerator & (~allFlags)) |
| 1819 | { |
| 1820 | return false; |
| 1821 | } |
| 1822 | |
| 1823 | return true; |
| 1824 | } |
| 1825 | |
| 1826 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1827 | std::string EnumeratorString(VkImageAspectFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1828 | { |
| 1829 | if(!ValidateEnumerator(enumerator)) |
| 1830 | { |
| 1831 | return "unrecognized enumerator"; |
| 1832 | } |
| 1833 | |
| 1834 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1835 | if(enumerator & VK_IMAGE_ASPECT_METADATA_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1836 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1837 | strings.push_back("VK_IMAGE_ASPECT_METADATA_BIT"); |
| 1838 | } |
| 1839 | if(enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) |
| 1840 | { |
| 1841 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1842 | } |
| 1843 | if(enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) |
| 1844 | { |
| 1845 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1846 | } |
| 1847 | if(enumerator & VK_IMAGE_ASPECT_COLOR_BIT) |
| 1848 | { |
| 1849 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1850 | } |
| 1851 | |
| 1852 | std::string enumeratorString; |
| 1853 | for(auto const& string : strings) |
| 1854 | { |
| 1855 | enumeratorString += string; |
| 1856 | |
| 1857 | if(string != strings.back()) |
| 1858 | { |
| 1859 | enumeratorString += '|'; |
| 1860 | } |
| 1861 | } |
| 1862 | |
| 1863 | return enumeratorString; |
| 1864 | } |
| 1865 | |
| 1866 | static |
| 1867 | bool ValidateEnumerator(VkQueryControlFlagBits const& enumerator) |
| 1868 | { |
| 1869 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_CONSERVATIVE_BIT); |
| 1870 | if(enumerator & (~allFlags)) |
| 1871 | { |
| 1872 | return false; |
| 1873 | } |
| 1874 | |
| 1875 | return true; |
| 1876 | } |
| 1877 | |
| 1878 | static |
| 1879 | std::string EnumeratorString(VkQueryControlFlagBits const& enumerator) |
| 1880 | { |
| 1881 | if(!ValidateEnumerator(enumerator)) |
| 1882 | { |
| 1883 | return "unrecognized enumerator"; |
| 1884 | } |
| 1885 | |
| 1886 | std::vector<std::string> strings; |
| 1887 | if(enumerator & VK_QUERY_CONTROL_CONSERVATIVE_BIT) |
| 1888 | { |
| 1889 | strings.push_back("VK_QUERY_CONTROL_CONSERVATIVE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1890 | } |
| 1891 | |
| 1892 | std::string enumeratorString; |
| 1893 | for(auto const& string : strings) |
| 1894 | { |
| 1895 | enumeratorString += string; |
| 1896 | |
| 1897 | if(string != strings.back()) |
| 1898 | { |
| 1899 | enumeratorString += '|'; |
| 1900 | } |
| 1901 | } |
| 1902 | |
| 1903 | return enumeratorString; |
| 1904 | } |
| 1905 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1906 | VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance( |
| 1907 | const VkInstanceCreateInfo* pCreateInfo, |
| 1908 | VkInstance* pInstance) |
| 1909 | { |
| 1910 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, *pInstance); |
| 1911 | VkResult result = pTable->CreateInstance(pCreateInfo, pInstance); |
| 1912 | |
| 1913 | if (result == VK_SUCCESS) { |
| 1914 | layer_data *data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); |
| 1915 | data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->extensionCount, |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 1916 | pCreateInfo->ppEnabledExtensionNames); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1917 | |
| 1918 | InitParamChecker(data); |
| 1919 | } |
| 1920 | |
| 1921 | return result; |
| 1922 | } |
| 1923 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 1924 | VK_LAYER_EXPORT void VKAPI vkDestroyInstance( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1925 | VkInstance instance) |
| 1926 | { |
| 1927 | // Grab the key before the instance is destroyed. |
| 1928 | dispatch_key key = get_dispatch_key(instance); |
| 1929 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 1930 | pTable->DestroyInstance(instance); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1931 | |
| 1932 | // Clean up logging callback, if any |
| 1933 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 1934 | if(data->logging_callback) |
| 1935 | { |
| 1936 | layer_destroy_msg_callback(data->report_data, data->logging_callback); |
| 1937 | } |
| 1938 | |
| 1939 | layer_debug_report_destroy_instance(mid(instance)); |
| 1940 | layer_data_map.erase(pTable); |
| 1941 | |
| 1942 | pc_instance_table_map.erase(key); |
| 1943 | assert(pc_instance_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1944 | } |
| 1945 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1946 | bool PostEnumeratePhysicalDevices( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1947 | VkInstance instance, |
| 1948 | uint32_t* pPhysicalDeviceCount, |
| 1949 | VkPhysicalDevice* pPhysicalDevices, |
| 1950 | VkResult result) |
| 1951 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1952 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1953 | if(pPhysicalDeviceCount != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1954 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1955 | } |
| 1956 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1957 | if(pPhysicalDevices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1958 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1959 | } |
| 1960 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1961 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1962 | { |
| 1963 | std::string reason = "vkEnumeratePhysicalDevices parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1964 | log_msg(mid(instance), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1965 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1966 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1967 | |
| 1968 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1969 | } |
| 1970 | |
| 1971 | VK_LAYER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
| 1972 | VkInstance instance, |
| 1973 | uint32_t* pPhysicalDeviceCount, |
| 1974 | VkPhysicalDevice* pPhysicalDevices) |
| 1975 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1976 | VkResult result = get_dispatch_table(pc_instance_table_map, instance)->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
| 1977 | |
| 1978 | PostEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices, result); |
| 1979 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1980 | return result; |
| 1981 | } |
| 1982 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1983 | bool PostGetPhysicalDeviceFeatures( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1984 | VkPhysicalDevice physicalDevice, |
| 1985 | VkPhysicalDeviceFeatures* pFeatures, |
| 1986 | VkResult result) |
| 1987 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1988 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1989 | if(pFeatures != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1990 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1991 | } |
| 1992 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1993 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1994 | { |
| 1995 | std::string reason = "vkGetPhysicalDeviceFeatures parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1996 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1997 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1998 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1999 | |
| 2000 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2001 | } |
| 2002 | |
| 2003 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures( |
| 2004 | VkPhysicalDevice physicalDevice, |
| 2005 | VkPhysicalDeviceFeatures* pFeatures) |
| 2006 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2007 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
| 2008 | |
| 2009 | PostGetPhysicalDeviceFeatures(physicalDevice, pFeatures, result); |
| 2010 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2011 | return result; |
| 2012 | } |
| 2013 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 2014 | bool PostGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2015 | VkPhysicalDevice physicalDevice, |
| 2016 | VkFormat format, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2017 | VkFormatProperties* pFormatProperties, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2018 | VkResult result) |
| 2019 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2020 | |
| 2021 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2022 | format > VK_FORMAT_END_RANGE) |
| 2023 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2024 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2025 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2026 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2027 | } |
| 2028 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2029 | if(pFormatProperties != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2030 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2031 | } |
| 2032 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2033 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2034 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 2035 | std::string reason = "vkGetPhysicalDeviceFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2036 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2037 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2038 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2039 | |
| 2040 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2041 | } |
| 2042 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 2043 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2044 | VkPhysicalDevice physicalDevice, |
| 2045 | VkFormat format, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2046 | VkFormatProperties* pFormatProperties) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2047 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2048 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2049 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2050 | PostGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties, result); |
| 2051 | |
| 2052 | return result; |
| 2053 | } |
| 2054 | |
| 2055 | bool PostGetPhysicalDeviceImageFormatProperties( |
| 2056 | VkPhysicalDevice physicalDevice, |
| 2057 | VkFormat format, |
| 2058 | VkImageType type, |
| 2059 | VkImageTiling tiling, |
| 2060 | VkImageUsageFlags usage, |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 2061 | VkImageCreateFlags flags, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2062 | VkImageFormatProperties* pImageFormatProperties, |
| 2063 | VkResult result) |
| 2064 | { |
| 2065 | |
| 2066 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2067 | format > VK_FORMAT_END_RANGE) |
| 2068 | { |
| 2069 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2070 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
| 2071 | return false; |
| 2072 | } |
| 2073 | |
| 2074 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 2075 | type > VK_IMAGE_TYPE_END_RANGE) |
| 2076 | { |
| 2077 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2078 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkImageType type, is an unrecognized enumerator"); |
| 2079 | return false; |
| 2080 | } |
| 2081 | |
| 2082 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 2083 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 2084 | { |
| 2085 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2086 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkImageTiling tiling, is an unrecognized enumerator"); |
| 2087 | return false; |
| 2088 | } |
| 2089 | |
| 2090 | |
| 2091 | if(pImageFormatProperties != nullptr) |
| 2092 | { |
| 2093 | } |
| 2094 | |
| 2095 | if(result < VK_SUCCESS) |
| 2096 | { |
| 2097 | std::string reason = "vkGetPhysicalDeviceImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2098 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2099 | return false; |
| 2100 | } |
| 2101 | |
| 2102 | return true; |
| 2103 | } |
| 2104 | |
| 2105 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties( |
| 2106 | VkPhysicalDevice physicalDevice, |
| 2107 | VkFormat format, |
| 2108 | VkImageType type, |
| 2109 | VkImageTiling tiling, |
| 2110 | VkImageUsageFlags usage, |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 2111 | VkImageCreateFlags flags, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2112 | VkImageFormatProperties* pImageFormatProperties) |
| 2113 | { |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 2114 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2115 | |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 2116 | PostGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2117 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2118 | return result; |
| 2119 | } |
| 2120 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2121 | bool PostGetPhysicalDeviceProperties( |
| 2122 | VkPhysicalDevice physicalDevice, |
| 2123 | VkPhysicalDeviceProperties* pProperties, |
| 2124 | VkResult result) |
| 2125 | { |
| 2126 | |
| 2127 | if(pProperties != nullptr) |
| 2128 | { |
| 2129 | if(pProperties->deviceType < VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE || |
| 2130 | pProperties->deviceType > VK_PHYSICAL_DEVICE_TYPE_END_RANGE) |
| 2131 | { |
| 2132 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2133 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceType pProperties->deviceType, is an unrecognized enumerator"); |
| 2134 | return false; |
| 2135 | } |
| 2136 | } |
| 2137 | |
| 2138 | if(result < VK_SUCCESS) |
| 2139 | { |
| 2140 | std::string reason = "vkGetPhysicalDeviceProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2141 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2142 | return false; |
| 2143 | } |
| 2144 | |
| 2145 | return true; |
| 2146 | } |
| 2147 | |
| 2148 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties( |
| 2149 | VkPhysicalDevice physicalDevice, |
| 2150 | VkPhysicalDeviceProperties* pProperties) |
| 2151 | { |
| 2152 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties(physicalDevice, pProperties); |
| 2153 | |
| 2154 | PostGetPhysicalDeviceProperties(physicalDevice, pProperties, result); |
| 2155 | |
| 2156 | return result; |
| 2157 | } |
| 2158 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2159 | bool PostGetPhysicalDeviceQueueFamilyProperties( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2160 | VkPhysicalDevice physicalDevice, |
| 2161 | uint32_t* pCount, |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2162 | VkQueueFamilyProperties* pQueueProperties, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2163 | VkResult result) |
| 2164 | { |
| 2165 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2166 | if(pQueueProperties == nullptr && pCount != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2167 | { |
| 2168 | } |
| 2169 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2170 | if(pQueueProperties != nullptr) |
| 2171 | { |
| 2172 | } |
| 2173 | |
| 2174 | if(result < VK_SUCCESS) |
| 2175 | { |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2176 | std::string reason = "vkGetPhysicalDeviceQueueFamilyProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2177 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2178 | return false; |
| 2179 | } |
| 2180 | |
| 2181 | return true; |
| 2182 | } |
| 2183 | |
| 2184 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties( |
| 2185 | VkPhysicalDevice physicalDevice, |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2186 | uint32_t* pCount, |
| 2187 | VkQueueFamilyProperties* pQueueProperties) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2188 | { |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2189 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pCount, pQueueProperties); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2190 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2191 | PostGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pCount, pQueueProperties, result); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2192 | |
| 2193 | return result; |
| 2194 | } |
| 2195 | |
| 2196 | bool PostGetPhysicalDeviceMemoryProperties( |
| 2197 | VkPhysicalDevice physicalDevice, |
| 2198 | VkPhysicalDeviceMemoryProperties* pMemoryProperties, |
| 2199 | VkResult result) |
| 2200 | { |
| 2201 | |
| 2202 | if(pMemoryProperties != nullptr) |
| 2203 | { |
| 2204 | } |
| 2205 | |
| 2206 | if(result < VK_SUCCESS) |
| 2207 | { |
| 2208 | std::string reason = "vkGetPhysicalDeviceMemoryProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2209 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2210 | return false; |
| 2211 | } |
| 2212 | |
| 2213 | return true; |
| 2214 | } |
| 2215 | |
| 2216 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( |
| 2217 | VkPhysicalDevice physicalDevice, |
| 2218 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 2219 | { |
| 2220 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); |
| 2221 | |
| 2222 | PostGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties, result); |
| 2223 | |
| 2224 | return result; |
| 2225 | } |
| 2226 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2227 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice( |
| 2228 | VkPhysicalDevice physicalDevice, |
| 2229 | const VkDeviceCreateInfo* pCreateInfo, |
| 2230 | VkDevice* pDevice) |
| 2231 | { |
Courtney Goeltzenleuchter | bafcdf3 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 2232 | /* |
| 2233 | * NOTE: The loader fills in the ICD's device object in *pDevice. |
| 2234 | * Use that object to get the dispatch table. |
| 2235 | * |
| 2236 | * NOTE: We do not validate physicalDevice or any dispatchable |
| 2237 | * object as the first parameter. We couldn't get here if it was wrong! |
| 2238 | */ |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 2239 | VkLayerDispatchTable *pTable = get_dispatch_table(pc_device_table_map, *pDevice); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2240 | VkResult result = pTable->CreateDevice(physicalDevice, pCreateInfo, pDevice); |
| 2241 | if(result == VK_SUCCESS) |
| 2242 | { |
| 2243 | layer_data *instance_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2244 | layer_data *device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); |
| 2245 | device_data->report_data = layer_debug_report_create_device(instance_data->report_data, *pDevice); |
| 2246 | } |
| 2247 | |
| 2248 | return result; |
| 2249 | } |
| 2250 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 2251 | VK_LAYER_EXPORT void VKAPI vkDestroyDevice( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2252 | VkDevice device) |
| 2253 | { |
| 2254 | layer_debug_report_destroy_device(device); |
| 2255 | |
| 2256 | dispatch_key key = get_dispatch_key(device); |
| 2257 | #if DISPATCH_MAP_DEBUG |
| 2258 | fprintf(stderr, "Device: %p, key: %p\n", device, key); |
| 2259 | #endif |
| 2260 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 2261 | get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2262 | pc_device_table_map.erase(key); |
| 2263 | assert(pc_device_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2264 | } |
| 2265 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2266 | bool PostGetDeviceQueue( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2267 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2268 | uint32_t queueFamilyIndex, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2269 | uint32_t queueIndex, |
| 2270 | VkQueue* pQueue, |
| 2271 | VkResult result) |
| 2272 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2273 | |
| 2274 | |
| 2275 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2276 | if(pQueue != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2277 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2278 | } |
| 2279 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2280 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2281 | { |
| 2282 | std::string reason = "vkGetDeviceQueue parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2283 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2284 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2285 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2286 | |
| 2287 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2288 | } |
| 2289 | |
| 2290 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceQueue( |
| 2291 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2292 | uint32_t queueFamilyIndex, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2293 | uint32_t queueIndex, |
| 2294 | VkQueue* pQueue) |
| 2295 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2296 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2297 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2298 | PostGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2299 | |
| 2300 | return result; |
| 2301 | } |
| 2302 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2303 | bool PreQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2304 | VkQueue queue, |
| 2305 | const VkCmdBuffer* pCmdBuffers) |
| 2306 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2307 | if(pCmdBuffers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2308 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2309 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2310 | |
| 2311 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2312 | } |
| 2313 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2314 | bool PostQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2315 | VkQueue queue, |
| 2316 | uint32_t cmdBufferCount, |
| 2317 | VkFence fence, |
| 2318 | VkResult result) |
| 2319 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2320 | |
| 2321 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2322 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2323 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2324 | { |
| 2325 | std::string reason = "vkQueueSubmit parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2326 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2327 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2328 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2329 | |
| 2330 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2331 | } |
| 2332 | |
| 2333 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( |
| 2334 | VkQueue queue, |
| 2335 | uint32_t cmdBufferCount, |
| 2336 | const VkCmdBuffer* pCmdBuffers, |
| 2337 | VkFence fence) |
| 2338 | { |
| 2339 | PreQueueSubmit(queue, pCmdBuffers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2340 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2341 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence); |
| 2342 | |
| 2343 | PostQueueSubmit(queue, cmdBufferCount, fence, result); |
| 2344 | |
| 2345 | return result; |
| 2346 | } |
| 2347 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2348 | bool PostQueueWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2349 | VkQueue queue, |
| 2350 | VkResult result) |
| 2351 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2352 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2353 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2354 | { |
| 2355 | std::string reason = "vkQueueWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2356 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2357 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2358 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2359 | |
| 2360 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2361 | } |
| 2362 | |
| 2363 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitIdle( |
| 2364 | VkQueue queue) |
| 2365 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2366 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue); |
| 2367 | |
| 2368 | PostQueueWaitIdle(queue, result); |
| 2369 | |
| 2370 | return result; |
| 2371 | } |
| 2372 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2373 | bool PostDeviceWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2374 | VkDevice device, |
| 2375 | VkResult result) |
| 2376 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2377 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2378 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2379 | { |
| 2380 | std::string reason = "vkDeviceWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2381 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2382 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2383 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2384 | |
| 2385 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2386 | } |
| 2387 | |
| 2388 | VK_LAYER_EXPORT VkResult VKAPI vkDeviceWaitIdle( |
| 2389 | VkDevice device) |
| 2390 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2391 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device); |
| 2392 | |
| 2393 | PostDeviceWaitIdle(device, result); |
| 2394 | |
| 2395 | return result; |
| 2396 | } |
| 2397 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2398 | bool PreAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2399 | VkDevice device, |
| 2400 | const VkMemoryAllocInfo* pAllocInfo) |
| 2401 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2402 | if(pAllocInfo != nullptr) |
| 2403 | { |
| 2404 | if(pAllocInfo->sType != VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2405 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2406 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2407 | "vkAllocMemory parameter, VkStructureType pAllocInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2408 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2409 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2410 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2411 | |
| 2412 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2413 | } |
| 2414 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2415 | bool PostAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2416 | VkDevice device, |
| 2417 | VkDeviceMemory* pMem, |
| 2418 | VkResult result) |
| 2419 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2420 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2421 | if(pMem != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2422 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2423 | } |
| 2424 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2425 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2426 | { |
| 2427 | std::string reason = "vkAllocMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2428 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2429 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2430 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2431 | |
| 2432 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2433 | } |
| 2434 | |
| 2435 | VK_LAYER_EXPORT VkResult VKAPI vkAllocMemory( |
| 2436 | VkDevice device, |
| 2437 | const VkMemoryAllocInfo* pAllocInfo, |
| 2438 | VkDeviceMemory* pMem) |
| 2439 | { |
| 2440 | PreAllocMemory(device, pAllocInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2441 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2442 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocMemory(device, pAllocInfo, pMem); |
| 2443 | |
| 2444 | PostAllocMemory(device, pMem, result); |
| 2445 | |
| 2446 | return result; |
| 2447 | } |
| 2448 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2449 | bool PostMapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2450 | VkDevice device, |
| 2451 | VkDeviceMemory mem, |
| 2452 | VkDeviceSize offset, |
| 2453 | VkDeviceSize size, |
| 2454 | VkMemoryMapFlags flags, |
| 2455 | void** ppData, |
| 2456 | VkResult result) |
| 2457 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2458 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2459 | |
| 2460 | |
| 2461 | |
| 2462 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2463 | if(ppData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2464 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2465 | } |
| 2466 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2467 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2468 | { |
| 2469 | std::string reason = "vkMapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2470 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2471 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2472 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2473 | |
| 2474 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2475 | } |
| 2476 | |
| 2477 | VK_LAYER_EXPORT VkResult VKAPI vkMapMemory( |
| 2478 | VkDevice device, |
| 2479 | VkDeviceMemory mem, |
| 2480 | VkDeviceSize offset, |
| 2481 | VkDeviceSize size, |
| 2482 | VkMemoryMapFlags flags, |
| 2483 | void** ppData) |
| 2484 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2485 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, mem, offset, size, flags, ppData); |
| 2486 | |
| 2487 | PostMapMemory(device, mem, offset, size, flags, ppData, result); |
| 2488 | |
| 2489 | return result; |
| 2490 | } |
| 2491 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2492 | bool PreFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2493 | VkDevice device, |
| 2494 | const VkMappedMemoryRange* pMemRanges) |
| 2495 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2496 | if(pMemRanges != nullptr) |
| 2497 | { |
| 2498 | if(pMemRanges->sType != VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2499 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2500 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2501 | "vkFlushMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2502 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2503 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2504 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2505 | |
| 2506 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2507 | } |
| 2508 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2509 | bool PostFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2510 | VkDevice device, |
| 2511 | uint32_t memRangeCount, |
| 2512 | VkResult result) |
| 2513 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2514 | |
| 2515 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2516 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2517 | { |
| 2518 | std::string reason = "vkFlushMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2519 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2520 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2521 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2522 | |
| 2523 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2524 | } |
| 2525 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2526 | VK_LAYER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2527 | VkDevice device, |
| 2528 | uint32_t memRangeCount, |
| 2529 | const VkMappedMemoryRange* pMemRanges) |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2530 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2531 | PreFlushMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2532 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2533 | VkResult result = get_dispatch_table(pc_device_table_map, device)->FlushMappedMemoryRanges(device, memRangeCount, pMemRanges); |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2534 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2535 | PostFlushMappedMemoryRanges(device, memRangeCount, result); |
| 2536 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2537 | return result; |
| 2538 | } |
| 2539 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2540 | bool PreInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2541 | VkDevice device, |
| 2542 | const VkMappedMemoryRange* pMemRanges) |
| 2543 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2544 | if(pMemRanges != nullptr) |
| 2545 | { |
| 2546 | if(pMemRanges->sType != VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2547 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2548 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2549 | "vkInvalidateMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2550 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2551 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2552 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2553 | |
| 2554 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2555 | } |
| 2556 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2557 | bool PostInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2558 | VkDevice device, |
| 2559 | uint32_t memRangeCount, |
| 2560 | VkResult result) |
| 2561 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2562 | |
| 2563 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2564 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2565 | { |
| 2566 | std::string reason = "vkInvalidateMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2567 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2568 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2569 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2570 | |
| 2571 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2572 | } |
| 2573 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2574 | VK_LAYER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2575 | VkDevice device, |
| 2576 | uint32_t memRangeCount, |
| 2577 | const VkMappedMemoryRange* pMemRanges) |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2578 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2579 | PreInvalidateMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2580 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2581 | VkResult result = get_dispatch_table(pc_device_table_map, device)->InvalidateMappedMemoryRanges(device, memRangeCount, pMemRanges); |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2582 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2583 | PostInvalidateMappedMemoryRanges(device, memRangeCount, result); |
| 2584 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2585 | return result; |
| 2586 | } |
| 2587 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2588 | bool PostGetDeviceMemoryCommitment( |
| 2589 | VkDevice device, |
| 2590 | VkDeviceMemory memory, |
| 2591 | VkDeviceSize* pCommittedMemoryInBytes, |
| 2592 | VkResult result) |
| 2593 | { |
| 2594 | |
| 2595 | |
| 2596 | if(pCommittedMemoryInBytes != nullptr) |
| 2597 | { |
| 2598 | } |
| 2599 | |
| 2600 | if(result < VK_SUCCESS) |
| 2601 | { |
| 2602 | std::string reason = "vkGetDeviceMemoryCommitment parameter, VkResult result, is " + EnumeratorString(result); |
| 2603 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2604 | return false; |
| 2605 | } |
| 2606 | |
| 2607 | return true; |
| 2608 | } |
| 2609 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2610 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2611 | VkDevice device, |
| 2612 | VkDeviceMemory memory, |
| 2613 | VkDeviceSize* pCommittedMemoryInBytes) |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2614 | { |
| 2615 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
| 2616 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2617 | PostGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes, result); |
| 2618 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2619 | return result; |
| 2620 | } |
| 2621 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2622 | bool PostBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2623 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2624 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2625 | VkDeviceMemory mem, |
| 2626 | VkDeviceSize memOffset, |
| 2627 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2628 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2629 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2630 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2631 | |
| 2632 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2633 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2634 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2635 | std::string reason = "vkBindBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2636 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2637 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2638 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2639 | |
| 2640 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2641 | } |
| 2642 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2643 | VK_LAYER_EXPORT VkResult VKAPI vkBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2644 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2645 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2646 | VkDeviceMemory mem, |
| 2647 | VkDeviceSize memOffset) |
| 2648 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2649 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindBufferMemory(device, buffer, mem, memOffset); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2650 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2651 | PostBindBufferMemory(device, buffer, mem, memOffset, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2652 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2653 | return result; |
| 2654 | } |
| 2655 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2656 | bool PostBindImageMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2657 | VkDevice device, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2658 | VkImage image, |
| 2659 | VkDeviceMemory mem, |
| 2660 | VkDeviceSize memOffset, |
| 2661 | VkResult result) |
| 2662 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2663 | |
| 2664 | |
| 2665 | |
| 2666 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2667 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2668 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2669 | std::string reason = "vkBindImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2670 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2671 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2672 | } |
| 2673 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2674 | return true; |
| 2675 | } |
| 2676 | |
| 2677 | VK_LAYER_EXPORT VkResult VKAPI vkBindImageMemory( |
| 2678 | VkDevice device, |
| 2679 | VkImage image, |
| 2680 | VkDeviceMemory mem, |
| 2681 | VkDeviceSize memOffset) |
| 2682 | { |
| 2683 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, mem, memOffset); |
| 2684 | |
| 2685 | PostBindImageMemory(device, image, mem, memOffset, result); |
| 2686 | |
| 2687 | return result; |
| 2688 | } |
| 2689 | |
| 2690 | bool PostGetBufferMemoryRequirements( |
| 2691 | VkDevice device, |
| 2692 | VkBuffer buffer, |
| 2693 | VkMemoryRequirements* pMemoryRequirements, |
| 2694 | VkResult result) |
| 2695 | { |
| 2696 | |
| 2697 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2698 | if(pMemoryRequirements != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2699 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2700 | } |
| 2701 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2702 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2703 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2704 | std::string reason = "vkGetBufferMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2705 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2706 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2707 | } |
| 2708 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2709 | return true; |
| 2710 | } |
| 2711 | |
| 2712 | VK_LAYER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements( |
| 2713 | VkDevice device, |
| 2714 | VkBuffer buffer, |
| 2715 | VkMemoryRequirements* pMemoryRequirements) |
| 2716 | { |
| 2717 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
| 2718 | |
| 2719 | PostGetBufferMemoryRequirements(device, buffer, pMemoryRequirements, result); |
| 2720 | |
| 2721 | return result; |
| 2722 | } |
| 2723 | |
| 2724 | bool PostGetImageMemoryRequirements( |
| 2725 | VkDevice device, |
| 2726 | VkImage image, |
| 2727 | VkMemoryRequirements* pMemoryRequirements, |
| 2728 | VkResult result) |
| 2729 | { |
| 2730 | |
| 2731 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2732 | if(pMemoryRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2733 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2734 | } |
| 2735 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2736 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2737 | { |
| 2738 | std::string reason = "vkGetImageMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2739 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2740 | return false; |
| 2741 | } |
| 2742 | |
| 2743 | return true; |
| 2744 | } |
| 2745 | |
| 2746 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageMemoryRequirements( |
| 2747 | VkDevice device, |
| 2748 | VkImage image, |
| 2749 | VkMemoryRequirements* pMemoryRequirements) |
| 2750 | { |
| 2751 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
| 2752 | |
| 2753 | PostGetImageMemoryRequirements(device, image, pMemoryRequirements, result); |
| 2754 | |
| 2755 | return result; |
| 2756 | } |
| 2757 | |
| 2758 | bool PostGetImageSparseMemoryRequirements( |
| 2759 | VkDevice device, |
| 2760 | VkImage image, |
| 2761 | uint32_t* pNumRequirements, |
| 2762 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements, |
| 2763 | VkResult result) |
| 2764 | { |
| 2765 | |
| 2766 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2767 | if(pNumRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2768 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2769 | } |
| 2770 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2771 | if(pSparseMemoryRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2772 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2773 | if(pSparseMemoryRequirements->formatProps.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2774 | pSparseMemoryRequirements->formatProps.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2775 | { |
| 2776 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2777 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect pSparseMemoryRequirements->formatProps.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2778 | return false; |
| 2779 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2780 | } |
| 2781 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2782 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2783 | { |
| 2784 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2785 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2786 | return false; |
| 2787 | } |
| 2788 | |
| 2789 | return true; |
| 2790 | } |
| 2791 | |
| 2792 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements( |
| 2793 | VkDevice device, |
| 2794 | VkImage image, |
| 2795 | uint32_t* pNumRequirements, |
| 2796 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2797 | { |
| 2798 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements); |
| 2799 | |
| 2800 | PostGetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements, result); |
| 2801 | |
| 2802 | return result; |
| 2803 | } |
| 2804 | |
| 2805 | bool PostGetPhysicalDeviceSparseImageFormatProperties( |
| 2806 | VkPhysicalDevice physicalDevice, |
| 2807 | VkFormat format, |
| 2808 | VkImageType type, |
| 2809 | uint32_t samples, |
| 2810 | VkImageUsageFlags usage, |
| 2811 | VkImageTiling tiling, |
| 2812 | uint32_t* pNumProperties, |
| 2813 | VkSparseImageFormatProperties* pProperties, |
| 2814 | VkResult result) |
| 2815 | { |
| 2816 | |
| 2817 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2818 | format > VK_FORMAT_END_RANGE) |
| 2819 | { |
| 2820 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2821 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2822 | return false; |
| 2823 | } |
| 2824 | |
| 2825 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 2826 | type > VK_IMAGE_TYPE_END_RANGE) |
| 2827 | { |
| 2828 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2829 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageType type, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2830 | return false; |
| 2831 | } |
| 2832 | |
| 2833 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2834 | |
| 2835 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 2836 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 2837 | { |
| 2838 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2839 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageTiling tiling, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2840 | return false; |
| 2841 | } |
| 2842 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2843 | if(pNumProperties != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2844 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2845 | } |
| 2846 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2847 | if(pProperties != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2848 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2849 | if(pProperties->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2850 | pProperties->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2851 | { |
| 2852 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2853 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2854 | return false; |
| 2855 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2856 | } |
| 2857 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2858 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2859 | { |
| 2860 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2861 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2862 | return false; |
| 2863 | } |
| 2864 | |
| 2865 | return true; |
| 2866 | } |
| 2867 | |
| 2868 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2869 | VkPhysicalDevice physicalDevice, |
| 2870 | VkFormat format, |
| 2871 | VkImageType type, |
| 2872 | uint32_t samples, |
| 2873 | VkImageUsageFlags usage, |
| 2874 | VkImageTiling tiling, |
| 2875 | uint32_t* pNumProperties, |
| 2876 | VkSparseImageFormatProperties* pProperties) |
| 2877 | { |
| 2878 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties); |
| 2879 | |
| 2880 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties, result); |
| 2881 | |
| 2882 | return result; |
| 2883 | } |
| 2884 | |
| 2885 | bool PreQueueBindSparseBufferMemory( |
| 2886 | VkQueue queue, |
| 2887 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2888 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2889 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2890 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2891 | } |
| 2892 | |
| 2893 | return true; |
| 2894 | } |
| 2895 | |
| 2896 | bool PostQueueBindSparseBufferMemory( |
| 2897 | VkQueue queue, |
| 2898 | VkBuffer buffer, |
| 2899 | uint32_t numBindings, |
| 2900 | VkResult result) |
| 2901 | { |
| 2902 | |
| 2903 | |
| 2904 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2905 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2906 | { |
| 2907 | std::string reason = "vkQueueBindSparseBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2908 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2909 | return false; |
| 2910 | } |
| 2911 | |
| 2912 | return true; |
| 2913 | } |
| 2914 | |
| 2915 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory( |
| 2916 | VkQueue queue, |
| 2917 | VkBuffer buffer, |
| 2918 | uint32_t numBindings, |
| 2919 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2920 | { |
| 2921 | PreQueueBindSparseBufferMemory(queue, pBindInfo); |
| 2922 | |
| 2923 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo); |
| 2924 | |
| 2925 | PostQueueBindSparseBufferMemory(queue, buffer, numBindings, result); |
| 2926 | |
| 2927 | return result; |
| 2928 | } |
| 2929 | |
| 2930 | bool PreQueueBindSparseImageOpaqueMemory( |
| 2931 | VkQueue queue, |
| 2932 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2933 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2934 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2935 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2936 | } |
| 2937 | |
| 2938 | return true; |
| 2939 | } |
| 2940 | |
| 2941 | bool PostQueueBindSparseImageOpaqueMemory( |
| 2942 | VkQueue queue, |
| 2943 | VkImage image, |
| 2944 | uint32_t numBindings, |
| 2945 | VkResult result) |
| 2946 | { |
| 2947 | |
| 2948 | |
| 2949 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2950 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2951 | { |
| 2952 | std::string reason = "vkQueueBindSparseImageOpaqueMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2953 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2954 | return false; |
| 2955 | } |
| 2956 | |
| 2957 | return true; |
| 2958 | } |
| 2959 | |
| 2960 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory( |
| 2961 | VkQueue queue, |
| 2962 | VkImage image, |
| 2963 | uint32_t numBindings, |
| 2964 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2965 | { |
| 2966 | PreQueueBindSparseImageOpaqueMemory(queue, pBindInfo); |
| 2967 | |
| 2968 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo); |
| 2969 | |
| 2970 | PostQueueBindSparseImageOpaqueMemory(queue, image, numBindings, result); |
| 2971 | |
| 2972 | return result; |
| 2973 | } |
| 2974 | |
| 2975 | bool PreQueueBindSparseImageMemory( |
| 2976 | VkQueue queue, |
| 2977 | const VkSparseImageMemoryBindInfo* pBindInfo) |
| 2978 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2979 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2980 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2981 | if(pBindInfo->subresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2982 | pBindInfo->subresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2983 | { |
| 2984 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2985 | "vkQueueBindSparseImageMemory parameter, VkImageAspect pBindInfo->subresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2986 | return false; |
| 2987 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2988 | } |
| 2989 | |
| 2990 | return true; |
| 2991 | } |
| 2992 | |
| 2993 | bool PostQueueBindSparseImageMemory( |
| 2994 | VkQueue queue, |
| 2995 | VkImage image, |
| 2996 | uint32_t numBindings, |
| 2997 | VkResult result) |
| 2998 | { |
| 2999 | |
| 3000 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3001 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3002 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3003 | { |
| 3004 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3005 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3006 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3007 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3008 | |
| 3009 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3010 | } |
| 3011 | |
| 3012 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3013 | VkQueue queue, |
| 3014 | VkImage image, |
| 3015 | uint32_t numBindings, |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 3016 | const VkSparseImageMemoryBindInfo* pBindInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3017 | { |
| 3018 | PreQueueBindSparseImageMemory(queue, pBindInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3019 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 3020 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseImageMemory(queue, image, numBindings, pBindInfo); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3021 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3022 | PostQueueBindSparseImageMemory(queue, image, numBindings, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3023 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3024 | return result; |
| 3025 | } |
| 3026 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3027 | bool PreCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3028 | VkDevice device, |
| 3029 | const VkFenceCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3030 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3031 | if(pCreateInfo != nullptr) |
| 3032 | { |
| 3033 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_FENCE_CREATE_INFO) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3034 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3035 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3036 | "vkCreateFence parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3037 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3038 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3039 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3040 | |
| 3041 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3042 | } |
| 3043 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3044 | bool PostCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3045 | VkDevice device, |
| 3046 | VkFence* pFence, |
| 3047 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3048 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3049 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3050 | if(pFence != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3051 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3052 | } |
| 3053 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3054 | if(result < VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3055 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3056 | std::string reason = "vkCreateFence parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3057 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3058 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3059 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3060 | |
| 3061 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3062 | } |
| 3063 | |
| 3064 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFence( |
| 3065 | VkDevice device, |
| 3066 | const VkFenceCreateInfo* pCreateInfo, |
| 3067 | VkFence* pFence) |
| 3068 | { |
| 3069 | PreCreateFence(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3070 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3071 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pFence); |
| 3072 | |
| 3073 | PostCreateFence(device, pFence, result); |
| 3074 | |
| 3075 | return result; |
| 3076 | } |
| 3077 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3078 | bool PreResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3079 | VkDevice device, |
| 3080 | const VkFence* pFences) |
| 3081 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3082 | if(pFences != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3083 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3084 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3085 | |
| 3086 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3087 | } |
| 3088 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3089 | bool PostResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3090 | VkDevice device, |
| 3091 | uint32_t fenceCount, |
| 3092 | VkResult result) |
| 3093 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3094 | |
| 3095 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3096 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3097 | { |
| 3098 | std::string reason = "vkResetFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3099 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3100 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3101 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3102 | |
| 3103 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3104 | } |
| 3105 | |
| 3106 | VK_LAYER_EXPORT VkResult VKAPI vkResetFences( |
| 3107 | VkDevice device, |
| 3108 | uint32_t fenceCount, |
| 3109 | const VkFence* pFences) |
| 3110 | { |
| 3111 | PreResetFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3112 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3113 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences); |
| 3114 | |
| 3115 | PostResetFences(device, fenceCount, result); |
| 3116 | |
| 3117 | return result; |
| 3118 | } |
| 3119 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3120 | bool PostGetFenceStatus( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3121 | VkDevice device, |
| 3122 | VkFence fence, |
| 3123 | VkResult result) |
| 3124 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3125 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3126 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3127 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3128 | { |
| 3129 | std::string reason = "vkGetFenceStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3130 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3131 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3132 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3133 | |
| 3134 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3135 | } |
| 3136 | |
| 3137 | VK_LAYER_EXPORT VkResult VKAPI vkGetFenceStatus( |
| 3138 | VkDevice device, |
| 3139 | VkFence fence) |
| 3140 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3141 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence); |
| 3142 | |
| 3143 | PostGetFenceStatus(device, fence, result); |
| 3144 | |
| 3145 | return result; |
| 3146 | } |
| 3147 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3148 | bool PreWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3149 | VkDevice device, |
| 3150 | const VkFence* pFences) |
| 3151 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3152 | if(pFences != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3153 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3154 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3155 | |
| 3156 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3157 | } |
| 3158 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3159 | bool PostWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3160 | VkDevice device, |
| 3161 | uint32_t fenceCount, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3162 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3163 | uint64_t timeout, |
| 3164 | VkResult result) |
| 3165 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3166 | |
| 3167 | |
| 3168 | |
| 3169 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3170 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3171 | { |
| 3172 | std::string reason = "vkWaitForFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3173 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3174 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3175 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3176 | |
| 3177 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3178 | } |
| 3179 | |
| 3180 | VK_LAYER_EXPORT VkResult VKAPI vkWaitForFences( |
| 3181 | VkDevice device, |
| 3182 | uint32_t fenceCount, |
| 3183 | const VkFence* pFences, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3184 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3185 | uint64_t timeout) |
| 3186 | { |
| 3187 | PreWaitForFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3188 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3189 | VkResult result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 3190 | |
| 3191 | PostWaitForFences(device, fenceCount, waitAll, timeout, result); |
| 3192 | |
| 3193 | return result; |
| 3194 | } |
| 3195 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3196 | bool PreCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3197 | VkDevice device, |
| 3198 | const VkSemaphoreCreateInfo* pCreateInfo) |
| 3199 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3200 | if(pCreateInfo != nullptr) |
| 3201 | { |
| 3202 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3203 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3204 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3205 | "vkCreateSemaphore parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3206 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3207 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3208 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3209 | |
| 3210 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3211 | } |
| 3212 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3213 | bool PostCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3214 | VkDevice device, |
| 3215 | VkSemaphore* pSemaphore, |
| 3216 | VkResult result) |
| 3217 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3218 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3219 | if(pSemaphore != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3220 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3221 | } |
| 3222 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3223 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3224 | { |
| 3225 | std::string reason = "vkCreateSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3226 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3227 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3228 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3229 | |
| 3230 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3231 | } |
| 3232 | |
| 3233 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSemaphore( |
| 3234 | VkDevice device, |
| 3235 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 3236 | VkSemaphore* pSemaphore) |
| 3237 | { |
| 3238 | PreCreateSemaphore(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3239 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3240 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pSemaphore); |
| 3241 | |
| 3242 | PostCreateSemaphore(device, pSemaphore, result); |
| 3243 | |
| 3244 | return result; |
| 3245 | } |
| 3246 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3247 | bool PostQueueSignalSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3248 | VkQueue queue, |
| 3249 | VkSemaphore semaphore, |
| 3250 | VkResult result) |
| 3251 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3252 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3253 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3254 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3255 | { |
| 3256 | std::string reason = "vkQueueSignalSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3257 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3258 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3259 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3260 | |
| 3261 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3262 | } |
| 3263 | |
| 3264 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSignalSemaphore( |
| 3265 | VkQueue queue, |
| 3266 | VkSemaphore semaphore) |
| 3267 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3268 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSignalSemaphore(queue, semaphore); |
| 3269 | |
| 3270 | PostQueueSignalSemaphore(queue, semaphore, result); |
| 3271 | |
| 3272 | return result; |
| 3273 | } |
| 3274 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3275 | bool PostQueueWaitSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3276 | VkQueue queue, |
| 3277 | VkSemaphore semaphore, |
| 3278 | VkResult result) |
| 3279 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3280 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3281 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3282 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3283 | { |
| 3284 | std::string reason = "vkQueueWaitSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3285 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3286 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3287 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3288 | |
| 3289 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3290 | } |
| 3291 | |
| 3292 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitSemaphore( |
| 3293 | VkQueue queue, |
| 3294 | VkSemaphore semaphore) |
| 3295 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3296 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitSemaphore(queue, semaphore); |
| 3297 | |
| 3298 | PostQueueWaitSemaphore(queue, semaphore, result); |
| 3299 | |
| 3300 | return result; |
| 3301 | } |
| 3302 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3303 | bool PreCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3304 | VkDevice device, |
| 3305 | const VkEventCreateInfo* pCreateInfo) |
| 3306 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3307 | if(pCreateInfo != nullptr) |
| 3308 | { |
| 3309 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_EVENT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3310 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3311 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3312 | "vkCreateEvent parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3313 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3314 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3315 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3316 | |
| 3317 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3318 | } |
| 3319 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3320 | bool PostCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3321 | VkDevice device, |
| 3322 | VkEvent* pEvent, |
| 3323 | VkResult result) |
| 3324 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3325 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3326 | if(pEvent != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3327 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3328 | } |
| 3329 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3330 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3331 | { |
| 3332 | std::string reason = "vkCreateEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3333 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3334 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3335 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3336 | |
| 3337 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3338 | } |
| 3339 | |
| 3340 | VK_LAYER_EXPORT VkResult VKAPI vkCreateEvent( |
| 3341 | VkDevice device, |
| 3342 | const VkEventCreateInfo* pCreateInfo, |
| 3343 | VkEvent* pEvent) |
| 3344 | { |
| 3345 | PreCreateEvent(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3346 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3347 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pEvent); |
| 3348 | |
| 3349 | PostCreateEvent(device, pEvent, result); |
| 3350 | |
| 3351 | return result; |
| 3352 | } |
| 3353 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3354 | bool PostGetEventStatus( |
| 3355 | VkDevice device, |
| 3356 | VkEvent event, |
| 3357 | VkResult result) |
| 3358 | { |
| 3359 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3360 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3361 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3362 | { |
| 3363 | std::string reason = "vkGetEventStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3364 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3365 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3366 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3367 | |
| 3368 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3369 | } |
| 3370 | |
| 3371 | VK_LAYER_EXPORT VkResult VKAPI vkGetEventStatus( |
| 3372 | VkDevice device, |
| 3373 | VkEvent event) |
| 3374 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3375 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event); |
| 3376 | |
| 3377 | PostGetEventStatus(device, event, result); |
| 3378 | |
| 3379 | return result; |
| 3380 | } |
| 3381 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3382 | bool PostSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3383 | VkDevice device, |
| 3384 | VkEvent event, |
| 3385 | VkResult result) |
| 3386 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3387 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3388 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3389 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3390 | { |
| 3391 | std::string reason = "vkSetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3392 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3393 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3394 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3395 | |
| 3396 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3397 | } |
| 3398 | |
| 3399 | VK_LAYER_EXPORT VkResult VKAPI vkSetEvent( |
| 3400 | VkDevice device, |
| 3401 | VkEvent event) |
| 3402 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3403 | VkResult result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event); |
| 3404 | |
| 3405 | PostSetEvent(device, event, result); |
| 3406 | |
| 3407 | return result; |
| 3408 | } |
| 3409 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3410 | bool PostResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3411 | VkDevice device, |
| 3412 | VkEvent event, |
| 3413 | VkResult result) |
| 3414 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3415 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3416 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3417 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3418 | { |
| 3419 | std::string reason = "vkResetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3420 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3421 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3422 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3423 | |
| 3424 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3425 | } |
| 3426 | |
| 3427 | VK_LAYER_EXPORT VkResult VKAPI vkResetEvent( |
| 3428 | VkDevice device, |
| 3429 | VkEvent event) |
| 3430 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3431 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event); |
| 3432 | |
| 3433 | PostResetEvent(device, event, result); |
| 3434 | |
| 3435 | return result; |
| 3436 | } |
| 3437 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3438 | bool PreCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3439 | VkDevice device, |
| 3440 | const VkQueryPoolCreateInfo* pCreateInfo) |
| 3441 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3442 | if(pCreateInfo != nullptr) |
| 3443 | { |
| 3444 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3445 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3446 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3447 | "vkCreateQueryPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3448 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3449 | } |
| 3450 | if(pCreateInfo->queryType < VK_QUERY_TYPE_BEGIN_RANGE || |
| 3451 | pCreateInfo->queryType > VK_QUERY_TYPE_END_RANGE) |
| 3452 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3453 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3454 | "vkCreateQueryPool parameter, VkQueryType pCreateInfo->queryType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3455 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3456 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3457 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3458 | |
| 3459 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3460 | } |
| 3461 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3462 | bool PostCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3463 | VkDevice device, |
| 3464 | VkQueryPool* pQueryPool, |
| 3465 | VkResult result) |
| 3466 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3467 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3468 | if(pQueryPool != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3469 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3470 | } |
| 3471 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3472 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3473 | { |
| 3474 | std::string reason = "vkCreateQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3475 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3476 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3477 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3478 | |
| 3479 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3480 | } |
| 3481 | |
| 3482 | VK_LAYER_EXPORT VkResult VKAPI vkCreateQueryPool( |
| 3483 | VkDevice device, |
| 3484 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3485 | VkQueryPool* pQueryPool) |
| 3486 | { |
| 3487 | PreCreateQueryPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3488 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3489 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 3490 | |
| 3491 | PostCreateQueryPool(device, pQueryPool, result); |
| 3492 | |
| 3493 | return result; |
| 3494 | } |
| 3495 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3496 | bool PostGetQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3497 | VkDevice device, |
| 3498 | VkQueryPool queryPool, |
| 3499 | uint32_t startQuery, |
| 3500 | uint32_t queryCount, |
| 3501 | size_t* pDataSize, |
| 3502 | void* pData, |
| 3503 | VkQueryResultFlags flags, |
| 3504 | VkResult result) |
| 3505 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3506 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3507 | |
| 3508 | |
| 3509 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3510 | if(pDataSize != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3511 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3512 | } |
| 3513 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3514 | if(pData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3515 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3516 | } |
| 3517 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3518 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3519 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3520 | { |
| 3521 | std::string reason = "vkGetQueryPoolResults parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3522 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3523 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3524 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3525 | |
| 3526 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3527 | } |
| 3528 | |
| 3529 | VK_LAYER_EXPORT VkResult VKAPI vkGetQueryPoolResults( |
| 3530 | VkDevice device, |
| 3531 | VkQueryPool queryPool, |
| 3532 | uint32_t startQuery, |
| 3533 | uint32_t queryCount, |
| 3534 | size_t* pDataSize, |
| 3535 | void* pData, |
| 3536 | VkQueryResultFlags flags) |
| 3537 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3538 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags); |
| 3539 | |
| 3540 | PostGetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags, result); |
| 3541 | |
| 3542 | return result; |
| 3543 | } |
| 3544 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3545 | bool PreCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3546 | VkDevice device, |
| 3547 | const VkBufferCreateInfo* pCreateInfo) |
| 3548 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3549 | if(pCreateInfo != nullptr) |
| 3550 | { |
| 3551 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3552 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3553 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3554 | "vkCreateBuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3555 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3556 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3557 | if(pCreateInfo->sharingMode < VK_SHARING_MODE_BEGIN_RANGE || |
| 3558 | pCreateInfo->sharingMode > VK_SHARING_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3559 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3560 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3561 | "vkCreateBuffer parameter, VkSharingMode pCreateInfo->sharingMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3562 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3563 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3564 | if(pCreateInfo->pQueueFamilyIndices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3565 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3566 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3567 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3568 | |
| 3569 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3570 | } |
| 3571 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3572 | bool PostCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3573 | VkDevice device, |
| 3574 | VkBuffer* pBuffer, |
| 3575 | VkResult result) |
| 3576 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3577 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3578 | if(pBuffer != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3579 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3580 | } |
| 3581 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3582 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3583 | { |
| 3584 | std::string reason = "vkCreateBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3585 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3586 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3587 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3588 | |
| 3589 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3590 | } |
| 3591 | |
| 3592 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBuffer( |
| 3593 | VkDevice device, |
| 3594 | const VkBufferCreateInfo* pCreateInfo, |
| 3595 | VkBuffer* pBuffer) |
| 3596 | { |
| 3597 | PreCreateBuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3598 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3599 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pBuffer); |
| 3600 | |
| 3601 | PostCreateBuffer(device, pBuffer, result); |
| 3602 | |
| 3603 | return result; |
| 3604 | } |
| 3605 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3606 | bool PreCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3607 | VkDevice device, |
| 3608 | const VkBufferViewCreateInfo* pCreateInfo) |
| 3609 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3610 | if(pCreateInfo != nullptr) |
| 3611 | { |
| 3612 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3613 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3614 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3615 | "vkCreateBufferView parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3616 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3617 | } |
| 3618 | if(pCreateInfo->viewType < VK_BUFFER_VIEW_TYPE_BEGIN_RANGE || |
| 3619 | pCreateInfo->viewType > VK_BUFFER_VIEW_TYPE_END_RANGE) |
| 3620 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3621 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3622 | "vkCreateBufferView parameter, VkBufferViewType pCreateInfo->viewType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3623 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3624 | } |
| 3625 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3626 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3627 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3628 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3629 | "vkCreateBufferView parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3630 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3631 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3632 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3633 | |
| 3634 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3635 | } |
| 3636 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3637 | bool PostCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3638 | VkDevice device, |
| 3639 | VkBufferView* pView, |
| 3640 | VkResult result) |
| 3641 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3642 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3643 | if(pView != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3644 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3645 | } |
| 3646 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3647 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3648 | { |
| 3649 | std::string reason = "vkCreateBufferView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3650 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3651 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3652 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3653 | |
| 3654 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3655 | } |
| 3656 | |
| 3657 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBufferView( |
| 3658 | VkDevice device, |
| 3659 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3660 | VkBufferView* pView) |
| 3661 | { |
| 3662 | PreCreateBufferView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3663 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3664 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pView); |
| 3665 | |
| 3666 | PostCreateBufferView(device, pView, result); |
| 3667 | |
| 3668 | return result; |
| 3669 | } |
| 3670 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3671 | bool PreCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3672 | VkDevice device, |
| 3673 | const VkImageCreateInfo* pCreateInfo) |
| 3674 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3675 | if(pCreateInfo != nullptr) |
| 3676 | { |
| 3677 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3678 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3679 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3680 | "vkCreateImage parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3681 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3682 | } |
| 3683 | if(pCreateInfo->imageType < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 3684 | pCreateInfo->imageType > VK_IMAGE_TYPE_END_RANGE) |
| 3685 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3686 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3687 | "vkCreateImage parameter, VkImageType pCreateInfo->imageType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3688 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3689 | } |
| 3690 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3691 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3692 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3693 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3694 | "vkCreateImage parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3695 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3696 | } |
| 3697 | if(pCreateInfo->tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 3698 | pCreateInfo->tiling > VK_IMAGE_TILING_END_RANGE) |
| 3699 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3700 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3701 | "vkCreateImage parameter, VkImageTiling pCreateInfo->tiling, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3702 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3703 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3704 | if(pCreateInfo->sharingMode < VK_SHARING_MODE_BEGIN_RANGE || |
| 3705 | pCreateInfo->sharingMode > VK_SHARING_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3706 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3707 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 3708 | "vkCreateImage parameter, VkSharingMode pCreateInfo->sharingMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3709 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3710 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3711 | if(pCreateInfo->pQueueFamilyIndices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3712 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3713 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3714 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3715 | |
| 3716 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3717 | } |
| 3718 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3719 | bool PostCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3720 | VkDevice device, |
| 3721 | VkImage* pImage, |
| 3722 | VkResult result) |
| 3723 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3724 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3725 | if(pImage != nullptr) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3726 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3727 | } |
| 3728 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3729 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3730 | { |
| 3731 | std::string reason = "vkCreateImage parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3732 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3733 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3734 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3735 | |
| 3736 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3737 | } |
| 3738 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3739 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImage( |
| 3740 | VkDevice device, |
| 3741 | const VkImageCreateInfo* pCreateInfo, |
| 3742 | VkImage* pImage) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3743 | { |
| 3744 | PreCreateImage(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3745 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3746 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pImage); |
| 3747 | |
| 3748 | PostCreateImage(device, pImage, result); |
| 3749 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3750 | return result; |
| 3751 | } |
| 3752 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3753 | bool PreGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3754 | VkDevice device, |
| 3755 | const VkImageSubresource* pSubresource) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3756 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3757 | if(pSubresource != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3758 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3759 | if(pSubresource->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 3760 | pSubresource->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 3761 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3762 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3763 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3764 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3765 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3766 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3767 | |
| 3768 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3769 | } |
| 3770 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3771 | bool PostGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3772 | VkDevice device, |
| 3773 | VkImage image, |
| 3774 | VkSubresourceLayout* pLayout, |
| 3775 | VkResult result) |
| 3776 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3777 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3778 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3779 | if(pLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3780 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3781 | } |
| 3782 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3783 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3784 | { |
| 3785 | std::string reason = "vkGetImageSubresourceLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3786 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3787 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3788 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3789 | |
| 3790 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3791 | } |
| 3792 | |
| 3793 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout( |
| 3794 | VkDevice device, |
| 3795 | VkImage image, |
| 3796 | const VkImageSubresource* pSubresource, |
| 3797 | VkSubresourceLayout* pLayout) |
| 3798 | { |
| 3799 | PreGetImageSubresourceLayout(device, pSubresource); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3800 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3801 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
| 3802 | |
| 3803 | PostGetImageSubresourceLayout(device, image, pLayout, result); |
| 3804 | |
| 3805 | return result; |
| 3806 | } |
| 3807 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3808 | bool PreCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3809 | VkDevice device, |
| 3810 | const VkImageViewCreateInfo* pCreateInfo) |
| 3811 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3812 | if(pCreateInfo != nullptr) |
| 3813 | { |
| 3814 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3815 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3816 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3817 | "vkCreateImageView parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3818 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3819 | } |
| 3820 | if(pCreateInfo->viewType < VK_IMAGE_VIEW_TYPE_BEGIN_RANGE || |
| 3821 | pCreateInfo->viewType > VK_IMAGE_VIEW_TYPE_END_RANGE) |
| 3822 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3823 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3824 | "vkCreateImageView parameter, VkImageViewType pCreateInfo->viewType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3825 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3826 | } |
| 3827 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3828 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3829 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3830 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3831 | "vkCreateImageView parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3832 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3833 | } |
| 3834 | if(pCreateInfo->channels.r < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 3835 | pCreateInfo->channels.r > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 3836 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3837 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3838 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.r, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3839 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3840 | } |
| 3841 | if(pCreateInfo->channels.g < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 3842 | pCreateInfo->channels.g > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 3843 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3844 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3845 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.g, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3846 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3847 | } |
| 3848 | if(pCreateInfo->channels.b < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 3849 | pCreateInfo->channels.b > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 3850 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3851 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3852 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.b, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3853 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3854 | } |
| 3855 | if(pCreateInfo->channels.a < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 3856 | pCreateInfo->channels.a > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 3857 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3858 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3859 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.a, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3860 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3861 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3862 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3863 | |
| 3864 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3865 | } |
| 3866 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3867 | bool PostCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3868 | VkDevice device, |
| 3869 | VkImageView* pView, |
| 3870 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3871 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3872 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3873 | if(pView != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3874 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3875 | } |
| 3876 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3877 | if(result < VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3878 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3879 | std::string reason = "vkCreateImageView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3880 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3881 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3882 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3883 | |
| 3884 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3885 | } |
| 3886 | |
| 3887 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImageView( |
| 3888 | VkDevice device, |
| 3889 | const VkImageViewCreateInfo* pCreateInfo, |
| 3890 | VkImageView* pView) |
| 3891 | { |
| 3892 | PreCreateImageView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3893 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3894 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pView); |
| 3895 | |
| 3896 | PostCreateImageView(device, pView, result); |
| 3897 | |
| 3898 | return result; |
| 3899 | } |
| 3900 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3901 | bool PreCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3902 | VkDevice device, |
| 3903 | const VkShaderCreateInfo* pCreateInfo) |
| 3904 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3905 | if(pCreateInfo != nullptr) |
| 3906 | { |
| 3907 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SHADER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3908 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3909 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3910 | "vkCreateShader parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3911 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3912 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3913 | if(pCreateInfo->pName != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3914 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3915 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3916 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3917 | |
| 3918 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3919 | } |
| 3920 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3921 | bool PostCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3922 | VkDevice device, |
| 3923 | VkShader* pShader, |
| 3924 | VkResult result) |
| 3925 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3926 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3927 | if(pShader != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3928 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3929 | } |
| 3930 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3931 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3932 | { |
| 3933 | std::string reason = "vkCreateShader parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3934 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3935 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3936 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3937 | |
| 3938 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3939 | } |
| 3940 | |
| 3941 | VK_LAYER_EXPORT VkResult VKAPI vkCreateShader( |
| 3942 | VkDevice device, |
| 3943 | const VkShaderCreateInfo* pCreateInfo, |
| 3944 | VkShader* pShader) |
| 3945 | { |
| 3946 | PreCreateShader(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3947 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3948 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateShader(device, pCreateInfo, pShader); |
| 3949 | |
| 3950 | PostCreateShader(device, pShader, result); |
| 3951 | |
| 3952 | return result; |
| 3953 | } |
| 3954 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3955 | bool PreCreatePipelineCache( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3956 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3957 | const VkPipelineCacheCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3958 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3959 | if(pCreateInfo != nullptr) |
| 3960 | { |
| 3961 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3962 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3963 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3964 | "vkCreatePipelineCache parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3965 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3966 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3967 | if(pCreateInfo->initialData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3968 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3969 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3970 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3971 | |
| 3972 | return true; |
| 3973 | } |
| 3974 | |
| 3975 | bool PostCreatePipelineCache( |
| 3976 | VkDevice device, |
| 3977 | VkPipelineCache* pPipelineCache, |
| 3978 | VkResult result) |
| 3979 | { |
| 3980 | |
| 3981 | if(pPipelineCache != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3982 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3983 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3984 | |
| 3985 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3986 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3987 | std::string reason = "vkCreatePipelineCache parameter, VkResult result, is " + EnumeratorString(result); |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 3988 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3989 | return false; |
| 3990 | } |
| 3991 | |
| 3992 | return true; |
| 3993 | } |
| 3994 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3995 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineCache( |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 3996 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3997 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 3998 | VkPipelineCache* pPipelineCache) |
| 3999 | { |
| 4000 | PreCreatePipelineCache(device, pCreateInfo); |
| 4001 | |
| 4002 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineCache(device, pCreateInfo, pPipelineCache); |
| 4003 | |
| 4004 | PostCreatePipelineCache(device, pPipelineCache, result); |
| 4005 | |
| 4006 | return result; |
| 4007 | } |
| 4008 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4009 | bool PostGetPipelineCacheSize( |
| 4010 | VkDevice device, |
| 4011 | VkPipelineCache pipelineCache) |
| 4012 | { |
| 4013 | |
| 4014 | |
| 4015 | return true; |
| 4016 | } |
| 4017 | |
| 4018 | VK_LAYER_EXPORT size_t VKAPI vkGetPipelineCacheSize( |
| 4019 | VkDevice device, |
| 4020 | VkPipelineCache pipelineCache) |
| 4021 | { |
Jeremy Hayes | a663c70 | 2015-07-31 12:54:58 -0600 | [diff] [blame] | 4022 | size_t result = get_dispatch_table(pc_device_table_map, device)->GetPipelineCacheSize(device, pipelineCache); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4023 | |
| 4024 | PostGetPipelineCacheSize(device, pipelineCache); |
Jeremy Hayes | a663c70 | 2015-07-31 12:54:58 -0600 | [diff] [blame] | 4025 | |
| 4026 | return result; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4027 | } |
| 4028 | |
| 4029 | bool PostGetPipelineCacheData( |
| 4030 | VkDevice device, |
| 4031 | VkPipelineCache pipelineCache, |
| 4032 | void* pData, |
| 4033 | VkResult result) |
| 4034 | { |
| 4035 | |
| 4036 | |
| 4037 | if(pData != nullptr) |
| 4038 | { |
| 4039 | } |
| 4040 | |
| 4041 | if(result < VK_SUCCESS) |
| 4042 | { |
| 4043 | std::string reason = "vkGetPipelineCacheData parameter, VkResult result, is " + EnumeratorString(result); |
| 4044 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4045 | return false; |
| 4046 | } |
| 4047 | |
| 4048 | return true; |
| 4049 | } |
| 4050 | |
| 4051 | VK_LAYER_EXPORT VkResult VKAPI vkGetPipelineCacheData( |
| 4052 | VkDevice device, |
| 4053 | VkPipelineCache pipelineCache, |
| 4054 | void* pData) |
| 4055 | { |
| 4056 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetPipelineCacheData(device, pipelineCache, pData); |
| 4057 | |
| 4058 | PostGetPipelineCacheData(device, pipelineCache, pData, result); |
| 4059 | |
| 4060 | return result; |
| 4061 | } |
| 4062 | |
| 4063 | bool PreMergePipelineCaches( |
| 4064 | VkDevice device, |
| 4065 | const VkPipelineCache* pSrcCaches) |
| 4066 | { |
| 4067 | if(pSrcCaches != nullptr) |
| 4068 | { |
| 4069 | } |
| 4070 | |
| 4071 | return true; |
| 4072 | } |
| 4073 | |
| 4074 | bool PostMergePipelineCaches( |
| 4075 | VkDevice device, |
| 4076 | VkPipelineCache destCache, |
| 4077 | uint32_t srcCacheCount, |
| 4078 | VkResult result) |
| 4079 | { |
| 4080 | |
| 4081 | |
| 4082 | |
| 4083 | if(result < VK_SUCCESS) |
| 4084 | { |
| 4085 | std::string reason = "vkMergePipelineCaches parameter, VkResult result, is " + EnumeratorString(result); |
| 4086 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4087 | return false; |
| 4088 | } |
| 4089 | |
| 4090 | return true; |
| 4091 | } |
| 4092 | |
| 4093 | VK_LAYER_EXPORT VkResult VKAPI vkMergePipelineCaches( |
| 4094 | VkDevice device, |
| 4095 | VkPipelineCache destCache, |
| 4096 | uint32_t srcCacheCount, |
| 4097 | const VkPipelineCache* pSrcCaches) |
| 4098 | { |
| 4099 | PreMergePipelineCaches(device, pSrcCaches); |
| 4100 | |
| 4101 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MergePipelineCaches(device, destCache, srcCacheCount, pSrcCaches); |
| 4102 | |
| 4103 | PostMergePipelineCaches(device, destCache, srcCacheCount, result); |
| 4104 | |
| 4105 | return result; |
| 4106 | } |
| 4107 | |
| 4108 | bool PreCreateGraphicsPipelines( |
| 4109 | VkDevice device, |
| 4110 | const VkGraphicsPipelineCreateInfo* pCreateInfos) |
| 4111 | { |
| 4112 | if(pCreateInfos != nullptr) |
| 4113 | { |
| 4114 | if(pCreateInfos->sType != VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO) |
| 4115 | { |
| 4116 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4117 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->sType, is an invalid enumerator"); |
| 4118 | return false; |
| 4119 | } |
| 4120 | if(pCreateInfos->pStages != nullptr) |
| 4121 | { |
| 4122 | if(pCreateInfos->pStages->sType != VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO) |
| 4123 | { |
| 4124 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4125 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pStages->sType, is an invalid enumerator"); |
| 4126 | return false; |
| 4127 | } |
| 4128 | if(pCreateInfos->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4129 | pCreateInfos->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4130 | { |
| 4131 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4132 | "vkCreateGraphicsPipelines parameter, VkShaderStage pCreateInfos->pStages->stage, is an unrecognized enumerator"); |
| 4133 | return false; |
| 4134 | } |
| 4135 | if(pCreateInfos->pStages->pSpecializationInfo != nullptr) |
| 4136 | { |
| 4137 | if(pCreateInfos->pStages->pSpecializationInfo->pMap != nullptr) |
| 4138 | { |
| 4139 | } |
| 4140 | if(pCreateInfos->pStages->pSpecializationInfo->pData != nullptr) |
| 4141 | { |
| 4142 | } |
| 4143 | } |
| 4144 | } |
| 4145 | if(pCreateInfos->pVertexInputState != nullptr) |
| 4146 | { |
| 4147 | if(pCreateInfos->pVertexInputState->sType != VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO) |
| 4148 | { |
| 4149 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4150 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pVertexInputState->sType, is an invalid enumerator"); |
| 4151 | return false; |
| 4152 | } |
| 4153 | if(pCreateInfos->pVertexInputState->pVertexBindingDescriptions != nullptr) |
| 4154 | { |
| 4155 | if(pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4156 | pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4157 | { |
| 4158 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4159 | "vkCreateGraphicsPipelines parameter, VkVertexInputStepRate pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate, is an unrecognized enumerator"); |
| 4160 | return false; |
| 4161 | } |
| 4162 | } |
| 4163 | if(pCreateInfos->pVertexInputState->pVertexAttributeDescriptions != nullptr) |
| 4164 | { |
| 4165 | if(pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4166 | pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4167 | { |
| 4168 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4169 | "vkCreateGraphicsPipelines parameter, VkFormat pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format, is an unrecognized enumerator"); |
| 4170 | return false; |
| 4171 | } |
| 4172 | } |
| 4173 | } |
| 4174 | if(pCreateInfos->pInputAssemblyState != nullptr) |
| 4175 | { |
| 4176 | if(pCreateInfos->pInputAssemblyState->sType != VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO) |
| 4177 | { |
| 4178 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4179 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pInputAssemblyState->sType, is an invalid enumerator"); |
| 4180 | return false; |
| 4181 | } |
| 4182 | if(pCreateInfos->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4183 | pCreateInfos->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
| 4184 | { |
| 4185 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4186 | "vkCreateGraphicsPipelines parameter, VkPrimitiveTopology pCreateInfos->pInputAssemblyState->topology, is an unrecognized enumerator"); |
| 4187 | return false; |
| 4188 | } |
| 4189 | } |
| 4190 | if(pCreateInfos->pTessellationState != nullptr) |
| 4191 | { |
| 4192 | if(pCreateInfos->pTessellationState->sType != VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO) |
| 4193 | { |
| 4194 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4195 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pTessellationState->sType, is an invalid enumerator"); |
| 4196 | return false; |
| 4197 | } |
| 4198 | } |
| 4199 | if(pCreateInfos->pViewportState != nullptr) |
| 4200 | { |
| 4201 | if(pCreateInfos->pViewportState->sType != VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO) |
| 4202 | { |
| 4203 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4204 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pViewportState->sType, is an invalid enumerator"); |
| 4205 | return false; |
| 4206 | } |
| 4207 | } |
| 4208 | if(pCreateInfos->pRasterState != nullptr) |
| 4209 | { |
| 4210 | if(pCreateInfos->pRasterState->sType != VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO) |
| 4211 | { |
| 4212 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4213 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pRasterState->sType, is an invalid enumerator"); |
| 4214 | return false; |
| 4215 | } |
| 4216 | if(pCreateInfos->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 4217 | pCreateInfos->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
| 4218 | { |
| 4219 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4220 | "vkCreateGraphicsPipelines parameter, VkFillMode pCreateInfos->pRasterState->fillMode, is an unrecognized enumerator"); |
| 4221 | return false; |
| 4222 | } |
| 4223 | if(pCreateInfos->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 4224 | pCreateInfos->pRasterState->cullMode > VK_CULL_MODE_END_RANGE) |
| 4225 | { |
| 4226 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4227 | "vkCreateGraphicsPipelines parameter, VkCullMode pCreateInfos->pRasterState->cullMode, is an unrecognized enumerator"); |
| 4228 | return false; |
| 4229 | } |
| 4230 | if(pCreateInfos->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 4231 | pCreateInfos->pRasterState->frontFace > VK_FRONT_FACE_END_RANGE) |
| 4232 | { |
| 4233 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4234 | "vkCreateGraphicsPipelines parameter, VkFrontFace pCreateInfos->pRasterState->frontFace, is an unrecognized enumerator"); |
| 4235 | return false; |
| 4236 | } |
| 4237 | } |
| 4238 | if(pCreateInfos->pMultisampleState != nullptr) |
| 4239 | { |
| 4240 | if(pCreateInfos->pMultisampleState->sType != VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO) |
| 4241 | { |
| 4242 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4243 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pMultisampleState->sType, is an invalid enumerator"); |
| 4244 | return false; |
| 4245 | } |
| 4246 | } |
| 4247 | if(pCreateInfos->pDepthStencilState != nullptr) |
| 4248 | { |
| 4249 | if(pCreateInfos->pDepthStencilState->sType != VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO) |
| 4250 | { |
| 4251 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4252 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pDepthStencilState->sType, is an invalid enumerator"); |
| 4253 | return false; |
| 4254 | } |
| 4255 | if(pCreateInfos->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4256 | pCreateInfos->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4257 | { |
| 4258 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4259 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->depthCompareOp, is an unrecognized enumerator"); |
| 4260 | return false; |
| 4261 | } |
| 4262 | if(pCreateInfos->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4263 | pCreateInfos->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 4264 | { |
| 4265 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4266 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilFailOp, is an unrecognized enumerator"); |
| 4267 | return false; |
| 4268 | } |
| 4269 | if(pCreateInfos->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4270 | pCreateInfos->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 4271 | { |
| 4272 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4273 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilPassOp, is an unrecognized enumerator"); |
| 4274 | return false; |
| 4275 | } |
| 4276 | if(pCreateInfos->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4277 | pCreateInfos->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 4278 | { |
| 4279 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4280 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilDepthFailOp, is an unrecognized enumerator"); |
| 4281 | return false; |
| 4282 | } |
| 4283 | if(pCreateInfos->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4284 | pCreateInfos->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4285 | { |
| 4286 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4287 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->front.stencilCompareOp, is an unrecognized enumerator"); |
| 4288 | return false; |
| 4289 | } |
| 4290 | if(pCreateInfos->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4291 | pCreateInfos->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 4292 | { |
| 4293 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4294 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilFailOp, is an unrecognized enumerator"); |
| 4295 | return false; |
| 4296 | } |
| 4297 | if(pCreateInfos->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4298 | pCreateInfos->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 4299 | { |
| 4300 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4301 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilPassOp, is an unrecognized enumerator"); |
| 4302 | return false; |
| 4303 | } |
| 4304 | if(pCreateInfos->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4305 | pCreateInfos->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 4306 | { |
| 4307 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4308 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilDepthFailOp, is an unrecognized enumerator"); |
| 4309 | return false; |
| 4310 | } |
| 4311 | if(pCreateInfos->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4312 | pCreateInfos->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4313 | { |
| 4314 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4315 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->back.stencilCompareOp, is an unrecognized enumerator"); |
| 4316 | return false; |
| 4317 | } |
| 4318 | } |
| 4319 | if(pCreateInfos->pColorBlendState != nullptr) |
| 4320 | { |
| 4321 | if(pCreateInfos->pColorBlendState->sType != VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO) |
| 4322 | { |
| 4323 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4324 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pColorBlendState->sType, is an invalid enumerator"); |
| 4325 | return false; |
| 4326 | } |
| 4327 | if(pCreateInfos->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 4328 | pCreateInfos->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
| 4329 | { |
| 4330 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4331 | "vkCreateGraphicsPipelines parameter, VkLogicOp pCreateInfos->pColorBlendState->logicOp, is an unrecognized enumerator"); |
| 4332 | return false; |
| 4333 | } |
| 4334 | if(pCreateInfos->pColorBlendState->pAttachments != nullptr) |
| 4335 | { |
| 4336 | if(pCreateInfos->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4337 | pCreateInfos->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
| 4338 | { |
| 4339 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4340 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->srcBlendColor, is an unrecognized enumerator"); |
| 4341 | return false; |
| 4342 | } |
| 4343 | if(pCreateInfos->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4344 | pCreateInfos->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
| 4345 | { |
| 4346 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4347 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->destBlendColor, is an unrecognized enumerator"); |
| 4348 | return false; |
| 4349 | } |
| 4350 | if(pCreateInfos->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 4351 | pCreateInfos->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
| 4352 | { |
| 4353 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4354 | "vkCreateGraphicsPipelines parameter, VkBlendOp pCreateInfos->pColorBlendState->pAttachments->blendOpColor, is an unrecognized enumerator"); |
| 4355 | return false; |
| 4356 | } |
| 4357 | if(pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4358 | pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
| 4359 | { |
| 4360 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4361 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha, is an unrecognized enumerator"); |
| 4362 | return false; |
| 4363 | } |
| 4364 | if(pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4365 | pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
| 4366 | { |
| 4367 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4368 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha, is an unrecognized enumerator"); |
| 4369 | return false; |
| 4370 | } |
| 4371 | if(pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 4372 | pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
| 4373 | { |
| 4374 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4375 | "vkCreateGraphicsPipelines parameter, VkBlendOp pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha, is an unrecognized enumerator"); |
| 4376 | return false; |
| 4377 | } |
| 4378 | } |
| 4379 | } |
Jeremy Hayes | f06ae82 | 2015-07-31 14:16:20 -0600 | [diff] [blame] | 4380 | if(pCreateInfos->renderPass == VK_NULL_HANDLE) |
| 4381 | { |
| 4382 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4383 | "vkCreateGraphicsPipelines parameter, VkRenderPass pCreateInfos->renderPass, is null pointer"); |
| 4384 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4385 | } |
| 4386 | |
| 4387 | return true; |
| 4388 | } |
| 4389 | |
| 4390 | bool PostCreateGraphicsPipelines( |
| 4391 | VkDevice device, |
| 4392 | VkPipelineCache pipelineCache, |
| 4393 | uint32_t count, |
| 4394 | VkPipeline* pPipelines, |
| 4395 | VkResult result) |
| 4396 | { |
| 4397 | |
| 4398 | |
| 4399 | |
| 4400 | if(pPipelines != nullptr) |
| 4401 | { |
| 4402 | } |
| 4403 | |
| 4404 | if(result < VK_SUCCESS) |
| 4405 | { |
| 4406 | std::string reason = "vkCreateGraphicsPipelines parameter, VkResult result, is " + EnumeratorString(result); |
| 4407 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4408 | return false; |
| 4409 | } |
| 4410 | |
| 4411 | return true; |
| 4412 | } |
| 4413 | |
| 4414 | VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines( |
| 4415 | VkDevice device, |
| 4416 | VkPipelineCache pipelineCache, |
| 4417 | uint32_t count, |
| 4418 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 4419 | VkPipeline* pPipelines) |
| 4420 | { |
| 4421 | PreCreateGraphicsPipelines(device, pCreateInfos); |
| 4422 | |
| 4423 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
| 4424 | |
| 4425 | PostCreateGraphicsPipelines(device, pipelineCache, count, pPipelines, result); |
| 4426 | |
| 4427 | return result; |
| 4428 | } |
| 4429 | |
| 4430 | bool PreCreateComputePipelines( |
| 4431 | VkDevice device, |
| 4432 | const VkComputePipelineCreateInfo* pCreateInfos) |
| 4433 | { |
| 4434 | if(pCreateInfos != nullptr) |
| 4435 | { |
| 4436 | if(pCreateInfos->sType != VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO) |
| 4437 | { |
| 4438 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4439 | "vkCreateComputePipelines parameter, VkStructureType pCreateInfos->sType, is an invalid enumerator"); |
| 4440 | return false; |
| 4441 | } |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4442 | if(pCreateInfos->stage.sType != VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4443 | { |
| 4444 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4445 | "vkCreateComputePipelines parameter, VkStructureType pCreateInfos->cs.sType, is an invalid enumerator"); |
| 4446 | return false; |
| 4447 | } |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4448 | if(pCreateInfos->stage.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4449 | pCreateInfos->stage.stage > VK_SHADER_STAGE_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4450 | { |
| 4451 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4452 | "vkCreateComputePipelines parameter, VkShaderStage pCreateInfos->cs.stage, is an unrecognized enumerator"); |
| 4453 | return false; |
| 4454 | } |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4455 | if(pCreateInfos->stage.pSpecializationInfo != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4456 | { |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4457 | if(pCreateInfos->stage.pSpecializationInfo->pMap != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4458 | { |
| 4459 | } |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4460 | if(pCreateInfos->stage.pSpecializationInfo->pData != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4461 | { |
| 4462 | } |
| 4463 | } |
| 4464 | } |
| 4465 | |
| 4466 | return true; |
| 4467 | } |
| 4468 | |
| 4469 | bool PostCreateComputePipelines( |
| 4470 | VkDevice device, |
| 4471 | VkPipelineCache pipelineCache, |
| 4472 | uint32_t count, |
| 4473 | VkPipeline* pPipelines, |
| 4474 | VkResult result) |
| 4475 | { |
| 4476 | |
| 4477 | |
| 4478 | |
| 4479 | if(pPipelines != nullptr) |
| 4480 | { |
| 4481 | } |
| 4482 | |
| 4483 | if(result < VK_SUCCESS) |
| 4484 | { |
| 4485 | std::string reason = "vkCreateComputePipelines parameter, VkResult result, is " + EnumeratorString(result); |
| 4486 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4487 | return false; |
| 4488 | } |
| 4489 | |
| 4490 | return true; |
| 4491 | } |
| 4492 | |
| 4493 | VK_LAYER_EXPORT VkResult VKAPI vkCreateComputePipelines( |
| 4494 | VkDevice device, |
| 4495 | VkPipelineCache pipelineCache, |
| 4496 | uint32_t count, |
| 4497 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 4498 | VkPipeline* pPipelines) |
| 4499 | { |
| 4500 | PreCreateComputePipelines(device, pCreateInfos); |
| 4501 | |
| 4502 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
| 4503 | |
| 4504 | PostCreateComputePipelines(device, pipelineCache, count, pPipelines, result); |
| 4505 | |
| 4506 | return result; |
| 4507 | } |
| 4508 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4509 | bool PreCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4510 | VkDevice device, |
| 4511 | const VkPipelineLayoutCreateInfo* pCreateInfo) |
| 4512 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4513 | if(pCreateInfo != nullptr) |
| 4514 | { |
| 4515 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4516 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4517 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4518 | "vkCreatePipelineLayout parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 4519 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4520 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4521 | if(pCreateInfo->pSetLayouts != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4522 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4523 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4524 | if(pCreateInfo->pPushConstantRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4525 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4526 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4527 | } |
| 4528 | |
| 4529 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4530 | } |
| 4531 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4532 | bool PostCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4533 | VkDevice device, |
| 4534 | VkPipelineLayout* pPipelineLayout, |
| 4535 | VkResult result) |
| 4536 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4537 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4538 | if(pPipelineLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4539 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4540 | } |
| 4541 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4542 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4543 | { |
| 4544 | std::string reason = "vkCreatePipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4545 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4546 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4547 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4548 | |
| 4549 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4550 | } |
| 4551 | |
| 4552 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineLayout( |
| 4553 | VkDevice device, |
| 4554 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 4555 | VkPipelineLayout* pPipelineLayout) |
| 4556 | { |
| 4557 | PreCreatePipelineLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4558 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4559 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); |
| 4560 | |
| 4561 | PostCreatePipelineLayout(device, pPipelineLayout, result); |
| 4562 | |
| 4563 | return result; |
| 4564 | } |
| 4565 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4566 | bool PreCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4567 | VkDevice device, |
| 4568 | const VkSamplerCreateInfo* pCreateInfo) |
| 4569 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4570 | if(pCreateInfo != nullptr) |
| 4571 | { |
| 4572 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4573 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4574 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4575 | "vkCreateSampler parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4576 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4577 | } |
| 4578 | if(pCreateInfo->magFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 4579 | pCreateInfo->magFilter > VK_TEX_FILTER_END_RANGE) |
| 4580 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4581 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4582 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->magFilter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4583 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4584 | } |
| 4585 | if(pCreateInfo->minFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 4586 | pCreateInfo->minFilter > VK_TEX_FILTER_END_RANGE) |
| 4587 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4588 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4589 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->minFilter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4590 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4591 | } |
| 4592 | if(pCreateInfo->mipMode < VK_TEX_MIPMAP_MODE_BEGIN_RANGE || |
| 4593 | pCreateInfo->mipMode > VK_TEX_MIPMAP_MODE_END_RANGE) |
| 4594 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4595 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4596 | "vkCreateSampler parameter, VkTexMipmapMode pCreateInfo->mipMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4597 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4598 | } |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4599 | if(pCreateInfo->addressModeU < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 4600 | pCreateInfo->addressModeU > VK_TEX_ADDRESS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4601 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4602 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4603 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressModeU, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4604 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4605 | } |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4606 | if(pCreateInfo->addressModeV < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 4607 | pCreateInfo->addressModeV > VK_TEX_ADDRESS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4608 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4609 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4610 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressModeV, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4611 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4612 | } |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4613 | if(pCreateInfo->addressModeW < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 4614 | pCreateInfo->addressModeW > VK_TEX_ADDRESS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4615 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4616 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4617 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressModeW, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4618 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4619 | } |
| 4620 | if(pCreateInfo->compareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4621 | pCreateInfo->compareOp > VK_COMPARE_OP_END_RANGE) |
| 4622 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4623 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4624 | "vkCreateSampler parameter, VkCompareOp pCreateInfo->compareOp, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4625 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4626 | } |
| 4627 | if(pCreateInfo->borderColor < VK_BORDER_COLOR_BEGIN_RANGE || |
| 4628 | pCreateInfo->borderColor > VK_BORDER_COLOR_END_RANGE) |
| 4629 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4630 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4631 | "vkCreateSampler parameter, VkBorderColor pCreateInfo->borderColor, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4632 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4633 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4634 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4635 | |
| 4636 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4637 | } |
| 4638 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4639 | bool PostCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4640 | VkDevice device, |
| 4641 | VkSampler* pSampler, |
| 4642 | VkResult result) |
| 4643 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4644 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4645 | if(pSampler != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4646 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4647 | } |
| 4648 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4649 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4650 | { |
| 4651 | std::string reason = "vkCreateSampler parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4652 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4653 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4654 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4655 | |
| 4656 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4657 | } |
| 4658 | |
| 4659 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSampler( |
| 4660 | VkDevice device, |
| 4661 | const VkSamplerCreateInfo* pCreateInfo, |
| 4662 | VkSampler* pSampler) |
| 4663 | { |
| 4664 | PreCreateSampler(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4665 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4666 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pSampler); |
| 4667 | |
| 4668 | PostCreateSampler(device, pSampler, result); |
| 4669 | |
| 4670 | return result; |
| 4671 | } |
| 4672 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4673 | bool PreCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4674 | VkDevice device, |
| 4675 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo) |
| 4676 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4677 | if(pCreateInfo != nullptr) |
| 4678 | { |
| 4679 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4680 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4681 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4682 | "vkCreateDescriptorSetLayout parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4683 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4684 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4685 | if(pCreateInfo->pBinding != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4686 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4687 | if(pCreateInfo->pBinding->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 4688 | pCreateInfo->pBinding->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 4689 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4690 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4691 | "vkCreateDescriptorSetLayout parameter, VkDescriptorType pCreateInfo->pBinding->descriptorType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4692 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4693 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4694 | if(pCreateInfo->pBinding->pImmutableSamplers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4695 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4696 | } |
| 4697 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4698 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4699 | |
| 4700 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4701 | } |
| 4702 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4703 | bool PostCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4704 | VkDevice device, |
| 4705 | VkDescriptorSetLayout* pSetLayout, |
| 4706 | VkResult result) |
| 4707 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4708 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4709 | if(pSetLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4710 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4711 | } |
| 4712 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4713 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4714 | { |
| 4715 | std::string reason = "vkCreateDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4716 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4717 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4718 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4719 | |
| 4720 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4721 | } |
| 4722 | |
| 4723 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout( |
| 4724 | VkDevice device, |
| 4725 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 4726 | VkDescriptorSetLayout* pSetLayout) |
| 4727 | { |
| 4728 | PreCreateDescriptorSetLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4729 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4730 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout); |
| 4731 | |
| 4732 | PostCreateDescriptorSetLayout(device, pSetLayout, result); |
| 4733 | |
| 4734 | return result; |
| 4735 | } |
| 4736 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4737 | bool PreCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4738 | VkDevice device, |
| 4739 | const VkDescriptorPoolCreateInfo* pCreateInfo) |
| 4740 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4741 | if(pCreateInfo != nullptr) |
| 4742 | { |
| 4743 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4744 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4745 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4746 | "vkCreateDescriptorPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4747 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4748 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4749 | if(pCreateInfo->pTypeCount != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4750 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4751 | if(pCreateInfo->pTypeCount->type < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 4752 | pCreateInfo->pTypeCount->type > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 4753 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4754 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4755 | "vkCreateDescriptorPool parameter, VkDescriptorType pCreateInfo->pTypeCount->type, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4756 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4757 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4758 | } |
| 4759 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4760 | |
| 4761 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4762 | } |
| 4763 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4764 | bool PostCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4765 | VkDevice device, |
| 4766 | VkDescriptorPoolUsage poolUsage, |
| 4767 | uint32_t maxSets, |
| 4768 | VkDescriptorPool* pDescriptorPool, |
| 4769 | VkResult result) |
| 4770 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4771 | |
| 4772 | if(poolUsage < VK_DESCRIPTOR_POOL_USAGE_BEGIN_RANGE || |
| 4773 | poolUsage > VK_DESCRIPTOR_POOL_USAGE_END_RANGE) |
| 4774 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4775 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4776 | "vkCreateDescriptorPool parameter, VkDescriptorPoolUsage poolUsage, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4777 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4778 | } |
| 4779 | |
| 4780 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4781 | if(pDescriptorPool != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4782 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4783 | } |
| 4784 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4785 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4786 | { |
| 4787 | std::string reason = "vkCreateDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4788 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4789 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4790 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4791 | |
| 4792 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4793 | } |
| 4794 | |
| 4795 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool( |
| 4796 | VkDevice device, |
| 4797 | VkDescriptorPoolUsage poolUsage, |
| 4798 | uint32_t maxSets, |
| 4799 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 4800 | VkDescriptorPool* pDescriptorPool) |
| 4801 | { |
| 4802 | PreCreateDescriptorPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4803 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4804 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool); |
| 4805 | |
| 4806 | PostCreateDescriptorPool(device, poolUsage, maxSets, pDescriptorPool, result); |
| 4807 | |
| 4808 | return result; |
| 4809 | } |
| 4810 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4811 | bool PostResetDescriptorPool( |
| 4812 | VkDevice device, |
| 4813 | VkDescriptorPool descriptorPool, |
| 4814 | VkResult result) |
| 4815 | { |
| 4816 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4817 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4818 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4819 | { |
| 4820 | std::string reason = "vkResetDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4821 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4822 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4823 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4824 | |
| 4825 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4826 | } |
| 4827 | |
| 4828 | VK_LAYER_EXPORT VkResult VKAPI vkResetDescriptorPool( |
| 4829 | VkDevice device, |
| 4830 | VkDescriptorPool descriptorPool) |
| 4831 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4832 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool); |
| 4833 | |
| 4834 | PostResetDescriptorPool(device, descriptorPool, result); |
| 4835 | |
| 4836 | return result; |
| 4837 | } |
| 4838 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4839 | bool PreAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4840 | VkDevice device, |
| 4841 | const VkDescriptorSetLayout* pSetLayouts) |
| 4842 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4843 | if(pSetLayouts != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4844 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4845 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4846 | |
| 4847 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4848 | } |
| 4849 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4850 | bool PostAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4851 | VkDevice device, |
| 4852 | VkDescriptorPool descriptorPool, |
| 4853 | VkDescriptorSetUsage setUsage, |
| 4854 | uint32_t count, |
| 4855 | VkDescriptorSet* pDescriptorSets, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4856 | VkResult result) |
| 4857 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4858 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4859 | |
| 4860 | if(setUsage < VK_DESCRIPTOR_SET_USAGE_BEGIN_RANGE || |
| 4861 | setUsage > VK_DESCRIPTOR_SET_USAGE_END_RANGE) |
| 4862 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4863 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4864 | "vkAllocDescriptorSets parameter, VkDescriptorSetUsage setUsage, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4865 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4866 | } |
| 4867 | |
| 4868 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4869 | if(pDescriptorSets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4870 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4871 | } |
| 4872 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4873 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4874 | { |
| 4875 | std::string reason = "vkAllocDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4876 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4877 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4878 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4879 | |
| 4880 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4881 | } |
| 4882 | |
| 4883 | VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets( |
| 4884 | VkDevice device, |
| 4885 | VkDescriptorPool descriptorPool, |
| 4886 | VkDescriptorSetUsage setUsage, |
| 4887 | uint32_t count, |
| 4888 | const VkDescriptorSetLayout* pSetLayouts, |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 4889 | VkDescriptorSet* pDescriptorSets) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4890 | { |
| 4891 | PreAllocDescriptorSets(device, pSetLayouts); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4892 | |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 4893 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4894 | |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 4895 | PostAllocDescriptorSets(device, descriptorPool, setUsage, count, pDescriptorSets, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4896 | |
| 4897 | return result; |
| 4898 | } |
| 4899 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4900 | bool PreFreeDescriptorSets( |
| 4901 | VkDevice device, |
| 4902 | const VkDescriptorSet* pDescriptorSets) |
| 4903 | { |
| 4904 | if(pDescriptorSets != nullptr) |
| 4905 | { |
| 4906 | } |
| 4907 | |
| 4908 | return true; |
| 4909 | } |
| 4910 | |
| 4911 | bool PostFreeDescriptorSets( |
| 4912 | VkDevice device, |
| 4913 | VkDescriptorPool descriptorPool, |
| 4914 | uint32_t count, |
| 4915 | VkResult result) |
| 4916 | { |
| 4917 | |
| 4918 | |
| 4919 | |
| 4920 | if(result < VK_SUCCESS) |
| 4921 | { |
| 4922 | std::string reason = "vkFreeDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
| 4923 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4924 | return false; |
| 4925 | } |
| 4926 | |
| 4927 | return true; |
| 4928 | } |
| 4929 | |
| 4930 | VK_LAYER_EXPORT VkResult VKAPI vkFreeDescriptorSets( |
| 4931 | VkDevice device, |
| 4932 | VkDescriptorPool descriptorPool, |
| 4933 | uint32_t count, |
| 4934 | const VkDescriptorSet* pDescriptorSets) |
| 4935 | { |
| 4936 | PreFreeDescriptorSets(device, pDescriptorSets); |
| 4937 | |
| 4938 | VkResult result = get_dispatch_table(pc_device_table_map, device)->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets); |
| 4939 | |
| 4940 | PostFreeDescriptorSets(device, descriptorPool, count, result); |
| 4941 | |
| 4942 | return result; |
| 4943 | } |
| 4944 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4945 | bool PreUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4946 | VkDevice device, |
| 4947 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 4948 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 4949 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4950 | if(pDescriptorWrites != nullptr) |
| 4951 | { |
| 4952 | if(pDescriptorWrites->sType != VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4953 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4954 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4955 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorWrites->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4956 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4957 | } |
| 4958 | if(pDescriptorWrites->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 4959 | pDescriptorWrites->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 4960 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4961 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4962 | "vkUpdateDescriptorSets parameter, VkDescriptorType pDescriptorWrites->descriptorType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4963 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4964 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4965 | if(pDescriptorWrites->pDescriptors != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4966 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4967 | if(pDescriptorWrites->pDescriptors->imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 4968 | pDescriptorWrites->pDescriptors->imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 4969 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4970 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4971 | "vkUpdateDescriptorSets parameter, VkImageLayout pDescriptorWrites->pDescriptors->imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4972 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4973 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4974 | } |
| 4975 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4976 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4977 | if(pDescriptorCopies != nullptr) |
| 4978 | { |
| 4979 | if(pDescriptorCopies->sType != VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4980 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4981 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4982 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorCopies->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4983 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4984 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4985 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4986 | |
| 4987 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4988 | } |
| 4989 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 4990 | VK_LAYER_EXPORT void VKAPI vkUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4991 | VkDevice device, |
| 4992 | uint32_t writeCount, |
| 4993 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 4994 | uint32_t copyCount, |
| 4995 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 4996 | { |
| 4997 | PreUpdateDescriptorSets(device, pDescriptorWrites, pDescriptorCopies); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4998 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 4999 | get_dispatch_table(pc_device_table_map, device)->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5000 | } |
| 5001 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5002 | bool PreCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5003 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5004 | const VkDynamicViewportStateCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5005 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5006 | if(pCreateInfo != nullptr) |
| 5007 | { |
| 5008 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_VIEWPORT_STATE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5009 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5010 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5011 | "vkCreateDynamicViewportState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5012 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5013 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5014 | if(pCreateInfo->pViewports != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5015 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5016 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5017 | if(pCreateInfo->pScissors != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5018 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5019 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5020 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5021 | |
| 5022 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5023 | } |
| 5024 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5025 | bool PostCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5026 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5027 | VkDynamicViewportState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5028 | VkResult result) |
| 5029 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5030 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5031 | if(pState != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5032 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5033 | } |
| 5034 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5035 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5036 | { |
| 5037 | std::string reason = "vkCreateDynamicViewportState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5038 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5039 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5040 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5041 | |
| 5042 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5043 | } |
| 5044 | |
| 5045 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicViewportState( |
| 5046 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5047 | const VkDynamicViewportStateCreateInfo* pCreateInfo, |
| 5048 | VkDynamicViewportState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5049 | { |
| 5050 | PreCreateDynamicViewportState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5051 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5052 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicViewportState(device, pCreateInfo, pState); |
| 5053 | |
| 5054 | PostCreateDynamicViewportState(device, pState, result); |
| 5055 | |
| 5056 | return result; |
| 5057 | } |
| 5058 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5059 | bool PreCreateDynamicLineWidthState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5060 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5061 | const VkDynamicLineWidthStateCreateInfo* pCreateInfo) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5062 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5063 | if(pCreateInfo != nullptr) |
| 5064 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5065 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_LINE_WIDTH_STATE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5066 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5067 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5068 | "vkCreateDynamicLineWidthState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5069 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5070 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5071 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5072 | |
| 5073 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5074 | } |
| 5075 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5076 | bool PostCreateDynamicLineWidthState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5077 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5078 | VkDynamicLineWidthState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5079 | VkResult result) |
| 5080 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5081 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5082 | if(pState != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5083 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5084 | } |
| 5085 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5086 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5087 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5088 | std::string reason = "vkCreateDynamicLineWidthState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5089 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5090 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5091 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5092 | |
| 5093 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5094 | } |
| 5095 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5096 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicLineWidthState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5097 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5098 | const VkDynamicLineWidthStateCreateInfo* pCreateInfo, |
| 5099 | VkDynamicLineWidthState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5100 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5101 | PreCreateDynamicLineWidthState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5102 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5103 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicLineWidthState(device, pCreateInfo, pState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5104 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5105 | PostCreateDynamicLineWidthState(device, pState, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5106 | |
| 5107 | return result; |
| 5108 | } |
| 5109 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5110 | bool PreCreateDynamicDepthBiasState( |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5111 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5112 | const VkDynamicDepthBiasStateCreateInfo* pCreateInfo) |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5113 | { |
| 5114 | if(pCreateInfo != nullptr) |
| 5115 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5116 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_BIAS_STATE_CREATE_INFO) |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5117 | { |
| 5118 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5119 | "vkCreateDynamicDepthBiasState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5120 | return false; |
| 5121 | } |
| 5122 | } |
| 5123 | |
| 5124 | return true; |
| 5125 | } |
| 5126 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5127 | bool PostCreateDynamicDepthBiasState( |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5128 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5129 | VkDynamicDepthBiasState* pState, |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5130 | VkResult result) |
| 5131 | { |
| 5132 | |
| 5133 | if(pState != nullptr) |
| 5134 | { |
| 5135 | } |
| 5136 | |
| 5137 | if(result < VK_SUCCESS) |
| 5138 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5139 | std::string reason = "vkCreateDynamicDepthBiasState parameter, VkResult result, is " + EnumeratorString(result); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5140 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5141 | return false; |
| 5142 | } |
| 5143 | |
| 5144 | return true; |
| 5145 | } |
| 5146 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5147 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicDepthBiasState( |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5148 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5149 | const VkDynamicDepthBiasStateCreateInfo* pCreateInfo, |
| 5150 | VkDynamicDepthBiasState* pState) |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5151 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5152 | PreCreateDynamicDepthBiasState(device, pCreateInfo); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5153 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5154 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicDepthBiasState(device, pCreateInfo, pState); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5155 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5156 | PostCreateDynamicDepthBiasState(device, pState, result); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5157 | |
| 5158 | return result; |
| 5159 | } |
| 5160 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5161 | bool PreCreateDynamicBlendState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5162 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5163 | const VkDynamicBlendStateCreateInfo* pCreateInfo) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5164 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5165 | if(pCreateInfo != nullptr) |
| 5166 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5167 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_BLEND_STATE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5168 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5169 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5170 | "vkCreateDynamicBlendState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5171 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5172 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5173 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5174 | |
| 5175 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5176 | } |
| 5177 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5178 | bool PostCreateDynamicBlendState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5179 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5180 | VkDynamicBlendState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5181 | VkResult result) |
| 5182 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5183 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5184 | if(pState != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5185 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5186 | } |
| 5187 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5188 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5189 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5190 | std::string reason = "vkCreateDynamicBlendState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5191 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5192 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5193 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5194 | |
| 5195 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5196 | } |
| 5197 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5198 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicBlendState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5199 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5200 | const VkDynamicBlendStateCreateInfo* pCreateInfo, |
| 5201 | VkDynamicBlendState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5202 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5203 | PreCreateDynamicBlendState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5204 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5205 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicBlendState(device, pCreateInfo, pState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5206 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5207 | PostCreateDynamicBlendState(device, pState, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5208 | |
| 5209 | return result; |
| 5210 | } |
| 5211 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5212 | bool PreCreateDynamicDepthBoundsState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5213 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5214 | const VkDynamicDepthBoundsStateCreateInfo* pCreateInfo) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5215 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5216 | if(pCreateInfo != nullptr) |
| 5217 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5218 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_BOUNDS_STATE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5219 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5220 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5221 | "vkCreateDynamicDepthBoundsState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5222 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5223 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5224 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5225 | |
| 5226 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5227 | } |
| 5228 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5229 | bool PostCreateDynamicDepthBoundsState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5230 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5231 | VkDynamicDepthBoundsState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5232 | VkResult result) |
| 5233 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5234 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5235 | if(pState != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5236 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5237 | } |
| 5238 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5239 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5240 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5241 | std::string reason = "vkCreateDynamicDepthBoundsState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5242 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5243 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5244 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5245 | |
| 5246 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5247 | } |
| 5248 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5249 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicDepthBoundsState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5250 | VkDevice device, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5251 | const VkDynamicDepthBoundsStateCreateInfo* pCreateInfo, |
| 5252 | VkDynamicDepthBoundsState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5253 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5254 | PreCreateDynamicDepthBoundsState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5255 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5256 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicDepthBoundsState(device, pCreateInfo, pState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5257 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5258 | PostCreateDynamicDepthBoundsState(device, pState, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5259 | |
| 5260 | return result; |
| 5261 | } |
| 5262 | |
Cody Northrop | 82485a8 | 2015-08-18 15:21:16 -0600 | [diff] [blame] | 5263 | bool PreCreateDynamicStencilState( |
| 5264 | VkDevice device, |
| 5265 | const VkDynamicStencilStateCreateInfo* pCreateInfoFront, |
| 5266 | const VkDynamicStencilStateCreateInfo* pCreateInfoBack) |
| 5267 | { |
| 5268 | if(pCreateInfoFront != nullptr) |
| 5269 | { |
| 5270 | if(pCreateInfoFront->sType != VK_STRUCTURE_TYPE_DYNAMIC_STENCIL_STATE_CREATE_INFO) |
| 5271 | { |
| 5272 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5273 | "vkCreateDynamicStencilState parameter, VkStructureType pCreateInfoFront->sType, is an invalid enumerator"); |
| 5274 | return false; |
| 5275 | } |
| 5276 | } |
| 5277 | |
| 5278 | if(pCreateInfoBack != nullptr) |
| 5279 | { |
| 5280 | if(pCreateInfoBack->sType != VK_STRUCTURE_TYPE_DYNAMIC_STENCIL_STATE_CREATE_INFO) |
| 5281 | { |
| 5282 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5283 | "vkCreateDynamicStencilState parameter, VkStructureType pCreateInfoBack->sType, is an invalid enumerator"); |
| 5284 | return false; |
| 5285 | } |
| 5286 | } |
| 5287 | |
| 5288 | return true; |
| 5289 | } |
| 5290 | |
| 5291 | bool PostCreateDynamicStencilState( |
| 5292 | VkDevice device, |
| 5293 | VkDynamicStencilState* pState, |
| 5294 | VkResult result) |
| 5295 | { |
| 5296 | |
| 5297 | if(pState != nullptr) |
| 5298 | { |
| 5299 | } |
| 5300 | |
| 5301 | if(result < VK_SUCCESS) |
| 5302 | { |
| 5303 | std::string reason = "vkCreateDynamicStencilState parameter, VkResult result, is " + EnumeratorString(result); |
| 5304 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5305 | return false; |
| 5306 | } |
| 5307 | |
| 5308 | return true; |
| 5309 | } |
| 5310 | |
| 5311 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicStencilState( |
| 5312 | VkDevice device, |
| 5313 | const VkDynamicStencilStateCreateInfo* pCreateInfoFront, |
| 5314 | const VkDynamicStencilStateCreateInfo* pCreateInfoBack, |
| 5315 | VkDynamicStencilState* pState) |
| 5316 | { |
| 5317 | PreCreateDynamicStencilState(device, pCreateInfoFront, pCreateInfoBack); |
| 5318 | |
| 5319 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicStencilState(device, pCreateInfoFront, pCreateInfoBack, pState); |
| 5320 | |
| 5321 | PostCreateDynamicStencilState(device, pState, result); |
| 5322 | |
| 5323 | return result; |
| 5324 | } |
| 5325 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5326 | bool PreCreateFramebuffer( |
| 5327 | VkDevice device, |
| 5328 | const VkFramebufferCreateInfo* pCreateInfo) |
| 5329 | { |
| 5330 | if(pCreateInfo != nullptr) |
| 5331 | { |
| 5332 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO) |
| 5333 | { |
| 5334 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5335 | "vkCreateFramebuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 5336 | return false; |
| 5337 | } |
| 5338 | if(pCreateInfo->pAttachments != nullptr) |
| 5339 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5340 | } |
| 5341 | } |
| 5342 | |
| 5343 | return true; |
| 5344 | } |
| 5345 | |
| 5346 | bool PostCreateFramebuffer( |
| 5347 | VkDevice device, |
| 5348 | VkFramebuffer* pFramebuffer, |
| 5349 | VkResult result) |
| 5350 | { |
| 5351 | |
| 5352 | if(pFramebuffer != nullptr) |
| 5353 | { |
| 5354 | } |
| 5355 | |
| 5356 | if(result < VK_SUCCESS) |
| 5357 | { |
| 5358 | std::string reason = "vkCreateFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 5359 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5360 | return false; |
| 5361 | } |
| 5362 | |
| 5363 | return true; |
| 5364 | } |
| 5365 | |
| 5366 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFramebuffer( |
| 5367 | VkDevice device, |
| 5368 | const VkFramebufferCreateInfo* pCreateInfo, |
| 5369 | VkFramebuffer* pFramebuffer) |
| 5370 | { |
| 5371 | PreCreateFramebuffer(device, pCreateInfo); |
| 5372 | |
| 5373 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pFramebuffer); |
| 5374 | |
| 5375 | PostCreateFramebuffer(device, pFramebuffer, result); |
| 5376 | |
| 5377 | return result; |
| 5378 | } |
| 5379 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5380 | bool PreCreateRenderPass( |
| 5381 | VkDevice device, |
| 5382 | const VkRenderPassCreateInfo* pCreateInfo) |
| 5383 | { |
| 5384 | if(pCreateInfo != nullptr) |
| 5385 | { |
| 5386 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO) |
| 5387 | { |
| 5388 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5389 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 5390 | return false; |
| 5391 | } |
| 5392 | if(pCreateInfo->pAttachments != nullptr) |
| 5393 | { |
| 5394 | if(pCreateInfo->pAttachments->sType != VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION) |
| 5395 | { |
| 5396 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5397 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pAttachments->sType, is an invalid enumerator"); |
| 5398 | return false; |
| 5399 | } |
| 5400 | if(pCreateInfo->pAttachments->format < VK_FORMAT_BEGIN_RANGE || |
| 5401 | pCreateInfo->pAttachments->format > VK_FORMAT_END_RANGE) |
| 5402 | { |
| 5403 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5404 | "vkCreateRenderPass parameter, VkFormat pCreateInfo->pAttachments->format, is an unrecognized enumerator"); |
| 5405 | return false; |
| 5406 | } |
| 5407 | if(pCreateInfo->pAttachments->loadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || |
| 5408 | pCreateInfo->pAttachments->loadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 5409 | { |
| 5410 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5411 | "vkCreateRenderPass parameter, VkAttachmentLoadOp pCreateInfo->pAttachments->loadOp, is an unrecognized enumerator"); |
| 5412 | return false; |
| 5413 | } |
| 5414 | if(pCreateInfo->pAttachments->storeOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || |
| 5415 | pCreateInfo->pAttachments->storeOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 5416 | { |
| 5417 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5418 | "vkCreateRenderPass parameter, VkAttachmentStoreOp pCreateInfo->pAttachments->storeOp, is an unrecognized enumerator"); |
| 5419 | return false; |
| 5420 | } |
| 5421 | if(pCreateInfo->pAttachments->stencilLoadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || |
| 5422 | pCreateInfo->pAttachments->stencilLoadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 5423 | { |
| 5424 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5425 | "vkCreateRenderPass parameter, VkAttachmentLoadOp pCreateInfo->pAttachments->stencilLoadOp, is an unrecognized enumerator"); |
| 5426 | return false; |
| 5427 | } |
| 5428 | if(pCreateInfo->pAttachments->stencilStoreOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || |
| 5429 | pCreateInfo->pAttachments->stencilStoreOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 5430 | { |
| 5431 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5432 | "vkCreateRenderPass parameter, VkAttachmentStoreOp pCreateInfo->pAttachments->stencilStoreOp, is an unrecognized enumerator"); |
| 5433 | return false; |
| 5434 | } |
| 5435 | if(pCreateInfo->pAttachments->initialLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5436 | pCreateInfo->pAttachments->initialLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5437 | { |
| 5438 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5439 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pAttachments->initialLayout, is an unrecognized enumerator"); |
| 5440 | return false; |
| 5441 | } |
| 5442 | if(pCreateInfo->pAttachments->finalLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5443 | pCreateInfo->pAttachments->finalLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5444 | { |
| 5445 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5446 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pAttachments->finalLayout, is an unrecognized enumerator"); |
| 5447 | return false; |
| 5448 | } |
| 5449 | } |
| 5450 | if(pCreateInfo->pSubpasses != nullptr) |
| 5451 | { |
| 5452 | if(pCreateInfo->pSubpasses->sType != VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION) |
| 5453 | { |
| 5454 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5455 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pSubpasses->sType, is an invalid enumerator"); |
| 5456 | return false; |
| 5457 | } |
| 5458 | if(pCreateInfo->pSubpasses->pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 5459 | pCreateInfo->pSubpasses->pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 5460 | { |
| 5461 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5462 | "vkCreateRenderPass parameter, VkPipelineBindPoint pCreateInfo->pSubpasses->pipelineBindPoint, is an unrecognized enumerator"); |
| 5463 | return false; |
| 5464 | } |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5465 | if(pCreateInfo->pSubpasses->pInputAttachments != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5466 | { |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5467 | if(pCreateInfo->pSubpasses->pInputAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5468 | pCreateInfo->pSubpasses->pInputAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5469 | { |
| 5470 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5471 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->pInputAttachments->layout, is an unrecognized enumerator"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5472 | return false; |
| 5473 | } |
| 5474 | } |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5475 | if(pCreateInfo->pSubpasses->pColorAttachments != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5476 | { |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5477 | if(pCreateInfo->pSubpasses->pColorAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5478 | pCreateInfo->pSubpasses->pColorAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5479 | { |
| 5480 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5481 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->pColorAttachments->layout, is an unrecognized enumerator"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5482 | return false; |
| 5483 | } |
| 5484 | } |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5485 | if(pCreateInfo->pSubpasses->pResolveAttachments != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5486 | { |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5487 | if(pCreateInfo->pSubpasses->pResolveAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5488 | pCreateInfo->pSubpasses->pResolveAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5489 | { |
| 5490 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5491 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->pResolveAttachments->layout, is an unrecognized enumerator"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5492 | return false; |
| 5493 | } |
| 5494 | } |
| 5495 | if(pCreateInfo->pSubpasses->depthStencilAttachment.layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5496 | pCreateInfo->pSubpasses->depthStencilAttachment.layout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5497 | { |
| 5498 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5499 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->depthStencilAttachment.layout, is an unrecognized enumerator"); |
| 5500 | return false; |
| 5501 | } |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5502 | if(pCreateInfo->pSubpasses->pPreserveAttachments != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5503 | { |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5504 | if(pCreateInfo->pSubpasses->pPreserveAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5505 | pCreateInfo->pSubpasses->pPreserveAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5506 | { |
| 5507 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5508 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->pPreserveAttachments->layout, is an unrecognized enumerator"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5509 | return false; |
| 5510 | } |
| 5511 | } |
| 5512 | } |
| 5513 | if(pCreateInfo->pDependencies != nullptr) |
| 5514 | { |
| 5515 | if(pCreateInfo->pDependencies->sType != VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY) |
| 5516 | { |
| 5517 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5518 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pDependencies->sType, is an invalid enumerator"); |
| 5519 | return false; |
| 5520 | } |
| 5521 | } |
| 5522 | } |
| 5523 | |
| 5524 | return true; |
| 5525 | } |
| 5526 | |
| 5527 | bool PostCreateRenderPass( |
| 5528 | VkDevice device, |
| 5529 | VkRenderPass* pRenderPass, |
| 5530 | VkResult result) |
| 5531 | { |
| 5532 | |
| 5533 | if(pRenderPass != nullptr) |
| 5534 | { |
| 5535 | } |
| 5536 | |
| 5537 | if(result < VK_SUCCESS) |
| 5538 | { |
| 5539 | std::string reason = "vkCreateRenderPass parameter, VkResult result, is " + EnumeratorString(result); |
| 5540 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5541 | return false; |
| 5542 | } |
| 5543 | |
| 5544 | return true; |
| 5545 | } |
| 5546 | |
| 5547 | VK_LAYER_EXPORT VkResult VKAPI vkCreateRenderPass( |
| 5548 | VkDevice device, |
| 5549 | const VkRenderPassCreateInfo* pCreateInfo, |
| 5550 | VkRenderPass* pRenderPass) |
| 5551 | { |
| 5552 | PreCreateRenderPass(device, pCreateInfo); |
| 5553 | |
| 5554 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pRenderPass); |
| 5555 | |
| 5556 | PostCreateRenderPass(device, pRenderPass, result); |
| 5557 | |
| 5558 | return result; |
| 5559 | } |
| 5560 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5561 | bool PostGetRenderAreaGranularity( |
| 5562 | VkDevice device, |
| 5563 | VkRenderPass renderPass, |
| 5564 | VkExtent2D* pGranularity, |
| 5565 | VkResult result) |
| 5566 | { |
| 5567 | |
| 5568 | |
| 5569 | if(pGranularity != nullptr) |
| 5570 | { |
| 5571 | } |
| 5572 | |
| 5573 | if(result < VK_SUCCESS) |
| 5574 | { |
| 5575 | std::string reason = "vkGetRenderAreaGranularity parameter, VkResult result, is " + EnumeratorString(result); |
| 5576 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5577 | return false; |
| 5578 | } |
| 5579 | |
| 5580 | return true; |
| 5581 | } |
| 5582 | |
| 5583 | VK_LAYER_EXPORT VkResult VKAPI vkGetRenderAreaGranularity( |
| 5584 | VkDevice device, |
| 5585 | VkRenderPass renderPass, |
| 5586 | VkExtent2D* pGranularity) |
| 5587 | { |
| 5588 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetRenderAreaGranularity(device, renderPass, pGranularity); |
| 5589 | |
| 5590 | PostGetRenderAreaGranularity(device, renderPass, pGranularity, result); |
| 5591 | |
| 5592 | return result; |
| 5593 | } |
| 5594 | |
| 5595 | bool PreCreateCommandPool( |
| 5596 | VkDevice device, |
| 5597 | const VkCmdPoolCreateInfo* pCreateInfo) |
| 5598 | { |
| 5599 | if(pCreateInfo != nullptr) |
| 5600 | { |
| 5601 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO) |
| 5602 | { |
| 5603 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5604 | "vkCreateCommandPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 5605 | return false; |
| 5606 | } |
| 5607 | } |
| 5608 | |
| 5609 | return true; |
| 5610 | } |
| 5611 | |
| 5612 | bool PostCreateCommandPool( |
| 5613 | VkDevice device, |
| 5614 | VkCmdPool* pCmdPool, |
| 5615 | VkResult result) |
| 5616 | { |
| 5617 | |
| 5618 | if(pCmdPool != nullptr) |
| 5619 | { |
| 5620 | } |
| 5621 | |
| 5622 | if(result < VK_SUCCESS) |
| 5623 | { |
| 5624 | std::string reason = "vkCreateCommandPool parameter, VkResult result, is " + EnumeratorString(result); |
| 5625 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5626 | return false; |
| 5627 | } |
| 5628 | |
| 5629 | return true; |
| 5630 | } |
| 5631 | |
| 5632 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandPool( |
| 5633 | VkDevice device, |
| 5634 | const VkCmdPoolCreateInfo* pCreateInfo, |
| 5635 | VkCmdPool* pCmdPool) |
| 5636 | { |
| 5637 | PreCreateCommandPool(device, pCreateInfo); |
| 5638 | |
| 5639 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandPool(device, pCreateInfo, pCmdPool); |
| 5640 | |
| 5641 | PostCreateCommandPool(device, pCmdPool, result); |
| 5642 | |
| 5643 | return result; |
| 5644 | } |
| 5645 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5646 | bool PostResetCommandPool( |
| 5647 | VkDevice device, |
| 5648 | VkCmdPool cmdPool, |
| 5649 | VkCmdPoolResetFlags flags, |
| 5650 | VkResult result) |
| 5651 | { |
| 5652 | |
| 5653 | |
| 5654 | |
| 5655 | if(result < VK_SUCCESS) |
| 5656 | { |
| 5657 | std::string reason = "vkResetCommandPool parameter, VkResult result, is " + EnumeratorString(result); |
| 5658 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5659 | return false; |
| 5660 | } |
| 5661 | |
| 5662 | return true; |
| 5663 | } |
| 5664 | |
| 5665 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandPool( |
| 5666 | VkDevice device, |
| 5667 | VkCmdPool cmdPool, |
| 5668 | VkCmdPoolResetFlags flags) |
| 5669 | { |
| 5670 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetCommandPool(device, cmdPool, flags); |
| 5671 | |
| 5672 | PostResetCommandPool(device, cmdPool, flags, result); |
| 5673 | |
| 5674 | return result; |
| 5675 | } |
| 5676 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5677 | bool PreCreateCommandBuffer( |
| 5678 | VkDevice device, |
| 5679 | const VkCmdBufferCreateInfo* pCreateInfo) |
| 5680 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5681 | if(pCreateInfo != nullptr) |
| 5682 | { |
| 5683 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5684 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5685 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5686 | "vkCreateCommandBuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5687 | return false; |
| 5688 | } |
| 5689 | if(pCreateInfo->level < VK_CMD_BUFFER_LEVEL_BEGIN_RANGE || |
| 5690 | pCreateInfo->level > VK_CMD_BUFFER_LEVEL_END_RANGE) |
| 5691 | { |
| 5692 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5693 | "vkCreateCommandBuffer parameter, VkCmdBufferLevel pCreateInfo->level, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5694 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5695 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5696 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5697 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5698 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5699 | } |
| 5700 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5701 | bool PostCreateCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5702 | VkDevice device, |
| 5703 | VkCmdBuffer* pCmdBuffer, |
| 5704 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5705 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5706 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5707 | if(pCmdBuffer != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5708 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5709 | } |
| 5710 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5711 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5712 | { |
| 5713 | std::string reason = "vkCreateCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5714 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5715 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5716 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5717 | |
| 5718 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5719 | } |
| 5720 | |
| 5721 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandBuffer( |
| 5722 | VkDevice device, |
| 5723 | const VkCmdBufferCreateInfo* pCreateInfo, |
| 5724 | VkCmdBuffer* pCmdBuffer) |
| 5725 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5726 | PreCreateCommandBuffer(device, pCreateInfo); |
| 5727 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5728 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 5729 | |
| 5730 | PostCreateCommandBuffer(device, pCmdBuffer, result); |
| 5731 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5732 | return result; |
| 5733 | } |
| 5734 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5735 | bool PreBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5736 | VkCmdBuffer cmdBuffer, |
| 5737 | const VkCmdBufferBeginInfo* pBeginInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5738 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5739 | if(pBeginInfo != nullptr) |
| 5740 | { |
| 5741 | if(pBeginInfo->sType != VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5742 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5743 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5744 | "vkBeginCommandBuffer parameter, VkStructureType pBeginInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5745 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5746 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5747 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5748 | |
| 5749 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5750 | } |
| 5751 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5752 | bool PostBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5753 | VkCmdBuffer cmdBuffer, |
| 5754 | VkResult result) |
| 5755 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5756 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5757 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5758 | { |
| 5759 | std::string reason = "vkBeginCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5760 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5761 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5762 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5763 | |
| 5764 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5765 | } |
| 5766 | |
| 5767 | VK_LAYER_EXPORT VkResult VKAPI vkBeginCommandBuffer( |
| 5768 | VkCmdBuffer cmdBuffer, |
| 5769 | const VkCmdBufferBeginInfo* pBeginInfo) |
| 5770 | { |
| 5771 | PreBeginCommandBuffer(cmdBuffer, pBeginInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5772 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5773 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->BeginCommandBuffer(cmdBuffer, pBeginInfo); |
| 5774 | |
| 5775 | PostBeginCommandBuffer(cmdBuffer, result); |
| 5776 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5777 | return result; |
| 5778 | } |
| 5779 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5780 | bool PostEndCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5781 | VkCmdBuffer cmdBuffer, |
| 5782 | VkResult result) |
| 5783 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5784 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5785 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5786 | { |
| 5787 | std::string reason = "vkEndCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5788 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5789 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5790 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5791 | |
| 5792 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5793 | } |
| 5794 | |
| 5795 | VK_LAYER_EXPORT VkResult VKAPI vkEndCommandBuffer( |
| 5796 | VkCmdBuffer cmdBuffer) |
| 5797 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5798 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->EndCommandBuffer(cmdBuffer); |
| 5799 | |
| 5800 | PostEndCommandBuffer(cmdBuffer, result); |
| 5801 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5802 | return result; |
| 5803 | } |
| 5804 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5805 | bool PostResetCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5806 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5807 | VkCmdBufferResetFlags flags, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5808 | VkResult result) |
| 5809 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5810 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5811 | |
| 5812 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5813 | { |
| 5814 | std::string reason = "vkResetCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5815 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5816 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5817 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5818 | |
| 5819 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5820 | } |
| 5821 | |
| 5822 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandBuffer( |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 5823 | VkCmdBuffer cmdBuffer, |
| 5824 | VkCmdBufferResetFlags flags) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5825 | { |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 5826 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->ResetCommandBuffer(cmdBuffer, flags); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5827 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5828 | PostResetCommandBuffer(cmdBuffer, flags, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5829 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5830 | return result; |
| 5831 | } |
| 5832 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5833 | bool PostCmdBindPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5834 | VkCmdBuffer cmdBuffer, |
| 5835 | VkPipelineBindPoint pipelineBindPoint, |
| 5836 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5837 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5838 | |
| 5839 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 5840 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 5841 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5842 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5843 | "vkCmdBindPipeline parameter, VkPipelineBindPoint pipelineBindPoint, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5844 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5845 | } |
| 5846 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5847 | |
| 5848 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5849 | } |
| 5850 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5851 | VK_LAYER_EXPORT void VKAPI vkCmdBindPipeline( |
| 5852 | VkCmdBuffer cmdBuffer, |
| 5853 | VkPipelineBindPoint pipelineBindPoint, |
| 5854 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5855 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5856 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 5857 | |
| 5858 | PostCmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 5859 | } |
| 5860 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5861 | bool PostCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5862 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5863 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5864 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5865 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5866 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5867 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5868 | } |
| 5869 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5870 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5871 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5872 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5873 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5874 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5875 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5876 | PostCmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5877 | } |
| 5878 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5879 | bool PostCmdBindDynamicLineWidthState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5880 | VkCmdBuffer cmdBuffer, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5881 | VkDynamicLineWidthState dynamicLineWidthState) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5882 | { |
| 5883 | |
| 5884 | |
| 5885 | return true; |
| 5886 | } |
| 5887 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5888 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicLineWidthState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5889 | VkCmdBuffer cmdBuffer, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5890 | VkDynamicLineWidthState dynamicLineWidthState) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5891 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5892 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicLineWidthState(cmdBuffer, dynamicLineWidthState); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5893 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5894 | PostCmdBindDynamicLineWidthState(cmdBuffer, dynamicLineWidthState); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5895 | } |
| 5896 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5897 | bool PostCmdBindDynamicDepthBiasState( |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5898 | VkCmdBuffer cmdBuffer, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5899 | VkDynamicDepthBiasState dynamicDepthBiasState) |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5900 | { |
| 5901 | |
| 5902 | |
| 5903 | return true; |
| 5904 | } |
| 5905 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5906 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicDepthBiasState( |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5907 | VkCmdBuffer cmdBuffer, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5908 | VkDynamicDepthBiasState dynamicDepthBiasState) |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5909 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5910 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicDepthBiasState(cmdBuffer, dynamicDepthBiasState); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5911 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5912 | PostCmdBindDynamicDepthBiasState(cmdBuffer, dynamicDepthBiasState); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5913 | } |
| 5914 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5915 | bool PostCmdBindDynamicBlendState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5916 | VkCmdBuffer cmdBuffer, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5917 | VkDynamicBlendState dynamicBlendState) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5918 | { |
| 5919 | |
| 5920 | |
| 5921 | return true; |
| 5922 | } |
| 5923 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5924 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicBlendState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5925 | VkCmdBuffer cmdBuffer, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5926 | VkDynamicBlendState dynamicBlendState) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5927 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5928 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicBlendState(cmdBuffer, dynamicBlendState); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5929 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5930 | PostCmdBindDynamicBlendState(cmdBuffer, dynamicBlendState); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5931 | } |
| 5932 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5933 | bool PostCmdBindDynamicDepthBoundsState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5934 | VkCmdBuffer cmdBuffer, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5935 | VkDynamicDepthBoundsState dynamicDepthBoundsState) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5936 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5937 | return true; |
| 5938 | } |
| 5939 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5940 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicDepthBoundsState( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5941 | VkCmdBuffer cmdBuffer, |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5942 | VkDynamicDepthBoundsState dynamicDepthBoundsState) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5943 | { |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5944 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicDepthBoundsState(cmdBuffer, dynamicDepthBoundsState); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5945 | |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 5946 | PostCmdBindDynamicDepthBoundsState(cmdBuffer, dynamicDepthBoundsState); |
Cody Northrop | 82485a8 | 2015-08-18 15:21:16 -0600 | [diff] [blame] | 5947 | } |
| 5948 | |
| 5949 | bool PostCmdBindDynamicStencilState( |
| 5950 | VkCmdBuffer cmdBuffer, |
| 5951 | VkDynamicStencilState dynamicStencilState) |
| 5952 | { |
| 5953 | return true; |
| 5954 | } |
| 5955 | |
| 5956 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicStencilState( |
| 5957 | VkCmdBuffer cmdBuffer, |
| 5958 | VkDynamicStencilState dynamicStencilState) |
| 5959 | { |
| 5960 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicStencilState(cmdBuffer, dynamicStencilState); |
| 5961 | |
| 5962 | PostCmdBindDynamicStencilState(cmdBuffer, dynamicStencilState); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5963 | } |
| 5964 | |
| 5965 | bool PreCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5966 | VkCmdBuffer cmdBuffer, |
| 5967 | const VkDescriptorSet* pDescriptorSets, |
| 5968 | const uint32_t* pDynamicOffsets) |
| 5969 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5970 | if(pDescriptorSets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5971 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5972 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5973 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5974 | if(pDynamicOffsets != nullptr) |
| 5975 | { |
| 5976 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5977 | |
| 5978 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5979 | } |
| 5980 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5981 | bool PostCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5982 | VkCmdBuffer cmdBuffer, |
| 5983 | VkPipelineBindPoint pipelineBindPoint, |
| 5984 | VkPipelineLayout layout, |
| 5985 | uint32_t firstSet, |
| 5986 | uint32_t setCount, |
| 5987 | uint32_t dynamicOffsetCount) |
| 5988 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5989 | |
| 5990 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 5991 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 5992 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5993 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5994 | "vkCmdBindDescriptorSets parameter, VkPipelineBindPoint pipelineBindPoint, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5995 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5996 | } |
| 5997 | |
| 5998 | |
| 5999 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6000 | |
| 6001 | |
| 6002 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6003 | } |
| 6004 | |
| 6005 | VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets( |
| 6006 | VkCmdBuffer cmdBuffer, |
| 6007 | VkPipelineBindPoint pipelineBindPoint, |
| 6008 | VkPipelineLayout layout, |
| 6009 | uint32_t firstSet, |
| 6010 | uint32_t setCount, |
| 6011 | const VkDescriptorSet* pDescriptorSets, |
| 6012 | uint32_t dynamicOffsetCount, |
| 6013 | const uint32_t* pDynamicOffsets) |
| 6014 | { |
| 6015 | PreCmdBindDescriptorSets(cmdBuffer, pDescriptorSets, pDynamicOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6016 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6017 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 6018 | |
| 6019 | PostCmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, dynamicOffsetCount); |
| 6020 | } |
| 6021 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6022 | bool PostCmdBindIndexBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6023 | VkCmdBuffer cmdBuffer, |
| 6024 | VkBuffer buffer, |
| 6025 | VkDeviceSize offset, |
| 6026 | VkIndexType indexType) |
| 6027 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6028 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6029 | |
| 6030 | |
| 6031 | if(indexType < VK_INDEX_TYPE_BEGIN_RANGE || |
| 6032 | indexType > VK_INDEX_TYPE_END_RANGE) |
| 6033 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6034 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6035 | "vkCmdBindIndexBuffer parameter, VkIndexType indexType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6036 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6037 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6038 | |
| 6039 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6040 | } |
| 6041 | |
| 6042 | VK_LAYER_EXPORT void VKAPI vkCmdBindIndexBuffer( |
| 6043 | VkCmdBuffer cmdBuffer, |
| 6044 | VkBuffer buffer, |
| 6045 | VkDeviceSize offset, |
| 6046 | VkIndexType indexType) |
| 6047 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6048 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6049 | |
| 6050 | PostCmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6051 | } |
| 6052 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6053 | bool PreCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6054 | VkCmdBuffer cmdBuffer, |
| 6055 | const VkBuffer* pBuffers, |
| 6056 | const VkDeviceSize* pOffsets) |
| 6057 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6058 | if(pBuffers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6059 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6060 | } |
| 6061 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6062 | if(pOffsets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6063 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6064 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6065 | |
| 6066 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6067 | } |
| 6068 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6069 | bool PostCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6070 | VkCmdBuffer cmdBuffer, |
| 6071 | uint32_t startBinding, |
| 6072 | uint32_t bindingCount) |
| 6073 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6074 | |
| 6075 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6076 | |
| 6077 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6078 | } |
| 6079 | |
Courtney Goeltzenleuchter | f68ad72 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 6080 | VK_LAYER_EXPORT void VKAPI vkCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6081 | VkCmdBuffer cmdBuffer, |
| 6082 | uint32_t startBinding, |
| 6083 | uint32_t bindingCount, |
| 6084 | const VkBuffer* pBuffers, |
| 6085 | const VkDeviceSize* pOffsets) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6086 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6087 | PreCmdBindVertexBuffers(cmdBuffer, pBuffers, pOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6088 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6089 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets); |
| 6090 | |
| 6091 | PostCmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6092 | } |
| 6093 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6094 | bool PostCmdDraw( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6095 | VkCmdBuffer cmdBuffer, |
| 6096 | uint32_t firstVertex, |
| 6097 | uint32_t vertexCount, |
| 6098 | uint32_t firstInstance, |
| 6099 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6100 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6101 | |
| 6102 | |
| 6103 | |
| 6104 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6105 | |
| 6106 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6107 | } |
| 6108 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6109 | VK_LAYER_EXPORT void VKAPI vkCmdDraw( |
| 6110 | VkCmdBuffer cmdBuffer, |
| 6111 | uint32_t firstVertex, |
| 6112 | uint32_t vertexCount, |
| 6113 | uint32_t firstInstance, |
| 6114 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6115 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6116 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 6117 | |
| 6118 | PostCmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6119 | } |
| 6120 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6121 | bool PostCmdDrawIndexed( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6122 | VkCmdBuffer cmdBuffer, |
| 6123 | uint32_t firstIndex, |
| 6124 | uint32_t indexCount, |
| 6125 | int32_t vertexOffset, |
| 6126 | uint32_t firstInstance, |
| 6127 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6128 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6129 | |
| 6130 | |
| 6131 | |
| 6132 | |
| 6133 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6134 | |
| 6135 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6136 | } |
| 6137 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6138 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed( |
| 6139 | VkCmdBuffer cmdBuffer, |
| 6140 | uint32_t firstIndex, |
| 6141 | uint32_t indexCount, |
| 6142 | int32_t vertexOffset, |
| 6143 | uint32_t firstInstance, |
| 6144 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6145 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6146 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 6147 | |
| 6148 | PostCmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 6149 | } |
| 6150 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6151 | bool PostCmdDrawIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6152 | VkCmdBuffer cmdBuffer, |
| 6153 | VkBuffer buffer, |
| 6154 | VkDeviceSize offset, |
| 6155 | uint32_t count, |
| 6156 | uint32_t stride) |
| 6157 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6158 | |
| 6159 | |
| 6160 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6161 | |
| 6162 | |
| 6163 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6164 | } |
| 6165 | |
| 6166 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndirect( |
| 6167 | VkCmdBuffer cmdBuffer, |
| 6168 | VkBuffer buffer, |
| 6169 | VkDeviceSize offset, |
| 6170 | uint32_t count, |
| 6171 | uint32_t stride) |
| 6172 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6173 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6174 | |
| 6175 | PostCmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6176 | } |
| 6177 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6178 | bool PostCmdDrawIndexedIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6179 | VkCmdBuffer cmdBuffer, |
| 6180 | VkBuffer buffer, |
| 6181 | VkDeviceSize offset, |
| 6182 | uint32_t count, |
| 6183 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6184 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6185 | |
| 6186 | |
| 6187 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6188 | |
| 6189 | |
| 6190 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6191 | } |
| 6192 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6193 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexedIndirect( |
| 6194 | VkCmdBuffer cmdBuffer, |
| 6195 | VkBuffer buffer, |
| 6196 | VkDeviceSize offset, |
| 6197 | uint32_t count, |
| 6198 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6199 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6200 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6201 | |
| 6202 | PostCmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6203 | } |
| 6204 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6205 | bool PostCmdDispatch( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6206 | VkCmdBuffer cmdBuffer, |
| 6207 | uint32_t x, |
| 6208 | uint32_t y, |
| 6209 | uint32_t z) |
| 6210 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6211 | |
| 6212 | |
| 6213 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6214 | |
| 6215 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6216 | } |
| 6217 | |
| 6218 | VK_LAYER_EXPORT void VKAPI vkCmdDispatch( |
| 6219 | VkCmdBuffer cmdBuffer, |
| 6220 | uint32_t x, |
| 6221 | uint32_t y, |
| 6222 | uint32_t z) |
| 6223 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6224 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatch(cmdBuffer, x, y, z); |
| 6225 | |
| 6226 | PostCmdDispatch(cmdBuffer, x, y, z); |
| 6227 | } |
| 6228 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6229 | bool PostCmdDispatchIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6230 | VkCmdBuffer cmdBuffer, |
| 6231 | VkBuffer buffer, |
| 6232 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6233 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6234 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6235 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6236 | |
| 6237 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6238 | } |
| 6239 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6240 | VK_LAYER_EXPORT void VKAPI vkCmdDispatchIndirect( |
| 6241 | VkCmdBuffer cmdBuffer, |
| 6242 | VkBuffer buffer, |
| 6243 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6244 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6245 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatchIndirect(cmdBuffer, buffer, offset); |
| 6246 | |
| 6247 | PostCmdDispatchIndirect(cmdBuffer, buffer, offset); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6248 | } |
| 6249 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6250 | bool PreCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6251 | VkCmdBuffer cmdBuffer, |
| 6252 | const VkBufferCopy* pRegions) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6253 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6254 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6255 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6256 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6257 | |
| 6258 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6259 | } |
| 6260 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6261 | bool PostCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6262 | VkCmdBuffer cmdBuffer, |
| 6263 | VkBuffer srcBuffer, |
| 6264 | VkBuffer destBuffer, |
| 6265 | uint32_t regionCount) |
| 6266 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6267 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6268 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6269 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6270 | |
| 6271 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6272 | } |
| 6273 | |
| 6274 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBuffer( |
| 6275 | VkCmdBuffer cmdBuffer, |
| 6276 | VkBuffer srcBuffer, |
| 6277 | VkBuffer destBuffer, |
| 6278 | uint32_t regionCount, |
| 6279 | const VkBufferCopy* pRegions) |
| 6280 | { |
| 6281 | PreCmdCopyBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6282 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6283 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); |
| 6284 | |
| 6285 | PostCmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount); |
| 6286 | } |
| 6287 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6288 | bool PreCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6289 | VkCmdBuffer cmdBuffer, |
| 6290 | const VkImageCopy* pRegions) |
| 6291 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6292 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6293 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6294 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6295 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6296 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6297 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6298 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6299 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6300 | } |
| 6301 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6302 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6303 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6304 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6305 | "vkCmdCopyImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6306 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6307 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6308 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6309 | |
| 6310 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6311 | } |
| 6312 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6313 | bool PostCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6314 | VkCmdBuffer cmdBuffer, |
| 6315 | VkImage srcImage, |
| 6316 | VkImageLayout srcImageLayout, |
| 6317 | VkImage destImage, |
| 6318 | VkImageLayout destImageLayout, |
| 6319 | uint32_t regionCount) |
| 6320 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6321 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6322 | |
| 6323 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6324 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6325 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6326 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6327 | "vkCmdCopyImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6328 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6329 | } |
| 6330 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6331 | |
| 6332 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6333 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6334 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6335 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6336 | "vkCmdCopyImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6337 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6338 | } |
| 6339 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6340 | |
| 6341 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6342 | } |
| 6343 | |
| 6344 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImage( |
| 6345 | VkCmdBuffer cmdBuffer, |
| 6346 | VkImage srcImage, |
| 6347 | VkImageLayout srcImageLayout, |
| 6348 | VkImage destImage, |
| 6349 | VkImageLayout destImageLayout, |
| 6350 | uint32_t regionCount, |
| 6351 | const VkImageCopy* pRegions) |
| 6352 | { |
| 6353 | PreCmdCopyImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6354 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6355 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 6356 | |
| 6357 | PostCmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 6358 | } |
| 6359 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6360 | bool PreCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6361 | VkCmdBuffer cmdBuffer, |
| 6362 | const VkImageBlit* pRegions) |
| 6363 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6364 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6365 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6366 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6367 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6368 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6369 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6370 | "vkCmdBlitImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6371 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6372 | } |
| 6373 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6374 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6375 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6376 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6377 | "vkCmdBlitImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6378 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6379 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6380 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6381 | |
| 6382 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6383 | } |
| 6384 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6385 | bool PostCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6386 | VkCmdBuffer cmdBuffer, |
| 6387 | VkImage srcImage, |
| 6388 | VkImageLayout srcImageLayout, |
| 6389 | VkImage destImage, |
| 6390 | VkImageLayout destImageLayout, |
| 6391 | uint32_t regionCount, |
| 6392 | VkTexFilter filter) |
| 6393 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6394 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6395 | |
| 6396 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6397 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6398 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6399 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6400 | "vkCmdBlitImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6401 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6402 | } |
| 6403 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6404 | |
| 6405 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6406 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6407 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6408 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6409 | "vkCmdBlitImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6410 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6411 | } |
| 6412 | |
| 6413 | |
| 6414 | if(filter < VK_TEX_FILTER_BEGIN_RANGE || |
| 6415 | filter > VK_TEX_FILTER_END_RANGE) |
| 6416 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6417 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6418 | "vkCmdBlitImage parameter, VkTexFilter filter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6419 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6420 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6421 | |
| 6422 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6423 | } |
| 6424 | |
| 6425 | VK_LAYER_EXPORT void VKAPI vkCmdBlitImage( |
| 6426 | VkCmdBuffer cmdBuffer, |
| 6427 | VkImage srcImage, |
| 6428 | VkImageLayout srcImageLayout, |
| 6429 | VkImage destImage, |
| 6430 | VkImageLayout destImageLayout, |
| 6431 | uint32_t regionCount, |
| 6432 | const VkImageBlit* pRegions, |
| 6433 | VkTexFilter filter) |
| 6434 | { |
| 6435 | PreCmdBlitImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6436 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6437 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); |
| 6438 | |
| 6439 | PostCmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, filter); |
| 6440 | } |
| 6441 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6442 | bool PreCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6443 | VkCmdBuffer cmdBuffer, |
| 6444 | const VkBufferImageCopy* pRegions) |
| 6445 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6446 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6447 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6448 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6449 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6450 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6451 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6452 | "vkCmdCopyBufferToImage parameter, VkImageAspect pRegions->imageSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6453 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6454 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6455 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6456 | |
| 6457 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6458 | } |
| 6459 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6460 | bool PostCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6461 | VkCmdBuffer cmdBuffer, |
| 6462 | VkBuffer srcBuffer, |
| 6463 | VkImage destImage, |
| 6464 | VkImageLayout destImageLayout, |
| 6465 | uint32_t regionCount) |
| 6466 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6467 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6468 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6469 | |
| 6470 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6471 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6472 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6473 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6474 | "vkCmdCopyBufferToImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6475 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6476 | } |
| 6477 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6478 | |
| 6479 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6480 | } |
| 6481 | |
| 6482 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBufferToImage( |
| 6483 | VkCmdBuffer cmdBuffer, |
| 6484 | VkBuffer srcBuffer, |
| 6485 | VkImage destImage, |
| 6486 | VkImageLayout destImageLayout, |
| 6487 | uint32_t regionCount, |
| 6488 | const VkBufferImageCopy* pRegions) |
| 6489 | { |
| 6490 | PreCmdCopyBufferToImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6491 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6492 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); |
| 6493 | |
| 6494 | PostCmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount); |
| 6495 | } |
| 6496 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6497 | bool PreCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6498 | VkCmdBuffer cmdBuffer, |
| 6499 | const VkBufferImageCopy* pRegions) |
| 6500 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6501 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6502 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6503 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6504 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6505 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6506 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6507 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6508 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6509 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6510 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6511 | |
| 6512 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6513 | } |
| 6514 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6515 | bool PostCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6516 | VkCmdBuffer cmdBuffer, |
| 6517 | VkImage srcImage, |
| 6518 | VkImageLayout srcImageLayout, |
| 6519 | VkBuffer destBuffer, |
| 6520 | uint32_t regionCount) |
| 6521 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6522 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6523 | |
| 6524 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6525 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6526 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6527 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6528 | "vkCmdCopyImageToBuffer parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6529 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6530 | } |
| 6531 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6532 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6533 | |
| 6534 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6535 | } |
| 6536 | |
| 6537 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImageToBuffer( |
| 6538 | VkCmdBuffer cmdBuffer, |
| 6539 | VkImage srcImage, |
| 6540 | VkImageLayout srcImageLayout, |
| 6541 | VkBuffer destBuffer, |
| 6542 | uint32_t regionCount, |
| 6543 | const VkBufferImageCopy* pRegions) |
| 6544 | { |
| 6545 | PreCmdCopyImageToBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6546 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6547 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); |
| 6548 | |
| 6549 | PostCmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount); |
| 6550 | } |
| 6551 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6552 | bool PreCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6553 | VkCmdBuffer cmdBuffer, |
| 6554 | const uint32_t* pData) |
| 6555 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6556 | if(pData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6557 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6558 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6559 | |
| 6560 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6561 | } |
| 6562 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6563 | bool PostCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6564 | VkCmdBuffer cmdBuffer, |
| 6565 | VkBuffer destBuffer, |
| 6566 | VkDeviceSize destOffset, |
| 6567 | VkDeviceSize dataSize) |
| 6568 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6569 | |
| 6570 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6571 | |
| 6572 | |
| 6573 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6574 | } |
| 6575 | |
| 6576 | VK_LAYER_EXPORT void VKAPI vkCmdUpdateBuffer( |
| 6577 | VkCmdBuffer cmdBuffer, |
| 6578 | VkBuffer destBuffer, |
| 6579 | VkDeviceSize destOffset, |
| 6580 | VkDeviceSize dataSize, |
| 6581 | const uint32_t* pData) |
| 6582 | { |
| 6583 | PreCmdUpdateBuffer(cmdBuffer, pData); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6584 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6585 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData); |
| 6586 | |
| 6587 | PostCmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize); |
| 6588 | } |
| 6589 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6590 | bool PostCmdFillBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6591 | VkCmdBuffer cmdBuffer, |
| 6592 | VkBuffer destBuffer, |
| 6593 | VkDeviceSize destOffset, |
| 6594 | VkDeviceSize fillSize, |
| 6595 | uint32_t data) |
| 6596 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6597 | |
| 6598 | |
| 6599 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6600 | |
| 6601 | |
| 6602 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6603 | } |
| 6604 | |
| 6605 | VK_LAYER_EXPORT void VKAPI vkCmdFillBuffer( |
| 6606 | VkCmdBuffer cmdBuffer, |
| 6607 | VkBuffer destBuffer, |
| 6608 | VkDeviceSize destOffset, |
| 6609 | VkDeviceSize fillSize, |
| 6610 | uint32_t data) |
| 6611 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6612 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 6613 | |
| 6614 | PostCmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 6615 | } |
| 6616 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6617 | bool PreCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6618 | VkCmdBuffer cmdBuffer, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 6619 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6620 | const VkImageSubresourceRange* pRanges) |
| 6621 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6622 | if(pColor != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6623 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6624 | } |
| 6625 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6626 | if(pRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6627 | { |
Courtney Goeltzenleuchter | ba72451 | 2015-09-10 17:58:54 -0600 | [diff] [blame^] | 6628 | /* TODO: How should we validate pRanges->aspectMask */ |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6629 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6630 | |
| 6631 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6632 | } |
| 6633 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6634 | bool PostCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6635 | VkCmdBuffer cmdBuffer, |
| 6636 | VkImage image, |
| 6637 | VkImageLayout imageLayout, |
| 6638 | uint32_t rangeCount) |
| 6639 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6640 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6641 | |
| 6642 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6643 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6644 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6645 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6646 | "vkCmdClearColorImage parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6647 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6648 | } |
| 6649 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6650 | |
| 6651 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6652 | } |
| 6653 | |
| 6654 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage( |
| 6655 | VkCmdBuffer cmdBuffer, |
| 6656 | VkImage image, |
| 6657 | VkImageLayout imageLayout, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 6658 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6659 | uint32_t rangeCount, |
| 6660 | const VkImageSubresourceRange* pRanges) |
| 6661 | { |
| 6662 | PreCmdClearColorImage(cmdBuffer, pColor, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6663 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6664 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 6665 | |
| 6666 | PostCmdClearColorImage(cmdBuffer, image, imageLayout, rangeCount); |
| 6667 | } |
| 6668 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6669 | bool PreCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6670 | VkCmdBuffer cmdBuffer, |
| 6671 | const VkImageSubresourceRange* pRanges) |
| 6672 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6673 | if(pRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6674 | { |
Courtney Goeltzenleuchter | ba72451 | 2015-09-10 17:58:54 -0600 | [diff] [blame^] | 6675 | /* |
| 6676 | * TODO: How do we validation pRanges->aspectMask? |
| 6677 | * Allows values are: VK_IMAGE_ASPECT_DEPTH_BIT and |
| 6678 | * VK_IMAGE_ASPECT_STENCIL_BIT. |
| 6679 | */ |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6680 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6681 | |
| 6682 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6683 | } |
| 6684 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6685 | bool PostCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6686 | VkCmdBuffer cmdBuffer, |
| 6687 | VkImage image, |
| 6688 | VkImageLayout imageLayout, |
| 6689 | float depth, |
| 6690 | uint32_t stencil, |
| 6691 | uint32_t rangeCount) |
| 6692 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6693 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6694 | |
| 6695 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6696 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6697 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6698 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6699 | "vkCmdClearDepthStencilImage parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6700 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6701 | } |
| 6702 | |
| 6703 | |
| 6704 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6705 | |
| 6706 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6707 | } |
| 6708 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 6709 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6710 | VkCmdBuffer cmdBuffer, |
| 6711 | VkImage image, |
| 6712 | VkImageLayout imageLayout, |
| 6713 | float depth, |
| 6714 | uint32_t stencil, |
| 6715 | uint32_t rangeCount, |
| 6716 | const VkImageSubresourceRange* pRanges) |
| 6717 | { |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 6718 | PreCmdClearDepthStencilImage(cmdBuffer, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6719 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 6720 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6721 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 6722 | PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6723 | } |
| 6724 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6725 | bool PreCmdClearColorAttachment( |
| 6726 | VkCmdBuffer cmdBuffer, |
| 6727 | const VkClearColorValue* pColor, |
| 6728 | const VkRect3D* pRects) |
| 6729 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6730 | if(pColor != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6731 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6732 | } |
| 6733 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6734 | if(pRects != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6735 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6736 | } |
| 6737 | |
| 6738 | return true; |
| 6739 | } |
| 6740 | |
| 6741 | bool PostCmdClearColorAttachment( |
| 6742 | VkCmdBuffer cmdBuffer, |
| 6743 | uint32_t colorAttachment, |
| 6744 | VkImageLayout imageLayout, |
| 6745 | uint32_t rectCount) |
| 6746 | { |
| 6747 | |
| 6748 | |
| 6749 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6750 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6751 | { |
| 6752 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6753 | "vkCmdClearColorAttachment parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6754 | return false; |
| 6755 | } |
| 6756 | |
| 6757 | |
| 6758 | return true; |
| 6759 | } |
| 6760 | |
| 6761 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorAttachment( |
| 6762 | VkCmdBuffer cmdBuffer, |
| 6763 | uint32_t colorAttachment, |
| 6764 | VkImageLayout imageLayout, |
| 6765 | const VkClearColorValue* pColor, |
| 6766 | uint32_t rectCount, |
| 6767 | const VkRect3D* pRects) |
| 6768 | { |
| 6769 | PreCmdClearColorAttachment(cmdBuffer, pColor, pRects); |
| 6770 | |
| 6771 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects); |
| 6772 | |
| 6773 | PostCmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, rectCount); |
| 6774 | } |
| 6775 | |
| 6776 | bool PreCmdClearDepthStencilAttachment( |
| 6777 | VkCmdBuffer cmdBuffer, |
| 6778 | const VkRect3D* pRects) |
| 6779 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6780 | if(pRects != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6781 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6782 | } |
| 6783 | |
| 6784 | return true; |
| 6785 | } |
| 6786 | |
| 6787 | bool PostCmdClearDepthStencilAttachment( |
| 6788 | VkCmdBuffer cmdBuffer, |
| 6789 | VkImageAspectFlags imageAspectMask, |
| 6790 | VkImageLayout imageLayout, |
| 6791 | float depth, |
| 6792 | uint32_t stencil, |
| 6793 | uint32_t rectCount) |
| 6794 | { |
| 6795 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6796 | |
| 6797 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6798 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6799 | { |
| 6800 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6801 | "vkCmdClearDepthStencilAttachment parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6802 | return false; |
| 6803 | } |
| 6804 | |
| 6805 | |
| 6806 | |
| 6807 | |
| 6808 | return true; |
| 6809 | } |
| 6810 | |
| 6811 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment( |
| 6812 | VkCmdBuffer cmdBuffer, |
| 6813 | VkImageAspectFlags imageAspectMask, |
| 6814 | VkImageLayout imageLayout, |
| 6815 | float depth, |
| 6816 | uint32_t stencil, |
| 6817 | uint32_t rectCount, |
| 6818 | const VkRect3D* pRects) |
| 6819 | { |
| 6820 | PreCmdClearDepthStencilAttachment(cmdBuffer, pRects); |
| 6821 | |
| 6822 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects); |
| 6823 | |
| 6824 | PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount); |
| 6825 | } |
| 6826 | |
| 6827 | bool PreCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6828 | VkCmdBuffer cmdBuffer, |
| 6829 | const VkImageResolve* pRegions) |
| 6830 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6831 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6832 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6833 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6834 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6835 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6836 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6837 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6838 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6839 | } |
| 6840 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6841 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6842 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6843 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6844 | "vkCmdResolveImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6845 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6846 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6847 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6848 | |
| 6849 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6850 | } |
| 6851 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6852 | bool PostCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6853 | VkCmdBuffer cmdBuffer, |
| 6854 | VkImage srcImage, |
| 6855 | VkImageLayout srcImageLayout, |
| 6856 | VkImage destImage, |
| 6857 | VkImageLayout destImageLayout, |
| 6858 | uint32_t regionCount) |
| 6859 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6860 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6861 | |
| 6862 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6863 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6864 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6865 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6866 | "vkCmdResolveImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6867 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6868 | } |
| 6869 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6870 | |
| 6871 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6872 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6873 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6874 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6875 | "vkCmdResolveImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6876 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6877 | } |
| 6878 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6879 | |
| 6880 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6881 | } |
| 6882 | |
| 6883 | VK_LAYER_EXPORT void VKAPI vkCmdResolveImage( |
| 6884 | VkCmdBuffer cmdBuffer, |
| 6885 | VkImage srcImage, |
| 6886 | VkImageLayout srcImageLayout, |
| 6887 | VkImage destImage, |
| 6888 | VkImageLayout destImageLayout, |
| 6889 | uint32_t regionCount, |
| 6890 | const VkImageResolve* pRegions) |
| 6891 | { |
| 6892 | PreCmdResolveImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6893 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6894 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 6895 | |
| 6896 | PostCmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 6897 | } |
| 6898 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6899 | bool PostCmdSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6900 | VkCmdBuffer cmdBuffer, |
| 6901 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6902 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6903 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6904 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6905 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6906 | |
| 6907 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6908 | } |
| 6909 | |
| 6910 | VK_LAYER_EXPORT void VKAPI vkCmdSetEvent( |
| 6911 | VkCmdBuffer cmdBuffer, |
| 6912 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6913 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6914 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6915 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6916 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6917 | PostCmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6918 | } |
| 6919 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6920 | bool PostCmdResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6921 | VkCmdBuffer cmdBuffer, |
| 6922 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6923 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6924 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6925 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6926 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6927 | |
| 6928 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6929 | } |
| 6930 | |
| 6931 | VK_LAYER_EXPORT void VKAPI vkCmdResetEvent( |
| 6932 | VkCmdBuffer cmdBuffer, |
| 6933 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6934 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6935 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6936 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6937 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6938 | PostCmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6939 | } |
| 6940 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6941 | bool PreCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6942 | VkCmdBuffer cmdBuffer, |
| 6943 | const VkEvent* pEvents, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 6944 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6945 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6946 | if(pEvents != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6947 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6948 | } |
| 6949 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6950 | if(ppMemBarriers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6951 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6952 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6953 | |
| 6954 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6955 | } |
| 6956 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6957 | bool PostCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6958 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6959 | uint32_t eventCount, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6960 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6961 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6962 | uint32_t memBarrierCount) |
| 6963 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6964 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6965 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6966 | |
| 6967 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6968 | |
| 6969 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6970 | } |
| 6971 | |
| 6972 | VK_LAYER_EXPORT void VKAPI vkCmdWaitEvents( |
| 6973 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6974 | uint32_t eventCount, |
| 6975 | const VkEvent* pEvents, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6976 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6977 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6978 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 6979 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6980 | { |
| 6981 | PreCmdWaitEvents(cmdBuffer, pEvents, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6982 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6983 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWaitEvents(cmdBuffer, eventCount, pEvents, srcStageMask, destStageMask, memBarrierCount, ppMemBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6984 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6985 | PostCmdWaitEvents(cmdBuffer, eventCount, srcStageMask, destStageMask, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6986 | } |
| 6987 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6988 | bool PreCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6989 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 6990 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6991 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6992 | if(ppMemBarriers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6993 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6994 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6995 | |
| 6996 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6997 | } |
| 6998 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6999 | bool PostCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7000 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7001 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7002 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7003 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7004 | uint32_t memBarrierCount) |
| 7005 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7006 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7007 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7008 | |
| 7009 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7010 | |
| 7011 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7012 | } |
| 7013 | |
| 7014 | VK_LAYER_EXPORT void VKAPI vkCmdPipelineBarrier( |
| 7015 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7016 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7017 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7018 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7019 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7020 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7021 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7022 | PreCmdPipelineBarrier(cmdBuffer, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7023 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7024 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount, ppMemBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7025 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7026 | PostCmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7027 | } |
| 7028 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7029 | bool PostCmdBeginQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7030 | VkCmdBuffer cmdBuffer, |
| 7031 | VkQueryPool queryPool, |
| 7032 | uint32_t slot, |
| 7033 | VkQueryControlFlags flags) |
| 7034 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7035 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7036 | |
| 7037 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7038 | |
| 7039 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7040 | } |
| 7041 | |
| 7042 | VK_LAYER_EXPORT void VKAPI vkCmdBeginQuery( |
| 7043 | VkCmdBuffer cmdBuffer, |
| 7044 | VkQueryPool queryPool, |
| 7045 | uint32_t slot, |
| 7046 | VkQueryControlFlags flags) |
| 7047 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7048 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7049 | |
| 7050 | PostCmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7051 | } |
| 7052 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7053 | bool PostCmdEndQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7054 | VkCmdBuffer cmdBuffer, |
| 7055 | VkQueryPool queryPool, |
| 7056 | uint32_t slot) |
| 7057 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7058 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7059 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7060 | |
| 7061 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7062 | } |
| 7063 | |
| 7064 | VK_LAYER_EXPORT void VKAPI vkCmdEndQuery( |
| 7065 | VkCmdBuffer cmdBuffer, |
| 7066 | VkQueryPool queryPool, |
| 7067 | uint32_t slot) |
| 7068 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7069 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndQuery(cmdBuffer, queryPool, slot); |
| 7070 | |
| 7071 | PostCmdEndQuery(cmdBuffer, queryPool, slot); |
| 7072 | } |
| 7073 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7074 | bool PostCmdResetQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7075 | VkCmdBuffer cmdBuffer, |
| 7076 | VkQueryPool queryPool, |
| 7077 | uint32_t startQuery, |
| 7078 | uint32_t queryCount) |
| 7079 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7080 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7081 | |
| 7082 | |
| 7083 | |
| 7084 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7085 | } |
| 7086 | |
| 7087 | VK_LAYER_EXPORT void VKAPI vkCmdResetQueryPool( |
| 7088 | VkCmdBuffer cmdBuffer, |
| 7089 | VkQueryPool queryPool, |
| 7090 | uint32_t startQuery, |
| 7091 | uint32_t queryCount) |
| 7092 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7093 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 7094 | |
| 7095 | PostCmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 7096 | } |
| 7097 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7098 | bool PostCmdWriteTimestamp( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7099 | VkCmdBuffer cmdBuffer, |
| 7100 | VkTimestampType timestampType, |
| 7101 | VkBuffer destBuffer, |
| 7102 | VkDeviceSize destOffset) |
| 7103 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7104 | |
| 7105 | if(timestampType < VK_TIMESTAMP_TYPE_BEGIN_RANGE || |
| 7106 | timestampType > VK_TIMESTAMP_TYPE_END_RANGE) |
| 7107 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7108 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7109 | "vkCmdWriteTimestamp parameter, VkTimestampType timestampType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7110 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7111 | } |
| 7112 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7113 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7114 | |
| 7115 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7116 | } |
| 7117 | |
| 7118 | VK_LAYER_EXPORT void VKAPI vkCmdWriteTimestamp( |
| 7119 | VkCmdBuffer cmdBuffer, |
| 7120 | VkTimestampType timestampType, |
| 7121 | VkBuffer destBuffer, |
| 7122 | VkDeviceSize destOffset) |
| 7123 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7124 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 7125 | |
| 7126 | PostCmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 7127 | } |
| 7128 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7129 | bool PostCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7130 | VkCmdBuffer cmdBuffer, |
| 7131 | VkQueryPool queryPool, |
| 7132 | uint32_t startQuery, |
| 7133 | uint32_t queryCount, |
| 7134 | VkBuffer destBuffer, |
| 7135 | VkDeviceSize destOffset, |
| 7136 | VkDeviceSize destStride, |
| 7137 | VkQueryResultFlags flags) |
| 7138 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7139 | |
| 7140 | |
| 7141 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7142 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7143 | |
| 7144 | |
| 7145 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7146 | |
| 7147 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7148 | } |
| 7149 | |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 7150 | VK_LAYER_EXPORT void VKAPI vkCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7151 | VkCmdBuffer cmdBuffer, |
| 7152 | VkQueryPool queryPool, |
| 7153 | uint32_t startQuery, |
| 7154 | uint32_t queryCount, |
| 7155 | VkBuffer destBuffer, |
| 7156 | VkDeviceSize destOffset, |
| 7157 | VkDeviceSize destStride, |
| 7158 | VkQueryResultFlags flags) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 7159 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7160 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
| 7161 | |
| 7162 | PostCmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 7163 | } |
| 7164 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7165 | bool PreCmdPushConstants( |
| 7166 | VkCmdBuffer cmdBuffer, |
| 7167 | const void* values) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7168 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7169 | if(values != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7170 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7171 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7172 | |
| 7173 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7174 | } |
| 7175 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7176 | bool PostCmdPushConstants( |
| 7177 | VkCmdBuffer cmdBuffer, |
| 7178 | VkPipelineLayout layout, |
| 7179 | VkShaderStageFlags stageFlags, |
| 7180 | uint32_t start, |
| 7181 | uint32_t length) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7182 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7183 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7184 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7185 | |
| 7186 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7187 | |
| 7188 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7189 | } |
| 7190 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7191 | VK_LAYER_EXPORT void VKAPI vkCmdPushConstants( |
| 7192 | VkCmdBuffer cmdBuffer, |
| 7193 | VkPipelineLayout layout, |
| 7194 | VkShaderStageFlags stageFlags, |
| 7195 | uint32_t start, |
| 7196 | uint32_t length, |
| 7197 | const void* values) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7198 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7199 | PreCmdPushConstants(cmdBuffer, values); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7200 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7201 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdPushConstants(cmdBuffer, layout, stageFlags, start, length, values); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7202 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7203 | PostCmdPushConstants(cmdBuffer, layout, stageFlags, start, length); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7204 | } |
| 7205 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7206 | bool PreCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7207 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7208 | const VkRenderPassBeginInfo* pRenderPassBegin) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7209 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7210 | if(pRenderPassBegin != nullptr) |
| 7211 | { |
| 7212 | if(pRenderPassBegin->sType != VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7213 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7214 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7215 | "vkCmdBeginRenderPass parameter, VkStructureType pRenderPassBegin->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7216 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 7217 | } |
Cody Northrop | 23dd89d | 2015-08-04 11:51:03 -0600 | [diff] [blame] | 7218 | if(pRenderPassBegin->pClearValues != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7219 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7220 | } |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 7221 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7222 | |
| 7223 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7224 | } |
| 7225 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7226 | bool PostCmdBeginRenderPass( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7227 | VkCmdBuffer cmdBuffer, |
| 7228 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7229 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7230 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7231 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 7232 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
| 7233 | { |
| 7234 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7235 | "vkCmdBeginRenderPass parameter, VkRenderPassContents contents, is an unrecognized enumerator"); |
| 7236 | return false; |
| 7237 | } |
| 7238 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7239 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7240 | } |
| 7241 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7242 | VK_LAYER_EXPORT void VKAPI vkCmdBeginRenderPass( |
| 7243 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7244 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 7245 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7246 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7247 | PreCmdBeginRenderPass(cmdBuffer, pRenderPassBegin); |
| 7248 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7249 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7250 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7251 | PostCmdBeginRenderPass(cmdBuffer, contents); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7252 | } |
| 7253 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7254 | bool PostCmdNextSubpass( |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7255 | VkCmdBuffer cmdBuffer, |
| 7256 | VkRenderPassContents contents) |
| 7257 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7258 | |
| 7259 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7260 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7261 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7262 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7263 | "vkCmdNextSubpass parameter, VkRenderPassContents contents, is an unrecognized enumerator"); |
| 7264 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7265 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7266 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7267 | return true; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7268 | } |
| 7269 | |
| 7270 | VK_LAYER_EXPORT void VKAPI vkCmdNextSubpass( |
| 7271 | VkCmdBuffer cmdBuffer, |
| 7272 | VkRenderPassContents contents) |
| 7273 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7274 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdNextSubpass(cmdBuffer, contents); |
| 7275 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7276 | PostCmdNextSubpass(cmdBuffer, contents); |
| 7277 | } |
| 7278 | |
| 7279 | bool PostCmdEndRenderPass( |
| 7280 | VkCmdBuffer cmdBuffer) |
| 7281 | { |
| 7282 | |
| 7283 | return true; |
| 7284 | } |
| 7285 | |
| 7286 | VK_LAYER_EXPORT void VKAPI vkCmdEndRenderPass( |
| 7287 | VkCmdBuffer cmdBuffer) |
| 7288 | { |
| 7289 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndRenderPass(cmdBuffer); |
| 7290 | |
| 7291 | PostCmdEndRenderPass(cmdBuffer); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7292 | } |
| 7293 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7294 | bool PreCmdExecuteCommands( |
| 7295 | VkCmdBuffer cmdBuffer, |
| 7296 | const VkCmdBuffer* pCmdBuffers) |
| 7297 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7298 | if(pCmdBuffers != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7299 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7300 | } |
| 7301 | |
| 7302 | return true; |
| 7303 | } |
| 7304 | |
| 7305 | bool PostCmdExecuteCommands( |
| 7306 | VkCmdBuffer cmdBuffer, |
| 7307 | uint32_t cmdBuffersCount) |
| 7308 | { |
| 7309 | |
| 7310 | |
| 7311 | return true; |
| 7312 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7313 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 7314 | VK_LAYER_EXPORT void VKAPI vkCmdExecuteCommands( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7315 | VkCmdBuffer cmdBuffer, |
| 7316 | uint32_t cmdBuffersCount, |
| 7317 | const VkCmdBuffer* pCmdBuffers) |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 7318 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7319 | PreCmdExecuteCommands(cmdBuffer, pCmdBuffers); |
| 7320 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 7321 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers); |
| 7322 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7323 | PostCmdExecuteCommands(cmdBuffer, cmdBuffersCount); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7324 | } |
| 7325 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7326 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr(VkDevice device, const char* funcName) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7327 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 7328 | if (device == NULL) { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7329 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 7330 | } |
| 7331 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 7332 | /* loader uses this to force layer initialization; device object is wrapped */ |
| 7333 | if (!strcmp(funcName, "vkGetDeviceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7334 | initDeviceTable(pc_device_table_map, (const VkBaseLayerObject *) device); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7335 | return (PFN_vkVoidFunction) vkGetDeviceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 7336 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7337 | |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 7338 | if (!strcmp(funcName, "vkCreateDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7339 | return (PFN_vkVoidFunction) vkCreateDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7340 | if (!strcmp(funcName, "vkDestroyDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7341 | return (PFN_vkVoidFunction) vkDestroyDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7342 | if (!strcmp(funcName, "vkGetDeviceQueue")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7343 | return (PFN_vkVoidFunction) vkGetDeviceQueue; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7344 | if (!strcmp(funcName, "vkQueueSubmit")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7345 | return (PFN_vkVoidFunction) vkQueueSubmit; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7346 | if (!strcmp(funcName, "vkQueueWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7347 | return (PFN_vkVoidFunction) vkQueueWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7348 | if (!strcmp(funcName, "vkDeviceWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7349 | return (PFN_vkVoidFunction) vkDeviceWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7350 | if (!strcmp(funcName, "vkAllocMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7351 | return (PFN_vkVoidFunction) vkAllocMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7352 | if (!strcmp(funcName, "vkMapMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7353 | return (PFN_vkVoidFunction) vkMapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7354 | if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7355 | return (PFN_vkVoidFunction) vkFlushMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7356 | if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7357 | return (PFN_vkVoidFunction) vkInvalidateMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7358 | if (!strcmp(funcName, "vkCreateFence")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7359 | return (PFN_vkVoidFunction) vkCreateFence; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7360 | if (!strcmp(funcName, "vkResetFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7361 | return (PFN_vkVoidFunction) vkResetFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7362 | if (!strcmp(funcName, "vkGetFenceStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7363 | return (PFN_vkVoidFunction) vkGetFenceStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7364 | if (!strcmp(funcName, "vkWaitForFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7365 | return (PFN_vkVoidFunction) vkWaitForFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7366 | if (!strcmp(funcName, "vkCreateSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7367 | return (PFN_vkVoidFunction) vkCreateSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7368 | if (!strcmp(funcName, "vkQueueSignalSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7369 | return (PFN_vkVoidFunction) vkQueueSignalSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7370 | if (!strcmp(funcName, "vkQueueWaitSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7371 | return (PFN_vkVoidFunction) vkQueueWaitSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7372 | if (!strcmp(funcName, "vkCreateEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7373 | return (PFN_vkVoidFunction) vkCreateEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7374 | if (!strcmp(funcName, "vkGetEventStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7375 | return (PFN_vkVoidFunction) vkGetEventStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7376 | if (!strcmp(funcName, "vkSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7377 | return (PFN_vkVoidFunction) vkSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7378 | if (!strcmp(funcName, "vkResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7379 | return (PFN_vkVoidFunction) vkResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7380 | if (!strcmp(funcName, "vkCreateQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7381 | return (PFN_vkVoidFunction) vkCreateQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7382 | if (!strcmp(funcName, "vkGetQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7383 | return (PFN_vkVoidFunction) vkGetQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7384 | if (!strcmp(funcName, "vkCreateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7385 | return (PFN_vkVoidFunction) vkCreateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7386 | if (!strcmp(funcName, "vkCreateBufferView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7387 | return (PFN_vkVoidFunction) vkCreateBufferView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7388 | if (!strcmp(funcName, "vkCreateImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7389 | return (PFN_vkVoidFunction) vkCreateImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7390 | if (!strcmp(funcName, "vkGetImageSubresourceLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7391 | return (PFN_vkVoidFunction) vkGetImageSubresourceLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7392 | if (!strcmp(funcName, "vkCreateImageView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7393 | return (PFN_vkVoidFunction) vkCreateImageView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7394 | if (!strcmp(funcName, "vkCreateShader")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7395 | return (PFN_vkVoidFunction) vkCreateShader; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 7396 | if (!strcmp(funcName, "vkCreateGraphicsPipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7397 | return (PFN_vkVoidFunction) vkCreateGraphicsPipelines; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 7398 | if (!strcmp(funcName, "vkCreateComputePipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7399 | return (PFN_vkVoidFunction) vkCreateComputePipelines; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7400 | if (!strcmp(funcName, "vkCreatePipelineLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7401 | return (PFN_vkVoidFunction) vkCreatePipelineLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7402 | if (!strcmp(funcName, "vkCreateSampler")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7403 | return (PFN_vkVoidFunction) vkCreateSampler; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7404 | if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7405 | return (PFN_vkVoidFunction) vkCreateDescriptorSetLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7406 | if (!strcmp(funcName, "vkCreateDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7407 | return (PFN_vkVoidFunction) vkCreateDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7408 | if (!strcmp(funcName, "vkResetDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7409 | return (PFN_vkVoidFunction) vkResetDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7410 | if (!strcmp(funcName, "vkAllocDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7411 | return (PFN_vkVoidFunction) vkAllocDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7412 | if (!strcmp(funcName, "vkCreateDynamicViewportState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7413 | return (PFN_vkVoidFunction) vkCreateDynamicViewportState; |
Cody Northrop | 271ba75 | 2015-08-26 10:01:32 -0600 | [diff] [blame] | 7414 | if (!strcmp(funcName, "vkCreateDynamicLineWidthState")) |
| 7415 | return (PFN_vkVoidFunction) vkCreateDynamicLineWidthState; |
| 7416 | if (!strcmp(funcName, "vkCreateDynamicDepthBiasState")) |
| 7417 | return (PFN_vkVoidFunction) vkCreateDynamicDepthBiasState; |
| 7418 | if (!strcmp(funcName, "vkCreateDynamicBlendState")) |
| 7419 | return (PFN_vkVoidFunction) vkCreateDynamicBlendState; |
| 7420 | if (!strcmp(funcName, "vkCreateDynamicDepthBoundsState")) |
| 7421 | return (PFN_vkVoidFunction) vkCreateDynamicDepthBoundsState; |
Cody Northrop | 82485a8 | 2015-08-18 15:21:16 -0600 | [diff] [blame] | 7422 | if (!strcmp(funcName, "vkCreateDynamicStencilState")) |
| 7423 | return (PFN_vkVoidFunction) vkCreateDynamicStencilState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7424 | if (!strcmp(funcName, "vkCreateCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7425 | return (PFN_vkVoidFunction) vkCreateCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7426 | if (!strcmp(funcName, "vkBeginCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7427 | return (PFN_vkVoidFunction) vkBeginCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7428 | if (!strcmp(funcName, "vkEndCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7429 | return (PFN_vkVoidFunction) vkEndCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7430 | if (!strcmp(funcName, "vkResetCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7431 | return (PFN_vkVoidFunction) vkResetCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7432 | if (!strcmp(funcName, "vkCmdBindPipeline")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7433 | return (PFN_vkVoidFunction) vkCmdBindPipeline; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7434 | if (!strcmp(funcName, "vkCmdBindDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7435 | return (PFN_vkVoidFunction) vkCmdBindDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7436 | if (!strcmp(funcName, "vkCmdBindVertexBuffers")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7437 | return (PFN_vkVoidFunction) vkCmdBindVertexBuffers; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7438 | if (!strcmp(funcName, "vkCmdBindIndexBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7439 | return (PFN_vkVoidFunction) vkCmdBindIndexBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7440 | if (!strcmp(funcName, "vkCmdDraw")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7441 | return (PFN_vkVoidFunction) vkCmdDraw; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7442 | if (!strcmp(funcName, "vkCmdDrawIndexed")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7443 | return (PFN_vkVoidFunction) vkCmdDrawIndexed; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7444 | if (!strcmp(funcName, "vkCmdDrawIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7445 | return (PFN_vkVoidFunction) vkCmdDrawIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7446 | if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7447 | return (PFN_vkVoidFunction) vkCmdDrawIndexedIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7448 | if (!strcmp(funcName, "vkCmdDispatch")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7449 | return (PFN_vkVoidFunction) vkCmdDispatch; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7450 | if (!strcmp(funcName, "vkCmdDispatchIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7451 | return (PFN_vkVoidFunction) vkCmdDispatchIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7452 | if (!strcmp(funcName, "vkCmdCopyBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7453 | return (PFN_vkVoidFunction) vkCmdCopyBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7454 | if (!strcmp(funcName, "vkCmdCopyImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7455 | return (PFN_vkVoidFunction) vkCmdCopyImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7456 | if (!strcmp(funcName, "vkCmdBlitImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7457 | return (PFN_vkVoidFunction) vkCmdBlitImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7458 | if (!strcmp(funcName, "vkCmdCopyBufferToImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7459 | return (PFN_vkVoidFunction) vkCmdCopyBufferToImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7460 | if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7461 | return (PFN_vkVoidFunction) vkCmdCopyImageToBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7462 | if (!strcmp(funcName, "vkCmdUpdateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7463 | return (PFN_vkVoidFunction) vkCmdUpdateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7464 | if (!strcmp(funcName, "vkCmdFillBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7465 | return (PFN_vkVoidFunction) vkCmdFillBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7466 | if (!strcmp(funcName, "vkCmdClearColorImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7467 | return (PFN_vkVoidFunction) vkCmdClearColorImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7468 | if (!strcmp(funcName, "vkCmdResolveImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7469 | return (PFN_vkVoidFunction) vkCmdResolveImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7470 | if (!strcmp(funcName, "vkCmdSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7471 | return (PFN_vkVoidFunction) vkCmdSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7472 | if (!strcmp(funcName, "vkCmdResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7473 | return (PFN_vkVoidFunction) vkCmdResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7474 | if (!strcmp(funcName, "vkCmdWaitEvents")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7475 | return (PFN_vkVoidFunction) vkCmdWaitEvents; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7476 | if (!strcmp(funcName, "vkCmdPipelineBarrier")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7477 | return (PFN_vkVoidFunction) vkCmdPipelineBarrier; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7478 | if (!strcmp(funcName, "vkCmdBeginQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7479 | return (PFN_vkVoidFunction) vkCmdBeginQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7480 | if (!strcmp(funcName, "vkCmdEndQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7481 | return (PFN_vkVoidFunction) vkCmdEndQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7482 | if (!strcmp(funcName, "vkCmdResetQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7483 | return (PFN_vkVoidFunction) vkCmdResetQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7484 | if (!strcmp(funcName, "vkCmdWriteTimestamp")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7485 | return (PFN_vkVoidFunction) vkCmdWriteTimestamp; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7486 | if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7487 | return (PFN_vkVoidFunction) vkCmdCopyQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7488 | if (!strcmp(funcName, "vkCreateFramebuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7489 | return (PFN_vkVoidFunction) vkCreateFramebuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7490 | if (!strcmp(funcName, "vkCreateRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7491 | return (PFN_vkVoidFunction) vkCreateRenderPass; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7492 | if (!strcmp(funcName, "vkCmdBeginRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7493 | return (PFN_vkVoidFunction) vkCmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7494 | if (!strcmp(funcName, "vkCmdNextSubpass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7495 | return (PFN_vkVoidFunction) vkCmdNextSubpass; |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 7496 | |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 7497 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7498 | if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7499 | return NULL; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7500 | return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7501 | } |
| 7502 | } |
| 7503 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7504 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetInstanceProcAddr(VkInstance instance, const char* funcName) |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7505 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 7506 | if (instance == NULL) { |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7507 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 7508 | } |
| 7509 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 7510 | /* loader uses this to force layer initialization; instance object is wrapped */ |
| 7511 | if (!strcmp(funcName, "vkGetInstanceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7512 | initInstanceTable(pc_instance_table_map, (const VkBaseLayerObject *) instance); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7513 | return (PFN_vkVoidFunction) vkGetInstanceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 7514 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7515 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7516 | if (!strcmp(funcName, "vkCreateInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7517 | return (PFN_vkVoidFunction) vkCreateInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7518 | if (!strcmp(funcName, "vkDestroyInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7519 | return (PFN_vkVoidFunction) vkDestroyInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7520 | if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7521 | return (PFN_vkVoidFunction) vkEnumeratePhysicalDevices; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7522 | if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7523 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7524 | if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7525 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 7526 | if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7527 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFormatProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 7528 | if (!strcmp(funcName, "vkGetGlobalLayerProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7529 | return (PFN_vkVoidFunction) vkGetGlobalLayerProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 7530 | if (!strcmp(funcName, "vkGetGlobalExtensionProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7531 | return (PFN_vkVoidFunction) vkGetGlobalExtensionProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 7532 | if (!strcmp(funcName, "vkGetPhysicalDeviceLayerProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7533 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceLayerProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 7534 | if (!strcmp(funcName, "vkGetPhysicalDeviceExtensionProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7535 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 7536 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7537 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7538 | PFN_vkVoidFunction fptr = debug_report_get_instance_proc_addr(data->report_data, funcName); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7539 | if(fptr) |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 7540 | return fptr; |
| 7541 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7542 | { |
| 7543 | if (get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr == NULL) |
| 7544 | return NULL; |
| 7545 | return get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr(instance, funcName); |
| 7546 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7547 | } |