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); |
| 61 | layer_data *data = get_my_data_ptr(get_dispatch_key(object), layer_data_map); |
| 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 |
| 65 | assert(data->report_data != NULL); |
| 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 |
| 78 | assert(data->report_data != NULL); |
| 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 | } |
| 96 | if(log_output == NULL) |
| 97 | { |
| 98 | log_output = stdout; |
| 99 | } |
| 100 | |
| 101 | layer_create_msg_callback(data->report_data, report_flags, log_callback, (void*)log_output, &data->logging_callback); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | VK_LAYER_EXPORT VkResult VKAPI vkDbgCreateMsgCallback( |
| 106 | VkInstance instance, |
| 107 | VkFlags msgFlags, |
| 108 | const PFN_vkDbgMsgCallback pfnMsgCallback, |
| 109 | void* pUserData, |
| 110 | VkDbgMsgCallback* pMsgCallback) |
| 111 | { |
| 112 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 113 | VkResult result = pTable->DbgCreateMsgCallback(instance, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 114 | |
| 115 | if (result == VK_SUCCESS) |
| 116 | { |
| 117 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 118 | result = layer_create_msg_callback(data->report_data, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 119 | } |
| 120 | |
| 121 | return result; |
| 122 | } |
| 123 | |
| 124 | VK_LAYER_EXPORT VkResult VKAPI vkDbgDestroyMsgCallback( |
| 125 | VkInstance instance, |
| 126 | VkDbgMsgCallback msgCallback) |
| 127 | { |
| 128 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 129 | VkResult result = pTable->DbgDestroyMsgCallback(instance, msgCallback); |
| 130 | |
| 131 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 132 | layer_destroy_msg_callback(data->report_data, msgCallback); |
| 133 | |
| 134 | return result; |
| 135 | } |
| 136 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 137 | static const VkLayerProperties pc_global_layers[] = { |
| 138 | { |
| 139 | "ParamChecker", |
| 140 | VK_API_VERSION, |
| 141 | VK_MAKE_VERSION(0, 1, 0), |
| 142 | "Validation layer: ParamChecker", |
| 143 | } |
| 144 | }; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 145 | |
| 146 | VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 147 | const char *pLayerName, |
| 148 | uint32_t *pCount, |
| 149 | VkExtensionProperties* pProperties) |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 150 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 151 | /* ParamChecker does not have any global extensions */ |
| 152 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 153 | } |
| 154 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 155 | VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalLayerProperties( |
| 156 | uint32_t *pCount, |
| 157 | VkLayerProperties* pProperties) |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 158 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 159 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), |
| 160 | pc_global_layers, |
| 161 | pCount, pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 162 | } |
| 163 | |
| 164 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 165 | VkPhysicalDevice physicalDevice, |
| 166 | const char* pLayerName, |
| 167 | uint32_t* pCount, |
| 168 | VkExtensionProperties* pProperties) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 169 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 170 | /* ParamChecker does not have any physical device extensions */ |
| 171 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 172 | } |
| 173 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 174 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLayerProperties( |
| 175 | VkPhysicalDevice physicalDevice, |
| 176 | uint32_t* pCount, |
| 177 | VkLayerProperties* pProperties) |
| 178 | { |
| 179 | /* ParamChecker's physical device layers are the same as global */ |
| 180 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, |
| 181 | pCount, pProperties); |
| 182 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 183 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 184 | // Version: 0.136.0 |
| 185 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 186 | static |
| 187 | std::string EnumeratorString(VkResult const& enumerator) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 188 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 189 | switch(enumerator) |
| 190 | { |
| 191 | case VK_ERROR_MEMORY_NOT_BOUND: |
| 192 | { |
| 193 | return "VK_ERROR_MEMORY_NOT_BOUND"; |
| 194 | break; |
| 195 | } |
| 196 | case VK_ERROR_BUILDING_COMMAND_BUFFER: |
| 197 | { |
| 198 | return "VK_ERROR_BUILDING_COMMAND_BUFFER"; |
| 199 | break; |
| 200 | } |
| 201 | case VK_ERROR_INCOMPATIBLE_DRIVER: |
| 202 | { |
| 203 | return "VK_ERROR_INCOMPATIBLE_DRIVER"; |
| 204 | break; |
| 205 | } |
| 206 | case VK_ERROR_MEMORY_UNMAP_FAILED: |
| 207 | { |
| 208 | return "VK_ERROR_MEMORY_UNMAP_FAILED"; |
| 209 | break; |
| 210 | } |
| 211 | case VK_ERROR_MEMORY_MAP_FAILED: |
| 212 | { |
| 213 | return "VK_ERROR_MEMORY_MAP_FAILED"; |
| 214 | break; |
| 215 | } |
| 216 | case VK_ERROR_BAD_PIPELINE_DATA: |
| 217 | { |
| 218 | return "VK_ERROR_BAD_PIPELINE_DATA"; |
| 219 | break; |
| 220 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 221 | case VK_ERROR_INVALID_QUEUE_TYPE: |
| 222 | { |
| 223 | return "VK_ERROR_INVALID_QUEUE_TYPE"; |
| 224 | break; |
| 225 | } |
| 226 | case VK_ERROR_BAD_SHADER_CODE: |
| 227 | { |
| 228 | return "VK_ERROR_BAD_SHADER_CODE"; |
| 229 | break; |
| 230 | } |
| 231 | case VK_ERROR_INVALID_IMAGE: |
| 232 | { |
| 233 | return "VK_ERROR_INVALID_IMAGE"; |
| 234 | break; |
| 235 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 236 | case VK_ERROR_INVALID_FORMAT: |
| 237 | { |
| 238 | return "VK_ERROR_INVALID_FORMAT"; |
| 239 | break; |
| 240 | } |
| 241 | case VK_ERROR_INCOMPLETE_COMMAND_BUFFER: |
| 242 | { |
| 243 | return "VK_ERROR_INCOMPLETE_COMMAND_BUFFER"; |
| 244 | break; |
| 245 | } |
| 246 | case VK_ERROR_INVALID_ALIGNMENT: |
| 247 | { |
| 248 | return "VK_ERROR_INVALID_ALIGNMENT"; |
| 249 | break; |
| 250 | } |
| 251 | case VK_ERROR_UNAVAILABLE: |
| 252 | { |
| 253 | return "VK_ERROR_UNAVAILABLE"; |
| 254 | break; |
| 255 | } |
| 256 | case VK_INCOMPLETE: |
| 257 | { |
| 258 | return "VK_INCOMPLETE"; |
| 259 | break; |
| 260 | } |
| 261 | case VK_ERROR_OUT_OF_HOST_MEMORY: |
| 262 | { |
| 263 | return "VK_ERROR_OUT_OF_HOST_MEMORY"; |
| 264 | break; |
| 265 | } |
| 266 | case VK_ERROR_UNKNOWN: |
| 267 | { |
| 268 | return "VK_ERROR_UNKNOWN"; |
| 269 | break; |
| 270 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 271 | case VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION: |
| 272 | { |
| 273 | return "VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION"; |
| 274 | break; |
| 275 | } |
| 276 | case VK_ERROR_INITIALIZATION_FAILED: |
| 277 | { |
| 278 | return "VK_ERROR_INITIALIZATION_FAILED"; |
| 279 | break; |
| 280 | } |
| 281 | case VK_NOT_READY: |
| 282 | { |
| 283 | return "VK_NOT_READY"; |
| 284 | break; |
| 285 | } |
| 286 | case VK_ERROR_INVALID_POINTER: |
| 287 | { |
| 288 | return "VK_ERROR_INVALID_POINTER"; |
| 289 | break; |
| 290 | } |
| 291 | case VK_ERROR_INVALID_VALUE: |
| 292 | { |
| 293 | return "VK_ERROR_INVALID_VALUE"; |
| 294 | break; |
| 295 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 296 | case VK_ERROR_NOT_MAPPABLE: |
| 297 | { |
| 298 | return "VK_ERROR_NOT_MAPPABLE"; |
| 299 | break; |
| 300 | } |
| 301 | case VK_ERROR_OUT_OF_DEVICE_MEMORY: |
| 302 | { |
| 303 | return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; |
| 304 | break; |
| 305 | } |
| 306 | case VK_EVENT_SET: |
| 307 | { |
| 308 | return "VK_EVENT_SET"; |
| 309 | break; |
| 310 | } |
| 311 | case VK_TIMEOUT: |
| 312 | { |
| 313 | return "VK_TIMEOUT"; |
| 314 | break; |
| 315 | } |
| 316 | case VK_ERROR_INVALID_FLAGS: |
| 317 | { |
| 318 | return "VK_ERROR_INVALID_FLAGS"; |
| 319 | break; |
| 320 | } |
| 321 | case VK_EVENT_RESET: |
| 322 | { |
| 323 | return "VK_EVENT_RESET"; |
| 324 | break; |
| 325 | } |
| 326 | case VK_ERROR_INVALID_DESCRIPTOR_SET_DATA: |
| 327 | { |
| 328 | return "VK_ERROR_INVALID_DESCRIPTOR_SET_DATA"; |
| 329 | break; |
| 330 | } |
| 331 | case VK_UNSUPPORTED: |
| 332 | { |
| 333 | return "VK_UNSUPPORTED"; |
| 334 | break; |
| 335 | } |
| 336 | case VK_ERROR_INVALID_HANDLE: |
| 337 | { |
| 338 | return "VK_ERROR_INVALID_HANDLE"; |
| 339 | break; |
| 340 | } |
| 341 | case VK_ERROR_INCOMPATIBLE_DEVICE: |
| 342 | { |
| 343 | return "VK_ERROR_INCOMPATIBLE_DEVICE"; |
| 344 | break; |
| 345 | } |
| 346 | case VK_SUCCESS: |
| 347 | { |
| 348 | return "VK_SUCCESS"; |
| 349 | break; |
| 350 | } |
| 351 | case VK_ERROR_INCOMPATIBLE_QUEUE: |
| 352 | { |
| 353 | return "VK_ERROR_INCOMPATIBLE_QUEUE"; |
| 354 | break; |
| 355 | } |
| 356 | case VK_ERROR_INVALID_EXTENSION: |
| 357 | { |
| 358 | return "VK_ERROR_INVALID_EXTENSION"; |
| 359 | break; |
| 360 | } |
| 361 | case VK_ERROR_DEVICE_ALREADY_CREATED: |
| 362 | { |
| 363 | return "VK_ERROR_DEVICE_ALREADY_CREATED"; |
| 364 | break; |
| 365 | } |
| 366 | case VK_ERROR_DEVICE_LOST: |
| 367 | { |
| 368 | return "VK_ERROR_DEVICE_LOST"; |
| 369 | break; |
| 370 | } |
| 371 | case VK_ERROR_INVALID_ORDINAL: |
| 372 | { |
| 373 | return "VK_ERROR_INVALID_ORDINAL"; |
| 374 | break; |
| 375 | } |
| 376 | case VK_ERROR_INVALID_MEMORY_SIZE: |
| 377 | { |
| 378 | return "VK_ERROR_INVALID_MEMORY_SIZE"; |
| 379 | break; |
| 380 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 381 | case VK_ERROR_INVALID_LAYER: |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 382 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 383 | return "VK_ERROR_INVALID_LAYER"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 384 | break; |
| 385 | } |
| 386 | default: |
| 387 | { |
| 388 | return "unrecognized enumerator"; |
| 389 | break; |
| 390 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 391 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | static |
| 395 | bool ValidateEnumerator(VkQueueFlagBits const& enumerator) |
| 396 | { |
| 397 | VkQueueFlagBits allFlags = (VkQueueFlagBits)(VK_QUEUE_EXTENDED_BIT | |
| 398 | VK_QUEUE_DMA_BIT | |
| 399 | VK_QUEUE_COMPUTE_BIT | |
| 400 | VK_QUEUE_SPARSE_MEMMGR_BIT | |
| 401 | VK_QUEUE_GRAPHICS_BIT); |
| 402 | if(enumerator & (~allFlags)) |
| 403 | { |
| 404 | return false; |
| 405 | } |
| 406 | |
| 407 | return true; |
| 408 | } |
| 409 | |
| 410 | static |
| 411 | std::string EnumeratorString(VkQueueFlagBits const& enumerator) |
| 412 | { |
| 413 | if(!ValidateEnumerator(enumerator)) |
| 414 | { |
| 415 | return "unrecognized enumerator"; |
| 416 | } |
| 417 | |
| 418 | std::vector<std::string> strings; |
| 419 | if(enumerator & VK_QUEUE_EXTENDED_BIT) |
| 420 | { |
| 421 | strings.push_back("VK_QUEUE_EXTENDED_BIT"); |
| 422 | } |
| 423 | if(enumerator & VK_QUEUE_DMA_BIT) |
| 424 | { |
| 425 | strings.push_back("VK_QUEUE_DMA_BIT"); |
| 426 | } |
| 427 | if(enumerator & VK_QUEUE_COMPUTE_BIT) |
| 428 | { |
| 429 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 430 | } |
| 431 | if(enumerator & VK_QUEUE_SPARSE_MEMMGR_BIT) |
| 432 | { |
| 433 | strings.push_back("VK_QUEUE_SPARSE_MEMMGR_BIT"); |
| 434 | } |
| 435 | if(enumerator & VK_QUEUE_GRAPHICS_BIT) |
| 436 | { |
| 437 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 438 | } |
| 439 | |
| 440 | std::string enumeratorString; |
| 441 | for(auto const& string : strings) |
| 442 | { |
| 443 | enumeratorString += string; |
| 444 | |
| 445 | if(string != strings.back()) |
| 446 | { |
| 447 | enumeratorString += '|'; |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | return enumeratorString; |
| 452 | } |
| 453 | |
| 454 | static |
| 455 | bool ValidateEnumerator(VkMemoryPropertyFlagBits const& enumerator) |
| 456 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 457 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)(VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 458 | VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT | |
| 459 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 460 | VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT | |
| 461 | VK_MEMORY_PROPERTY_DEVICE_ONLY); |
| 462 | if(enumerator & (~allFlags)) |
| 463 | { |
| 464 | return false; |
| 465 | } |
| 466 | |
| 467 | return true; |
| 468 | } |
| 469 | |
| 470 | static |
| 471 | std::string EnumeratorString(VkMemoryPropertyFlagBits const& enumerator) |
| 472 | { |
| 473 | if(!ValidateEnumerator(enumerator)) |
| 474 | { |
| 475 | return "unrecognized enumerator"; |
| 476 | } |
| 477 | |
| 478 | std::vector<std::string> strings; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 479 | if(enumerator & VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT) |
| 480 | { |
| 481 | strings.push_back("VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT"); |
| 482 | } |
| 483 | if(enumerator & VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT) |
| 484 | { |
| 485 | strings.push_back("VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT"); |
| 486 | } |
| 487 | if(enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) |
| 488 | { |
| 489 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 490 | } |
| 491 | if(enumerator & VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT) |
| 492 | { |
| 493 | strings.push_back("VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT"); |
| 494 | } |
| 495 | if(enumerator & VK_MEMORY_PROPERTY_DEVICE_ONLY) |
| 496 | { |
| 497 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_ONLY"); |
| 498 | } |
| 499 | |
| 500 | std::string enumeratorString; |
| 501 | for(auto const& string : strings) |
| 502 | { |
| 503 | enumeratorString += string; |
| 504 | |
| 505 | if(string != strings.back()) |
| 506 | { |
| 507 | enumeratorString += '|'; |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | return enumeratorString; |
| 512 | } |
| 513 | |
| 514 | static |
| 515 | bool ValidateEnumerator(VkMemoryOutputFlagBits const& enumerator) |
| 516 | { |
| 517 | VkMemoryOutputFlagBits allFlags = (VkMemoryOutputFlagBits)(VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 518 | VK_MEMORY_OUTPUT_TRANSFER_BIT | |
| 519 | VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT | |
| 520 | VK_MEMORY_OUTPUT_SHADER_WRITE_BIT | |
| 521 | VK_MEMORY_OUTPUT_HOST_WRITE_BIT); |
| 522 | if(enumerator & (~allFlags)) |
| 523 | { |
| 524 | return false; |
| 525 | } |
| 526 | |
| 527 | return true; |
| 528 | } |
| 529 | |
| 530 | static |
| 531 | std::string EnumeratorString(VkMemoryOutputFlagBits const& enumerator) |
| 532 | { |
| 533 | if(!ValidateEnumerator(enumerator)) |
| 534 | { |
| 535 | return "unrecognized enumerator"; |
| 536 | } |
| 537 | |
| 538 | std::vector<std::string> strings; |
| 539 | if(enumerator & VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 540 | { |
| 541 | strings.push_back("VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 542 | } |
| 543 | if(enumerator & VK_MEMORY_OUTPUT_TRANSFER_BIT) |
| 544 | { |
| 545 | strings.push_back("VK_MEMORY_OUTPUT_TRANSFER_BIT"); |
| 546 | } |
| 547 | if(enumerator & VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT) |
| 548 | { |
| 549 | strings.push_back("VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT"); |
| 550 | } |
| 551 | if(enumerator & VK_MEMORY_OUTPUT_SHADER_WRITE_BIT) |
| 552 | { |
| 553 | strings.push_back("VK_MEMORY_OUTPUT_SHADER_WRITE_BIT"); |
| 554 | } |
| 555 | if(enumerator & VK_MEMORY_OUTPUT_HOST_WRITE_BIT) |
| 556 | { |
| 557 | strings.push_back("VK_MEMORY_OUTPUT_HOST_WRITE_BIT"); |
| 558 | } |
| 559 | |
| 560 | std::string enumeratorString; |
| 561 | for(auto const& string : strings) |
| 562 | { |
| 563 | enumeratorString += string; |
| 564 | |
| 565 | if(string != strings.back()) |
| 566 | { |
| 567 | enumeratorString += '|'; |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | return enumeratorString; |
| 572 | } |
| 573 | |
| 574 | static |
| 575 | bool ValidateEnumerator(VkMemoryInputFlagBits const& enumerator) |
| 576 | { |
| 577 | VkMemoryInputFlagBits allFlags = (VkMemoryInputFlagBits)(VK_MEMORY_INPUT_TRANSFER_BIT | |
| 578 | VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 579 | VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT | |
| 580 | VK_MEMORY_INPUT_SHADER_READ_BIT | |
| 581 | VK_MEMORY_INPUT_UNIFORM_READ_BIT | |
| 582 | VK_MEMORY_INPUT_INDEX_FETCH_BIT | |
| 583 | VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT | |
| 584 | VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT | |
| 585 | VK_MEMORY_INPUT_HOST_READ_BIT); |
| 586 | if(enumerator & (~allFlags)) |
| 587 | { |
| 588 | return false; |
| 589 | } |
| 590 | |
| 591 | return true; |
| 592 | } |
| 593 | |
| 594 | static |
| 595 | std::string EnumeratorString(VkMemoryInputFlagBits const& enumerator) |
| 596 | { |
| 597 | if(!ValidateEnumerator(enumerator)) |
| 598 | { |
| 599 | return "unrecognized enumerator"; |
| 600 | } |
| 601 | |
| 602 | std::vector<std::string> strings; |
| 603 | if(enumerator & VK_MEMORY_INPUT_TRANSFER_BIT) |
| 604 | { |
| 605 | strings.push_back("VK_MEMORY_INPUT_TRANSFER_BIT"); |
| 606 | } |
| 607 | if(enumerator & VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 608 | { |
| 609 | strings.push_back("VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 610 | } |
| 611 | if(enumerator & VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT) |
| 612 | { |
| 613 | strings.push_back("VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT"); |
| 614 | } |
| 615 | if(enumerator & VK_MEMORY_INPUT_SHADER_READ_BIT) |
| 616 | { |
| 617 | strings.push_back("VK_MEMORY_INPUT_SHADER_READ_BIT"); |
| 618 | } |
| 619 | if(enumerator & VK_MEMORY_INPUT_UNIFORM_READ_BIT) |
| 620 | { |
| 621 | strings.push_back("VK_MEMORY_INPUT_UNIFORM_READ_BIT"); |
| 622 | } |
| 623 | if(enumerator & VK_MEMORY_INPUT_INDEX_FETCH_BIT) |
| 624 | { |
| 625 | strings.push_back("VK_MEMORY_INPUT_INDEX_FETCH_BIT"); |
| 626 | } |
| 627 | if(enumerator & VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT) |
| 628 | { |
| 629 | strings.push_back("VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT"); |
| 630 | } |
| 631 | if(enumerator & VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT) |
| 632 | { |
| 633 | strings.push_back("VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT"); |
| 634 | } |
| 635 | if(enumerator & VK_MEMORY_INPUT_HOST_READ_BIT) |
| 636 | { |
| 637 | strings.push_back("VK_MEMORY_INPUT_HOST_READ_BIT"); |
| 638 | } |
| 639 | |
| 640 | std::string enumeratorString; |
| 641 | for(auto const& string : strings) |
| 642 | { |
| 643 | enumeratorString += string; |
| 644 | |
| 645 | if(string != strings.back()) |
| 646 | { |
| 647 | enumeratorString += '|'; |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | return enumeratorString; |
| 652 | } |
| 653 | |
| 654 | static |
| 655 | bool ValidateEnumerator(VkBufferUsageFlagBits const& enumerator) |
| 656 | { |
| 657 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | |
| 658 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | |
| 659 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 660 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | |
| 661 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | |
| 662 | VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT | |
| 663 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | |
| 664 | VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT | |
| 665 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | |
| 666 | VK_BUFFER_USAGE_GENERAL); |
| 667 | if(enumerator & (~allFlags)) |
| 668 | { |
| 669 | return false; |
| 670 | } |
| 671 | |
| 672 | return true; |
| 673 | } |
| 674 | |
| 675 | static |
| 676 | std::string EnumeratorString(VkBufferUsageFlagBits const& enumerator) |
| 677 | { |
| 678 | if(!ValidateEnumerator(enumerator)) |
| 679 | { |
| 680 | return "unrecognized enumerator"; |
| 681 | } |
| 682 | |
| 683 | std::vector<std::string> strings; |
| 684 | if(enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) |
| 685 | { |
| 686 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 687 | } |
| 688 | if(enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) |
| 689 | { |
| 690 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 691 | } |
| 692 | if(enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) |
| 693 | { |
| 694 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 695 | } |
| 696 | if(enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) |
| 697 | { |
| 698 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 699 | } |
| 700 | if(enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) |
| 701 | { |
| 702 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 703 | } |
| 704 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT) |
| 705 | { |
| 706 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT"); |
| 707 | } |
| 708 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) |
| 709 | { |
| 710 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 711 | } |
| 712 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT) |
| 713 | { |
| 714 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT"); |
| 715 | } |
| 716 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) |
| 717 | { |
| 718 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 719 | } |
| 720 | if(enumerator & VK_BUFFER_USAGE_GENERAL) |
| 721 | { |
| 722 | strings.push_back("VK_BUFFER_USAGE_GENERAL"); |
| 723 | } |
| 724 | |
| 725 | std::string enumeratorString; |
| 726 | for(auto const& string : strings) |
| 727 | { |
| 728 | enumeratorString += string; |
| 729 | |
| 730 | if(string != strings.back()) |
| 731 | { |
| 732 | enumeratorString += '|'; |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | return enumeratorString; |
| 737 | } |
| 738 | |
| 739 | static |
| 740 | bool ValidateEnumerator(VkBufferCreateFlagBits const& enumerator) |
| 741 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 742 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)(VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | |
| 743 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | |
| 744 | VK_BUFFER_CREATE_SPARSE_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 745 | if(enumerator & (~allFlags)) |
| 746 | { |
| 747 | return false; |
| 748 | } |
| 749 | |
| 750 | return true; |
| 751 | } |
| 752 | |
| 753 | static |
| 754 | std::string EnumeratorString(VkBufferCreateFlagBits const& enumerator) |
| 755 | { |
| 756 | if(!ValidateEnumerator(enumerator)) |
| 757 | { |
| 758 | return "unrecognized enumerator"; |
| 759 | } |
| 760 | |
| 761 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 762 | if(enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) |
| 763 | { |
| 764 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 765 | } |
| 766 | if(enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) |
| 767 | { |
| 768 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 769 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 770 | if(enumerator & VK_BUFFER_CREATE_SPARSE_BIT) |
| 771 | { |
| 772 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BIT"); |
| 773 | } |
| 774 | |
| 775 | std::string enumeratorString; |
| 776 | for(auto const& string : strings) |
| 777 | { |
| 778 | enumeratorString += string; |
| 779 | |
| 780 | if(string != strings.back()) |
| 781 | { |
| 782 | enumeratorString += '|'; |
| 783 | } |
| 784 | } |
| 785 | |
| 786 | return enumeratorString; |
| 787 | } |
| 788 | |
| 789 | static |
| 790 | bool ValidateEnumerator(VkShaderStageFlagBits const& enumerator) |
| 791 | { |
| 792 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)(VK_SHADER_STAGE_ALL | |
| 793 | VK_SHADER_STAGE_FRAGMENT_BIT | |
| 794 | VK_SHADER_STAGE_GEOMETRY_BIT | |
| 795 | VK_SHADER_STAGE_COMPUTE_BIT | |
| 796 | VK_SHADER_STAGE_TESS_EVALUATION_BIT | |
| 797 | VK_SHADER_STAGE_TESS_CONTROL_BIT | |
| 798 | VK_SHADER_STAGE_VERTEX_BIT); |
| 799 | if(enumerator & (~allFlags)) |
| 800 | { |
| 801 | return false; |
| 802 | } |
| 803 | |
| 804 | return true; |
| 805 | } |
| 806 | |
| 807 | static |
| 808 | std::string EnumeratorString(VkShaderStageFlagBits const& enumerator) |
| 809 | { |
| 810 | if(!ValidateEnumerator(enumerator)) |
| 811 | { |
| 812 | return "unrecognized enumerator"; |
| 813 | } |
| 814 | |
| 815 | std::vector<std::string> strings; |
| 816 | if(enumerator & VK_SHADER_STAGE_ALL) |
| 817 | { |
| 818 | strings.push_back("VK_SHADER_STAGE_ALL"); |
| 819 | } |
| 820 | if(enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) |
| 821 | { |
| 822 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
| 823 | } |
| 824 | if(enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) |
| 825 | { |
| 826 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 827 | } |
| 828 | if(enumerator & VK_SHADER_STAGE_COMPUTE_BIT) |
| 829 | { |
| 830 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 831 | } |
| 832 | if(enumerator & VK_SHADER_STAGE_TESS_EVALUATION_BIT) |
| 833 | { |
| 834 | strings.push_back("VK_SHADER_STAGE_TESS_EVALUATION_BIT"); |
| 835 | } |
| 836 | if(enumerator & VK_SHADER_STAGE_TESS_CONTROL_BIT) |
| 837 | { |
| 838 | strings.push_back("VK_SHADER_STAGE_TESS_CONTROL_BIT"); |
| 839 | } |
| 840 | if(enumerator & VK_SHADER_STAGE_VERTEX_BIT) |
| 841 | { |
| 842 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
| 843 | } |
| 844 | |
| 845 | std::string enumeratorString; |
| 846 | for(auto const& string : strings) |
| 847 | { |
| 848 | enumeratorString += string; |
| 849 | |
| 850 | if(string != strings.back()) |
| 851 | { |
| 852 | enumeratorString += '|'; |
| 853 | } |
| 854 | } |
| 855 | |
| 856 | return enumeratorString; |
| 857 | } |
| 858 | |
| 859 | static |
| 860 | bool ValidateEnumerator(VkImageUsageFlagBits const& enumerator) |
| 861 | { |
| 862 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)(VK_IMAGE_USAGE_DEPTH_STENCIL_BIT | |
| 863 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 864 | VK_IMAGE_USAGE_STORAGE_BIT | |
| 865 | VK_IMAGE_USAGE_SAMPLED_BIT | |
| 866 | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT | |
| 867 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | |
| 868 | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT | |
| 869 | VK_IMAGE_USAGE_GENERAL); |
| 870 | if(enumerator & (~allFlags)) |
| 871 | { |
| 872 | return false; |
| 873 | } |
| 874 | |
| 875 | return true; |
| 876 | } |
| 877 | |
| 878 | static |
| 879 | std::string EnumeratorString(VkImageUsageFlagBits const& enumerator) |
| 880 | { |
| 881 | if(!ValidateEnumerator(enumerator)) |
| 882 | { |
| 883 | return "unrecognized enumerator"; |
| 884 | } |
| 885 | |
| 886 | std::vector<std::string> strings; |
| 887 | if(enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_BIT) |
| 888 | { |
| 889 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_BIT"); |
| 890 | } |
| 891 | if(enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) |
| 892 | { |
| 893 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 894 | } |
| 895 | if(enumerator & VK_IMAGE_USAGE_STORAGE_BIT) |
| 896 | { |
| 897 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 898 | } |
| 899 | if(enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) |
| 900 | { |
| 901 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 902 | } |
| 903 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) |
| 904 | { |
| 905 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT"); |
| 906 | } |
| 907 | if(enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) |
| 908 | { |
| 909 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 910 | } |
| 911 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) |
| 912 | { |
| 913 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT"); |
| 914 | } |
| 915 | if(enumerator & VK_IMAGE_USAGE_GENERAL) |
| 916 | { |
| 917 | strings.push_back("VK_IMAGE_USAGE_GENERAL"); |
| 918 | } |
| 919 | |
| 920 | std::string enumeratorString; |
| 921 | for(auto const& string : strings) |
| 922 | { |
| 923 | enumeratorString += string; |
| 924 | |
| 925 | if(string != strings.back()) |
| 926 | { |
| 927 | enumeratorString += '|'; |
| 928 | } |
| 929 | } |
| 930 | |
| 931 | return enumeratorString; |
| 932 | } |
| 933 | |
| 934 | static |
| 935 | bool ValidateEnumerator(VkImageCreateFlagBits const& enumerator) |
| 936 | { |
| 937 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)(VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 938 | VK_IMAGE_CREATE_INVARIANT_DATA_BIT | |
| 939 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | |
| 940 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 941 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 942 | VK_IMAGE_CREATE_SPARSE_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 943 | if(enumerator & (~allFlags)) |
| 944 | { |
| 945 | return false; |
| 946 | } |
| 947 | |
| 948 | return true; |
| 949 | } |
| 950 | |
| 951 | static |
| 952 | std::string EnumeratorString(VkImageCreateFlagBits const& enumerator) |
| 953 | { |
| 954 | if(!ValidateEnumerator(enumerator)) |
| 955 | { |
| 956 | return "unrecognized enumerator"; |
| 957 | } |
| 958 | |
| 959 | std::vector<std::string> strings; |
| 960 | if(enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) |
| 961 | { |
| 962 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 963 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 964 | if(enumerator & VK_IMAGE_CREATE_INVARIANT_DATA_BIT) |
| 965 | { |
| 966 | strings.push_back("VK_IMAGE_CREATE_INVARIANT_DATA_BIT"); |
| 967 | } |
| 968 | if(enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) |
| 969 | { |
| 970 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 971 | } |
| 972 | if(enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) |
| 973 | { |
| 974 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 975 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 976 | if(enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) |
| 977 | { |
| 978 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 979 | } |
| 980 | if(enumerator & VK_IMAGE_CREATE_SPARSE_BIT) |
| 981 | { |
| 982 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BIT"); |
| 983 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 984 | |
| 985 | std::string enumeratorString; |
| 986 | for(auto const& string : strings) |
| 987 | { |
| 988 | enumeratorString += string; |
| 989 | |
| 990 | if(string != strings.back()) |
| 991 | { |
| 992 | enumeratorString += '|'; |
| 993 | } |
| 994 | } |
| 995 | |
| 996 | return enumeratorString; |
| 997 | } |
| 998 | |
| 999 | static |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1000 | bool ValidateEnumerator(VkAttachmentViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1001 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1002 | VkAttachmentViewCreateFlagBits allFlags = (VkAttachmentViewCreateFlagBits)(VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT | |
| 1003 | VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1004 | if(enumerator & (~allFlags)) |
| 1005 | { |
| 1006 | return false; |
| 1007 | } |
| 1008 | |
| 1009 | return true; |
| 1010 | } |
| 1011 | |
| 1012 | static |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1013 | std::string EnumeratorString(VkAttachmentViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1014 | { |
| 1015 | if(!ValidateEnumerator(enumerator)) |
| 1016 | { |
| 1017 | return "unrecognized enumerator"; |
| 1018 | } |
| 1019 | |
| 1020 | std::vector<std::string> strings; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1021 | if(enumerator & VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1022 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1023 | strings.push_back("VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1024 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1025 | if(enumerator & VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1026 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1027 | strings.push_back("VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1028 | } |
| 1029 | |
| 1030 | std::string enumeratorString; |
| 1031 | for(auto const& string : strings) |
| 1032 | { |
| 1033 | enumeratorString += string; |
| 1034 | |
| 1035 | if(string != strings.back()) |
| 1036 | { |
| 1037 | enumeratorString += '|'; |
| 1038 | } |
| 1039 | } |
| 1040 | |
| 1041 | return enumeratorString; |
| 1042 | } |
| 1043 | |
| 1044 | static |
| 1045 | bool ValidateEnumerator(VkPipelineCreateFlagBits const& enumerator) |
| 1046 | { |
| 1047 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)(VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | |
| 1048 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
| 1049 | if(enumerator & (~allFlags)) |
| 1050 | { |
| 1051 | return false; |
| 1052 | } |
| 1053 | |
| 1054 | return true; |
| 1055 | } |
| 1056 | |
| 1057 | static |
| 1058 | std::string EnumeratorString(VkPipelineCreateFlagBits const& enumerator) |
| 1059 | { |
| 1060 | if(!ValidateEnumerator(enumerator)) |
| 1061 | { |
| 1062 | return "unrecognized enumerator"; |
| 1063 | } |
| 1064 | |
| 1065 | std::vector<std::string> strings; |
| 1066 | if(enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) |
| 1067 | { |
| 1068 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 1069 | } |
| 1070 | if(enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) |
| 1071 | { |
| 1072 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
| 1073 | } |
| 1074 | |
| 1075 | std::string enumeratorString; |
| 1076 | for(auto const& string : strings) |
| 1077 | { |
| 1078 | enumeratorString += string; |
| 1079 | |
| 1080 | if(string != strings.back()) |
| 1081 | { |
| 1082 | enumeratorString += '|'; |
| 1083 | } |
| 1084 | } |
| 1085 | |
| 1086 | return enumeratorString; |
| 1087 | } |
| 1088 | |
| 1089 | static |
| 1090 | bool ValidateEnumerator(VkChannelFlagBits const& enumerator) |
| 1091 | { |
| 1092 | VkChannelFlagBits allFlags = (VkChannelFlagBits)(VK_CHANNEL_A_BIT | |
| 1093 | VK_CHANNEL_B_BIT | |
| 1094 | VK_CHANNEL_G_BIT | |
| 1095 | VK_CHANNEL_R_BIT); |
| 1096 | if(enumerator & (~allFlags)) |
| 1097 | { |
| 1098 | return false; |
| 1099 | } |
| 1100 | |
| 1101 | return true; |
| 1102 | } |
| 1103 | |
| 1104 | static |
| 1105 | std::string EnumeratorString(VkChannelFlagBits const& enumerator) |
| 1106 | { |
| 1107 | if(!ValidateEnumerator(enumerator)) |
| 1108 | { |
| 1109 | return "unrecognized enumerator"; |
| 1110 | } |
| 1111 | |
| 1112 | std::vector<std::string> strings; |
| 1113 | if(enumerator & VK_CHANNEL_A_BIT) |
| 1114 | { |
| 1115 | strings.push_back("VK_CHANNEL_A_BIT"); |
| 1116 | } |
| 1117 | if(enumerator & VK_CHANNEL_B_BIT) |
| 1118 | { |
| 1119 | strings.push_back("VK_CHANNEL_B_BIT"); |
| 1120 | } |
| 1121 | if(enumerator & VK_CHANNEL_G_BIT) |
| 1122 | { |
| 1123 | strings.push_back("VK_CHANNEL_G_BIT"); |
| 1124 | } |
| 1125 | if(enumerator & VK_CHANNEL_R_BIT) |
| 1126 | { |
| 1127 | strings.push_back("VK_CHANNEL_R_BIT"); |
| 1128 | } |
| 1129 | |
| 1130 | std::string enumeratorString; |
| 1131 | for(auto const& string : strings) |
| 1132 | { |
| 1133 | enumeratorString += string; |
| 1134 | |
| 1135 | if(string != strings.back()) |
| 1136 | { |
| 1137 | enumeratorString += '|'; |
| 1138 | } |
| 1139 | } |
| 1140 | |
| 1141 | return enumeratorString; |
| 1142 | } |
| 1143 | |
| 1144 | static |
| 1145 | bool ValidateEnumerator(VkFenceCreateFlagBits const& enumerator) |
| 1146 | { |
| 1147 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
| 1148 | if(enumerator & (~allFlags)) |
| 1149 | { |
| 1150 | return false; |
| 1151 | } |
| 1152 | |
| 1153 | return true; |
| 1154 | } |
| 1155 | |
| 1156 | static |
| 1157 | std::string EnumeratorString(VkFenceCreateFlagBits const& enumerator) |
| 1158 | { |
| 1159 | if(!ValidateEnumerator(enumerator)) |
| 1160 | { |
| 1161 | return "unrecognized enumerator"; |
| 1162 | } |
| 1163 | |
| 1164 | std::vector<std::string> strings; |
| 1165 | if(enumerator & VK_FENCE_CREATE_SIGNALED_BIT) |
| 1166 | { |
| 1167 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 1168 | } |
| 1169 | |
| 1170 | std::string enumeratorString; |
| 1171 | for(auto const& string : strings) |
| 1172 | { |
| 1173 | enumeratorString += string; |
| 1174 | |
| 1175 | if(string != strings.back()) |
| 1176 | { |
| 1177 | enumeratorString += '|'; |
| 1178 | } |
| 1179 | } |
| 1180 | |
| 1181 | return enumeratorString; |
| 1182 | } |
| 1183 | |
| 1184 | static |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1185 | bool ValidateEnumerator(VkSparseImageFormatFlagBits const& enumerator) |
| 1186 | { |
| 1187 | VkSparseImageFormatFlagBits allFlags = (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT | |
| 1188 | VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT | |
| 1189 | VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT); |
| 1190 | if(enumerator & (~allFlags)) |
| 1191 | { |
| 1192 | return false; |
| 1193 | } |
| 1194 | |
| 1195 | return true; |
| 1196 | } |
| 1197 | |
| 1198 | static |
| 1199 | std::string EnumeratorString(VkSparseImageFormatFlagBits const& enumerator) |
| 1200 | { |
| 1201 | if(!ValidateEnumerator(enumerator)) |
| 1202 | { |
| 1203 | return "unrecognized enumerator"; |
| 1204 | } |
| 1205 | |
| 1206 | std::vector<std::string> strings; |
| 1207 | if(enumerator & VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT) |
| 1208 | { |
| 1209 | strings.push_back("VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT"); |
| 1210 | } |
| 1211 | if(enumerator & VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT) |
| 1212 | { |
| 1213 | strings.push_back("VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT"); |
| 1214 | } |
| 1215 | if(enumerator & VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT) |
| 1216 | { |
| 1217 | strings.push_back("VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT"); |
| 1218 | } |
| 1219 | |
| 1220 | std::string enumeratorString; |
| 1221 | for(auto const& string : strings) |
| 1222 | { |
| 1223 | enumeratorString += string; |
| 1224 | |
| 1225 | if(string != strings.back()) |
| 1226 | { |
| 1227 | enumeratorString += '|'; |
| 1228 | } |
| 1229 | } |
| 1230 | |
| 1231 | return enumeratorString; |
| 1232 | } |
| 1233 | |
| 1234 | static |
| 1235 | bool ValidateEnumerator(VkSparseMemoryBindFlagBits const& enumerator) |
| 1236 | { |
| 1237 | VkSparseMemoryBindFlagBits allFlags = (VkSparseMemoryBindFlagBits)(VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT); |
| 1238 | if(enumerator & (~allFlags)) |
| 1239 | { |
| 1240 | return false; |
| 1241 | } |
| 1242 | |
| 1243 | return true; |
| 1244 | } |
| 1245 | |
| 1246 | static |
| 1247 | std::string EnumeratorString(VkSparseMemoryBindFlagBits const& enumerator) |
| 1248 | { |
| 1249 | if(!ValidateEnumerator(enumerator)) |
| 1250 | { |
| 1251 | return "unrecognized enumerator"; |
| 1252 | } |
| 1253 | |
| 1254 | std::vector<std::string> strings; |
| 1255 | if(enumerator & VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT) |
| 1256 | { |
| 1257 | strings.push_back("VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT"); |
| 1258 | } |
| 1259 | |
| 1260 | std::string enumeratorString; |
| 1261 | for(auto const& string : strings) |
| 1262 | { |
| 1263 | enumeratorString += string; |
| 1264 | |
| 1265 | if(string != strings.back()) |
| 1266 | { |
| 1267 | enumeratorString += '|'; |
| 1268 | } |
| 1269 | } |
| 1270 | |
| 1271 | return enumeratorString; |
| 1272 | } |
| 1273 | |
| 1274 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1275 | bool ValidateEnumerator(VkFormatFeatureFlagBits const& enumerator) |
| 1276 | { |
| 1277 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)(VK_FORMAT_FEATURE_CONVERSION_BIT | |
| 1278 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | |
| 1279 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 1280 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | |
| 1281 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 1282 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | |
| 1283 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | |
| 1284 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 1285 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | |
| 1286 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
| 1287 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT); |
| 1288 | if(enumerator & (~allFlags)) |
| 1289 | { |
| 1290 | return false; |
| 1291 | } |
| 1292 | |
| 1293 | return true; |
| 1294 | } |
| 1295 | |
| 1296 | static |
| 1297 | std::string EnumeratorString(VkFormatFeatureFlagBits const& enumerator) |
| 1298 | { |
| 1299 | if(!ValidateEnumerator(enumerator)) |
| 1300 | { |
| 1301 | return "unrecognized enumerator"; |
| 1302 | } |
| 1303 | |
| 1304 | std::vector<std::string> strings; |
| 1305 | if(enumerator & VK_FORMAT_FEATURE_CONVERSION_BIT) |
| 1306 | { |
| 1307 | strings.push_back("VK_FORMAT_FEATURE_CONVERSION_BIT"); |
| 1308 | } |
| 1309 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) |
| 1310 | { |
| 1311 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 1312 | } |
| 1313 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) |
| 1314 | { |
| 1315 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 1316 | } |
| 1317 | if(enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) |
| 1318 | { |
| 1319 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 1320 | } |
| 1321 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) |
| 1322 | { |
| 1323 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 1324 | } |
| 1325 | if(enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) |
| 1326 | { |
| 1327 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 1328 | } |
| 1329 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) |
| 1330 | { |
| 1331 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 1332 | } |
| 1333 | if(enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) |
| 1334 | { |
| 1335 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 1336 | } |
| 1337 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) |
| 1338 | { |
| 1339 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 1340 | } |
| 1341 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 1342 | { |
| 1343 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 1344 | } |
| 1345 | if(enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 1346 | { |
| 1347 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 1348 | } |
| 1349 | |
| 1350 | std::string enumeratorString; |
| 1351 | for(auto const& string : strings) |
| 1352 | { |
| 1353 | enumeratorString += string; |
| 1354 | |
| 1355 | if(string != strings.back()) |
| 1356 | { |
| 1357 | enumeratorString += '|'; |
| 1358 | } |
| 1359 | } |
| 1360 | |
| 1361 | return enumeratorString; |
| 1362 | } |
| 1363 | |
| 1364 | static |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1365 | bool ValidateEnumerator(VkImageAspectFlagBits const& enumerator) |
| 1366 | { |
| 1367 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1368 | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 1369 | VK_IMAGE_ASPECT_COLOR_BIT); |
| 1370 | if(enumerator & (~allFlags)) |
| 1371 | { |
| 1372 | return false; |
| 1373 | } |
| 1374 | |
| 1375 | return true; |
| 1376 | } |
| 1377 | |
| 1378 | static |
| 1379 | std::string EnumeratorString(VkImageAspectFlagBits const& enumerator) |
| 1380 | { |
| 1381 | if(!ValidateEnumerator(enumerator)) |
| 1382 | { |
| 1383 | return "unrecognized enumerator"; |
| 1384 | } |
| 1385 | |
| 1386 | std::vector<std::string> strings; |
| 1387 | if(enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) |
| 1388 | { |
| 1389 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1390 | } |
| 1391 | if(enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) |
| 1392 | { |
| 1393 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1394 | } |
| 1395 | if(enumerator & VK_IMAGE_ASPECT_COLOR_BIT) |
| 1396 | { |
| 1397 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1398 | } |
| 1399 | |
| 1400 | std::string enumeratorString; |
| 1401 | for(auto const& string : strings) |
| 1402 | { |
| 1403 | enumeratorString += string; |
| 1404 | |
| 1405 | if(string != strings.back()) |
| 1406 | { |
| 1407 | enumeratorString += '|'; |
| 1408 | } |
| 1409 | } |
| 1410 | |
| 1411 | return enumeratorString; |
| 1412 | } |
| 1413 | |
| 1414 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1415 | bool ValidateEnumerator(VkQueryControlFlagBits const& enumerator) |
| 1416 | { |
| 1417 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_CONSERVATIVE_BIT); |
| 1418 | if(enumerator & (~allFlags)) |
| 1419 | { |
| 1420 | return false; |
| 1421 | } |
| 1422 | |
| 1423 | return true; |
| 1424 | } |
| 1425 | |
| 1426 | static |
| 1427 | std::string EnumeratorString(VkQueryControlFlagBits const& enumerator) |
| 1428 | { |
| 1429 | if(!ValidateEnumerator(enumerator)) |
| 1430 | { |
| 1431 | return "unrecognized enumerator"; |
| 1432 | } |
| 1433 | |
| 1434 | std::vector<std::string> strings; |
| 1435 | if(enumerator & VK_QUERY_CONTROL_CONSERVATIVE_BIT) |
| 1436 | { |
| 1437 | strings.push_back("VK_QUERY_CONTROL_CONSERVATIVE_BIT"); |
| 1438 | } |
| 1439 | |
| 1440 | std::string enumeratorString; |
| 1441 | for(auto const& string : strings) |
| 1442 | { |
| 1443 | enumeratorString += string; |
| 1444 | |
| 1445 | if(string != strings.back()) |
| 1446 | { |
| 1447 | enumeratorString += '|'; |
| 1448 | } |
| 1449 | } |
| 1450 | |
| 1451 | return enumeratorString; |
| 1452 | } |
| 1453 | |
| 1454 | static |
| 1455 | bool ValidateEnumerator(VkQueryResultFlagBits const& enumerator) |
| 1456 | { |
| 1457 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | |
| 1458 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 1459 | VK_QUERY_RESULT_WAIT_BIT | |
| 1460 | VK_QUERY_RESULT_64_BIT | |
| 1461 | VK_QUERY_RESULT_DEFAULT); |
| 1462 | if(enumerator & (~allFlags)) |
| 1463 | { |
| 1464 | return false; |
| 1465 | } |
| 1466 | |
| 1467 | return true; |
| 1468 | } |
| 1469 | |
| 1470 | static |
| 1471 | std::string EnumeratorString(VkQueryResultFlagBits const& enumerator) |
| 1472 | { |
| 1473 | if(!ValidateEnumerator(enumerator)) |
| 1474 | { |
| 1475 | return "unrecognized enumerator"; |
| 1476 | } |
| 1477 | |
| 1478 | std::vector<std::string> strings; |
| 1479 | if(enumerator & VK_QUERY_RESULT_PARTIAL_BIT) |
| 1480 | { |
| 1481 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 1482 | } |
| 1483 | if(enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) |
| 1484 | { |
| 1485 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 1486 | } |
| 1487 | if(enumerator & VK_QUERY_RESULT_WAIT_BIT) |
| 1488 | { |
| 1489 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 1490 | } |
| 1491 | if(enumerator & VK_QUERY_RESULT_64_BIT) |
| 1492 | { |
| 1493 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 1494 | } |
| 1495 | if(enumerator & VK_QUERY_RESULT_DEFAULT) |
| 1496 | { |
| 1497 | strings.push_back("VK_QUERY_RESULT_DEFAULT"); |
| 1498 | } |
| 1499 | |
| 1500 | std::string enumeratorString; |
| 1501 | for(auto const& string : strings) |
| 1502 | { |
| 1503 | enumeratorString += string; |
| 1504 | |
| 1505 | if(string != strings.back()) |
| 1506 | { |
| 1507 | enumeratorString += '|'; |
| 1508 | } |
| 1509 | } |
| 1510 | |
| 1511 | return enumeratorString; |
| 1512 | } |
| 1513 | |
| 1514 | static |
| 1515 | bool ValidateEnumerator(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1516 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1517 | VkCmdBufferOptimizeFlagBits allFlags = (VkCmdBufferOptimizeFlagBits)(VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT | |
| 1518 | VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1519 | VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT | |
| 1520 | VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT | |
| 1521 | VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT); |
| 1522 | if(enumerator & (~allFlags)) |
| 1523 | { |
| 1524 | return false; |
| 1525 | } |
| 1526 | |
| 1527 | return true; |
| 1528 | } |
| 1529 | |
| 1530 | static |
| 1531 | std::string EnumeratorString(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1532 | { |
| 1533 | if(!ValidateEnumerator(enumerator)) |
| 1534 | { |
| 1535 | return "unrecognized enumerator"; |
| 1536 | } |
| 1537 | |
| 1538 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1539 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT) |
| 1540 | { |
| 1541 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT"); |
| 1542 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1543 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT) |
| 1544 | { |
| 1545 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT"); |
| 1546 | } |
| 1547 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT) |
| 1548 | { |
| 1549 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT"); |
| 1550 | } |
| 1551 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT) |
| 1552 | { |
| 1553 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT"); |
| 1554 | } |
| 1555 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT) |
| 1556 | { |
| 1557 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT"); |
| 1558 | } |
| 1559 | |
| 1560 | std::string enumeratorString; |
| 1561 | for(auto const& string : strings) |
| 1562 | { |
| 1563 | enumeratorString += string; |
| 1564 | |
| 1565 | if(string != strings.back()) |
| 1566 | { |
| 1567 | enumeratorString += '|'; |
| 1568 | } |
| 1569 | } |
| 1570 | |
| 1571 | return enumeratorString; |
| 1572 | } |
| 1573 | |
| 1574 | static |
| 1575 | bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 1576 | { |
| 1577 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)(VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT | |
| 1578 | VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT | |
| 1579 | VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT | |
| 1580 | VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT | |
| 1581 | VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT | |
| 1582 | VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT | |
| 1583 | VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT | |
| 1584 | VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT | |
| 1585 | VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT | |
| 1586 | VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT | |
| 1587 | VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT); |
| 1588 | if(enumerator & (~allFlags)) |
| 1589 | { |
| 1590 | return false; |
| 1591 | } |
| 1592 | |
| 1593 | return true; |
| 1594 | } |
| 1595 | |
| 1596 | static |
| 1597 | std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 1598 | { |
| 1599 | if(!ValidateEnumerator(enumerator)) |
| 1600 | { |
| 1601 | return "unrecognized enumerator"; |
| 1602 | } |
| 1603 | |
| 1604 | std::vector<std::string> strings; |
| 1605 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT) |
| 1606 | { |
| 1607 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT"); |
| 1608 | } |
| 1609 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT) |
| 1610 | { |
| 1611 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT"); |
| 1612 | } |
| 1613 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT) |
| 1614 | { |
| 1615 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT"); |
| 1616 | } |
| 1617 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT) |
| 1618 | { |
| 1619 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT"); |
| 1620 | } |
| 1621 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT) |
| 1622 | { |
| 1623 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT"); |
| 1624 | } |
| 1625 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT) |
| 1626 | { |
| 1627 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT"); |
| 1628 | } |
| 1629 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT) |
| 1630 | { |
| 1631 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT"); |
| 1632 | } |
| 1633 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT) |
| 1634 | { |
| 1635 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT"); |
| 1636 | } |
| 1637 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT) |
| 1638 | { |
| 1639 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT"); |
| 1640 | } |
| 1641 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT) |
| 1642 | { |
| 1643 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT"); |
| 1644 | } |
| 1645 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT) |
| 1646 | { |
| 1647 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT"); |
| 1648 | } |
| 1649 | |
| 1650 | std::string enumeratorString; |
| 1651 | for(auto const& string : strings) |
| 1652 | { |
| 1653 | enumeratorString += string; |
| 1654 | |
| 1655 | if(string != strings.back()) |
| 1656 | { |
| 1657 | enumeratorString += '|'; |
| 1658 | } |
| 1659 | } |
| 1660 | |
| 1661 | return enumeratorString; |
| 1662 | } |
| 1663 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1664 | static |
| 1665 | bool ValidateEnumerator(VkMemoryHeapFlagBits const& enumerator) |
| 1666 | { |
| 1667 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_HOST_LOCAL); |
| 1668 | if(enumerator & (~allFlags)) |
| 1669 | { |
| 1670 | return false; |
| 1671 | } |
| 1672 | |
| 1673 | return true; |
| 1674 | } |
| 1675 | |
| 1676 | static |
| 1677 | std::string EnumeratorString(VkMemoryHeapFlagBits const& enumerator) |
| 1678 | { |
| 1679 | if(!ValidateEnumerator(enumerator)) |
| 1680 | { |
| 1681 | return "unrecognized enumerator"; |
| 1682 | } |
| 1683 | |
| 1684 | std::vector<std::string> strings; |
| 1685 | if(enumerator & VK_MEMORY_HEAP_HOST_LOCAL) |
| 1686 | { |
| 1687 | strings.push_back("VK_MEMORY_HEAP_HOST_LOCAL"); |
| 1688 | } |
| 1689 | |
| 1690 | std::string enumeratorString; |
| 1691 | for(auto const& string : strings) |
| 1692 | { |
| 1693 | enumeratorString += string; |
| 1694 | |
| 1695 | if(string != strings.back()) |
| 1696 | { |
| 1697 | enumeratorString += '|'; |
| 1698 | } |
| 1699 | } |
| 1700 | |
| 1701 | return enumeratorString; |
| 1702 | } |
| 1703 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1704 | VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance( |
| 1705 | const VkInstanceCreateInfo* pCreateInfo, |
| 1706 | VkInstance* pInstance) |
| 1707 | { |
| 1708 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, *pInstance); |
| 1709 | VkResult result = pTable->CreateInstance(pCreateInfo, pInstance); |
| 1710 | |
| 1711 | if (result == VK_SUCCESS) { |
| 1712 | layer_data *data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); |
| 1713 | data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->extensionCount, |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 1714 | pCreateInfo->ppEnabledExtensionNames); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1715 | |
| 1716 | InitParamChecker(data); |
| 1717 | } |
| 1718 | |
| 1719 | return result; |
| 1720 | } |
| 1721 | |
| 1722 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance( |
| 1723 | VkInstance instance) |
| 1724 | { |
| 1725 | // Grab the key before the instance is destroyed. |
| 1726 | dispatch_key key = get_dispatch_key(instance); |
| 1727 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 1728 | VkResult result = pTable->DestroyInstance(instance); |
| 1729 | |
| 1730 | // Clean up logging callback, if any |
| 1731 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 1732 | if(data->logging_callback) |
| 1733 | { |
| 1734 | layer_destroy_msg_callback(data->report_data, data->logging_callback); |
| 1735 | } |
| 1736 | |
| 1737 | layer_debug_report_destroy_instance(mid(instance)); |
| 1738 | layer_data_map.erase(pTable); |
| 1739 | |
| 1740 | pc_instance_table_map.erase(key); |
| 1741 | assert(pc_instance_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
| 1742 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1743 | return result; |
| 1744 | } |
| 1745 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1746 | bool PostEnumeratePhysicalDevices( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1747 | VkInstance instance, |
| 1748 | uint32_t* pPhysicalDeviceCount, |
| 1749 | VkPhysicalDevice* pPhysicalDevices, |
| 1750 | VkResult result) |
| 1751 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1752 | |
| 1753 | if(pPhysicalDeviceCount == nullptr) |
| 1754 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1755 | log_msg(mid(instance), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1756 | "vkEnumeratePhysicalDevices parameter, uint32_t* pPhysicalDeviceCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1757 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1758 | } |
| 1759 | |
| 1760 | if(pPhysicalDevices == nullptr) |
| 1761 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1762 | log_msg(mid(instance), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1763 | "vkEnumeratePhysicalDevices parameter, VkPhysicalDevice* pPhysicalDevices, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1764 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1765 | } |
| 1766 | |
| 1767 | if(result != VK_SUCCESS) |
| 1768 | { |
| 1769 | std::string reason = "vkEnumeratePhysicalDevices parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1770 | log_msg(mid(instance), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1771 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1772 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1773 | |
| 1774 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1775 | } |
| 1776 | |
| 1777 | VK_LAYER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
| 1778 | VkInstance instance, |
| 1779 | uint32_t* pPhysicalDeviceCount, |
| 1780 | VkPhysicalDevice* pPhysicalDevices) |
| 1781 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1782 | VkResult result = get_dispatch_table(pc_instance_table_map, instance)->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
| 1783 | |
| 1784 | PostEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices, result); |
| 1785 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1786 | return result; |
| 1787 | } |
| 1788 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1789 | bool PostGetPhysicalDeviceFeatures( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1790 | VkPhysicalDevice physicalDevice, |
| 1791 | VkPhysicalDeviceFeatures* pFeatures, |
| 1792 | VkResult result) |
| 1793 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1794 | |
| 1795 | if(pFeatures == nullptr) |
| 1796 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1797 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1798 | "vkGetPhysicalDeviceFeatures parameter, VkPhysicalDeviceFeatures* pFeatures, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1799 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1800 | } |
| 1801 | |
| 1802 | if(result != VK_SUCCESS) |
| 1803 | { |
| 1804 | std::string reason = "vkGetPhysicalDeviceFeatures parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1805 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1806 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1807 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1808 | |
| 1809 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1810 | } |
| 1811 | |
| 1812 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures( |
| 1813 | VkPhysicalDevice physicalDevice, |
| 1814 | VkPhysicalDeviceFeatures* pFeatures) |
| 1815 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1816 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
| 1817 | |
| 1818 | PostGetPhysicalDeviceFeatures(physicalDevice, pFeatures, result); |
| 1819 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1820 | return result; |
| 1821 | } |
| 1822 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1823 | bool PostGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1824 | VkPhysicalDevice physicalDevice, |
| 1825 | VkFormat format, |
| 1826 | VkFormatProperties* pFormatInfo, |
| 1827 | VkResult result) |
| 1828 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1829 | |
| 1830 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 1831 | format > VK_FORMAT_END_RANGE) |
| 1832 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1833 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1834 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormat format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1835 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1836 | } |
| 1837 | |
| 1838 | if(pFormatInfo == nullptr) |
| 1839 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1840 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1841 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormatProperties* pFormatInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1842 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1843 | } |
| 1844 | if(!ValidateEnumerator((VkFormatFeatureFlagBits)pFormatInfo->linearTilingFeatures)) |
| 1845 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1846 | std::string reason = "vkGetPhysicalDeviceFormatProperties parameter, VkFormatFeatureFlags pFormatInfo->linearTilingFeatures, is " + EnumeratorString((VkFormatFeatureFlagBits)pFormatInfo->linearTilingFeatures); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1847 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1848 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1849 | } |
| 1850 | if(!ValidateEnumerator((VkFormatFeatureFlagBits)pFormatInfo->optimalTilingFeatures)) |
| 1851 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1852 | std::string reason = "vkGetPhysicalDeviceFormatProperties parameter, VkFormatFeatureFlags pFormatInfo->optimalTilingFeatures, is " + EnumeratorString((VkFormatFeatureFlagBits)pFormatInfo->optimalTilingFeatures); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1853 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1854 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1855 | } |
| 1856 | |
| 1857 | if(result != VK_SUCCESS) |
| 1858 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1859 | std::string reason = "vkGetPhysicalDeviceFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1860 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1861 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1862 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1863 | |
| 1864 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1865 | } |
| 1866 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1867 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1868 | VkPhysicalDevice physicalDevice, |
| 1869 | VkFormat format, |
| 1870 | VkFormatProperties* pFormatInfo) |
| 1871 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1872 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatInfo); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1873 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1874 | PostGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatInfo, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1875 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1876 | return result; |
| 1877 | } |
| 1878 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1879 | bool PostGetPhysicalDeviceLimits( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1880 | VkPhysicalDevice physicalDevice, |
| 1881 | VkPhysicalDeviceLimits* pLimits, |
| 1882 | VkResult result) |
| 1883 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1884 | |
| 1885 | if(pLimits == nullptr) |
| 1886 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1887 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1888 | "vkGetPhysicalDeviceLimits parameter, VkPhysicalDeviceLimits* pLimits, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1889 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1890 | } |
| 1891 | |
| 1892 | if(result != VK_SUCCESS) |
| 1893 | { |
| 1894 | std::string reason = "vkGetPhysicalDeviceLimits parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1895 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1896 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1897 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1898 | |
| 1899 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1900 | } |
| 1901 | |
| 1902 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits( |
| 1903 | VkPhysicalDevice physicalDevice, |
| 1904 | VkPhysicalDeviceLimits* pLimits) |
| 1905 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1906 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceLimits(physicalDevice, pLimits); |
| 1907 | |
| 1908 | PostGetPhysicalDeviceLimits(physicalDevice, pLimits, result); |
| 1909 | |
| 1910 | return result; |
| 1911 | } |
| 1912 | |
| 1913 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice( |
| 1914 | VkPhysicalDevice physicalDevice, |
| 1915 | const VkDeviceCreateInfo* pCreateInfo, |
| 1916 | VkDevice* pDevice) |
| 1917 | { |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 1918 | VkLayerDispatchTable *pTable = get_dispatch_table(pc_device_table_map, *pDevice); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1919 | VkResult result = pTable->CreateDevice(physicalDevice, pCreateInfo, pDevice); |
| 1920 | if(result == VK_SUCCESS) |
| 1921 | { |
| 1922 | layer_data *instance_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
| 1923 | layer_data *device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); |
| 1924 | device_data->report_data = layer_debug_report_create_device(instance_data->report_data, *pDevice); |
| 1925 | } |
| 1926 | |
| 1927 | return result; |
| 1928 | } |
| 1929 | |
| 1930 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice( |
| 1931 | VkDevice device) |
| 1932 | { |
| 1933 | layer_debug_report_destroy_device(device); |
| 1934 | |
| 1935 | dispatch_key key = get_dispatch_key(device); |
| 1936 | #if DISPATCH_MAP_DEBUG |
| 1937 | fprintf(stderr, "Device: %p, key: %p\n", device, key); |
| 1938 | #endif |
| 1939 | |
| 1940 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device); |
| 1941 | pc_device_table_map.erase(key); |
| 1942 | assert(pc_device_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
| 1943 | |
| 1944 | return result; |
| 1945 | } |
| 1946 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1947 | bool PostGetPhysicalDeviceProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1948 | VkPhysicalDevice physicalDevice, |
| 1949 | VkPhysicalDeviceProperties* pProperties, |
| 1950 | VkResult result) |
| 1951 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1952 | |
| 1953 | if(pProperties == nullptr) |
| 1954 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1955 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1956 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceProperties* pProperties, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1957 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1958 | } |
| 1959 | if(pProperties->deviceType < VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE || |
| 1960 | pProperties->deviceType > VK_PHYSICAL_DEVICE_TYPE_END_RANGE) |
| 1961 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1962 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1963 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceType pProperties->deviceType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1964 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1965 | } |
| 1966 | |
| 1967 | if(result != VK_SUCCESS) |
| 1968 | { |
| 1969 | std::string reason = "vkGetPhysicalDeviceProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1970 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1971 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1972 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1973 | |
| 1974 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1975 | } |
| 1976 | |
| 1977 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties( |
| 1978 | VkPhysicalDevice physicalDevice, |
| 1979 | VkPhysicalDeviceProperties* pProperties) |
| 1980 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1981 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties(physicalDevice, pProperties); |
| 1982 | |
| 1983 | PostGetPhysicalDeviceProperties(physicalDevice, pProperties, result); |
| 1984 | |
| 1985 | return result; |
| 1986 | } |
| 1987 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1988 | bool PostGetPhysicalDeviceQueueCount( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1989 | VkPhysicalDevice physicalDevice, |
| 1990 | uint32_t* pCount, |
| 1991 | VkResult result) |
| 1992 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1993 | |
| 1994 | if(pCount == nullptr) |
| 1995 | { |
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", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1997 | "vkGetPhysicalDeviceQueueCount parameter, uint32_t* pCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1998 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1999 | } |
| 2000 | |
| 2001 | if(result != VK_SUCCESS) |
| 2002 | { |
| 2003 | std::string reason = "vkGetPhysicalDeviceQueueCount parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2004 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2005 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2006 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2007 | |
| 2008 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2009 | } |
| 2010 | |
| 2011 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueCount( |
| 2012 | VkPhysicalDevice physicalDevice, |
| 2013 | uint32_t* pCount) |
| 2014 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2015 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceQueueCount(physicalDevice, pCount); |
| 2016 | |
| 2017 | PostGetPhysicalDeviceQueueCount(physicalDevice, pCount, result); |
| 2018 | |
| 2019 | return result; |
| 2020 | } |
| 2021 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2022 | bool PostGetPhysicalDeviceQueueProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2023 | VkPhysicalDevice physicalDevice, |
| 2024 | uint32_t count, |
| 2025 | VkPhysicalDeviceQueueProperties* pQueueProperties, |
| 2026 | VkResult result) |
| 2027 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2028 | |
| 2029 | |
| 2030 | if(pQueueProperties == nullptr) |
| 2031 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2032 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2033 | "vkGetPhysicalDeviceQueueProperties parameter, VkPhysicalDeviceQueueProperties* pQueueProperties, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2034 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2035 | } |
| 2036 | if(!ValidateEnumerator((VkQueueFlagBits)pQueueProperties->queueFlags)) |
| 2037 | { |
| 2038 | std::string reason = "vkGetPhysicalDeviceQueueProperties parameter, VkQueueFlags pQueueProperties->queueFlags, is " + EnumeratorString((VkQueueFlagBits)pQueueProperties->queueFlags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2039 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2040 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2041 | } |
| 2042 | |
| 2043 | if(result != VK_SUCCESS) |
| 2044 | { |
| 2045 | std::string reason = "vkGetPhysicalDeviceQueueProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2046 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2047 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2048 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2049 | |
| 2050 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2051 | } |
| 2052 | |
| 2053 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties( |
| 2054 | VkPhysicalDevice physicalDevice, |
| 2055 | uint32_t count, |
| 2056 | VkPhysicalDeviceQueueProperties* pQueueProperties) |
| 2057 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2058 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceQueueProperties(physicalDevice, count, pQueueProperties); |
| 2059 | |
| 2060 | PostGetPhysicalDeviceQueueProperties(physicalDevice, count, pQueueProperties, result); |
| 2061 | |
| 2062 | return result; |
| 2063 | } |
| 2064 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2065 | bool PostGetPhysicalDeviceMemoryProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2066 | VkPhysicalDevice physicalDevice, |
| 2067 | VkPhysicalDeviceMemoryProperties* pMemoryProperies, |
| 2068 | VkResult result) |
| 2069 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2070 | |
| 2071 | if(pMemoryProperies == nullptr) |
| 2072 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2073 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2074 | "vkGetPhysicalDeviceMemoryProperties parameter, VkPhysicalDeviceMemoryProperties* pMemoryProperies, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2075 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2076 | } |
| 2077 | |
| 2078 | if(result != VK_SUCCESS) |
| 2079 | { |
| 2080 | std::string reason = "vkGetPhysicalDeviceMemoryProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2081 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2082 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2083 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2084 | |
| 2085 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2086 | } |
| 2087 | |
| 2088 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( |
| 2089 | VkPhysicalDevice physicalDevice, |
| 2090 | VkPhysicalDeviceMemoryProperties* pMemoryProperies) |
| 2091 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2092 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperies); |
| 2093 | |
| 2094 | PostGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperies, result); |
| 2095 | |
| 2096 | return result; |
| 2097 | } |
| 2098 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2099 | bool PostGetDeviceQueue( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2100 | VkDevice device, |
| 2101 | uint32_t queueNodeIndex, |
| 2102 | uint32_t queueIndex, |
| 2103 | VkQueue* pQueue, |
| 2104 | VkResult result) |
| 2105 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2106 | |
| 2107 | |
| 2108 | |
| 2109 | if(pQueue == nullptr) |
| 2110 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2111 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2112 | "vkGetDeviceQueue parameter, VkQueue* pQueue, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2113 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2114 | } |
| 2115 | |
| 2116 | if(result != VK_SUCCESS) |
| 2117 | { |
| 2118 | std::string reason = "vkGetDeviceQueue parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2119 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2120 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2121 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2122 | |
| 2123 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2124 | } |
| 2125 | |
| 2126 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceQueue( |
| 2127 | VkDevice device, |
| 2128 | uint32_t queueNodeIndex, |
| 2129 | uint32_t queueIndex, |
| 2130 | VkQueue* pQueue) |
| 2131 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2132 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); |
| 2133 | |
| 2134 | PostGetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue, result); |
| 2135 | |
| 2136 | return result; |
| 2137 | } |
| 2138 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2139 | bool PreQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2140 | VkQueue queue, |
| 2141 | const VkCmdBuffer* pCmdBuffers) |
| 2142 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2143 | if(pCmdBuffers == nullptr) |
| 2144 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2145 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2146 | "vkQueueSubmit parameter, const VkCmdBuffer* pCmdBuffers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2147 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2148 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2149 | |
| 2150 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2151 | } |
| 2152 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2153 | bool PostQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2154 | VkQueue queue, |
| 2155 | uint32_t cmdBufferCount, |
| 2156 | VkFence fence, |
| 2157 | VkResult result) |
| 2158 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2159 | |
| 2160 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2161 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2162 | if(result != VK_SUCCESS) |
| 2163 | { |
| 2164 | std::string reason = "vkQueueSubmit parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2165 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2166 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2167 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2168 | |
| 2169 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2170 | } |
| 2171 | |
| 2172 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( |
| 2173 | VkQueue queue, |
| 2174 | uint32_t cmdBufferCount, |
| 2175 | const VkCmdBuffer* pCmdBuffers, |
| 2176 | VkFence fence) |
| 2177 | { |
| 2178 | PreQueueSubmit(queue, pCmdBuffers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2179 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2180 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence); |
| 2181 | |
| 2182 | PostQueueSubmit(queue, cmdBufferCount, fence, result); |
| 2183 | |
| 2184 | return result; |
| 2185 | } |
| 2186 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2187 | bool PostQueueWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2188 | VkQueue queue, |
| 2189 | VkResult result) |
| 2190 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2191 | |
| 2192 | if(result != VK_SUCCESS) |
| 2193 | { |
| 2194 | std::string reason = "vkQueueWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2195 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2196 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2197 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2198 | |
| 2199 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2200 | } |
| 2201 | |
| 2202 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitIdle( |
| 2203 | VkQueue queue) |
| 2204 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2205 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue); |
| 2206 | |
| 2207 | PostQueueWaitIdle(queue, result); |
| 2208 | |
| 2209 | return result; |
| 2210 | } |
| 2211 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2212 | bool PostDeviceWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2213 | VkDevice device, |
| 2214 | VkResult result) |
| 2215 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2216 | |
| 2217 | if(result != VK_SUCCESS) |
| 2218 | { |
| 2219 | std::string reason = "vkDeviceWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2220 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2221 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2222 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2223 | |
| 2224 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2225 | } |
| 2226 | |
| 2227 | VK_LAYER_EXPORT VkResult VKAPI vkDeviceWaitIdle( |
| 2228 | VkDevice device) |
| 2229 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2230 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device); |
| 2231 | |
| 2232 | PostDeviceWaitIdle(device, result); |
| 2233 | |
| 2234 | return result; |
| 2235 | } |
| 2236 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2237 | bool PreAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2238 | VkDevice device, |
| 2239 | const VkMemoryAllocInfo* pAllocInfo) |
| 2240 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2241 | if(pAllocInfo == nullptr) |
| 2242 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2243 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2244 | "vkAllocMemory parameter, const VkMemoryAllocInfo* pAllocInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2245 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2246 | } |
| 2247 | if(pAllocInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2248 | pAllocInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2249 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2250 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2251 | "vkAllocMemory parameter, VkStructureType pAllocInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2252 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2253 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2254 | |
| 2255 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2256 | } |
| 2257 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2258 | bool PostAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2259 | VkDevice device, |
| 2260 | VkDeviceMemory* pMem, |
| 2261 | VkResult result) |
| 2262 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2263 | |
| 2264 | if(pMem == nullptr) |
| 2265 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2266 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2267 | "vkAllocMemory parameter, VkDeviceMemory* pMem, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2268 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2269 | } |
| 2270 | |
| 2271 | if(result != VK_SUCCESS) |
| 2272 | { |
| 2273 | std::string reason = "vkAllocMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2274 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2275 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2276 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2277 | |
| 2278 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2279 | } |
| 2280 | |
| 2281 | VK_LAYER_EXPORT VkResult VKAPI vkAllocMemory( |
| 2282 | VkDevice device, |
| 2283 | const VkMemoryAllocInfo* pAllocInfo, |
| 2284 | VkDeviceMemory* pMem) |
| 2285 | { |
| 2286 | PreAllocMemory(device, pAllocInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2287 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2288 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocMemory(device, pAllocInfo, pMem); |
| 2289 | |
| 2290 | PostAllocMemory(device, pMem, result); |
| 2291 | |
| 2292 | return result; |
| 2293 | } |
| 2294 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2295 | bool PostFreeMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2296 | VkDevice device, |
| 2297 | VkDeviceMemory mem, |
| 2298 | VkResult result) |
| 2299 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2300 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2301 | |
| 2302 | if(result != VK_SUCCESS) |
| 2303 | { |
| 2304 | std::string reason = "vkFreeMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2305 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2306 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2307 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2308 | |
| 2309 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2310 | } |
| 2311 | |
| 2312 | VK_LAYER_EXPORT VkResult VKAPI vkFreeMemory( |
| 2313 | VkDevice device, |
| 2314 | VkDeviceMemory mem) |
| 2315 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2316 | VkResult result = get_dispatch_table(pc_device_table_map, device)->FreeMemory(device, mem); |
| 2317 | |
| 2318 | PostFreeMemory(device, mem, result); |
| 2319 | |
| 2320 | return result; |
| 2321 | } |
| 2322 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2323 | bool PostMapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2324 | VkDevice device, |
| 2325 | VkDeviceMemory mem, |
| 2326 | VkDeviceSize offset, |
| 2327 | VkDeviceSize size, |
| 2328 | VkMemoryMapFlags flags, |
| 2329 | void** ppData, |
| 2330 | VkResult result) |
| 2331 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2332 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2333 | |
| 2334 | |
| 2335 | |
| 2336 | |
| 2337 | if(ppData == nullptr) |
| 2338 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2339 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2340 | "vkMapMemory parameter, void** ppData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2341 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2342 | } |
| 2343 | |
| 2344 | if(result != VK_SUCCESS) |
| 2345 | { |
| 2346 | std::string reason = "vkMapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2347 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2348 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2349 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2350 | |
| 2351 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2352 | } |
| 2353 | |
| 2354 | VK_LAYER_EXPORT VkResult VKAPI vkMapMemory( |
| 2355 | VkDevice device, |
| 2356 | VkDeviceMemory mem, |
| 2357 | VkDeviceSize offset, |
| 2358 | VkDeviceSize size, |
| 2359 | VkMemoryMapFlags flags, |
| 2360 | void** ppData) |
| 2361 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2362 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, mem, offset, size, flags, ppData); |
| 2363 | |
| 2364 | PostMapMemory(device, mem, offset, size, flags, ppData, result); |
| 2365 | |
| 2366 | return result; |
| 2367 | } |
| 2368 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2369 | bool PostUnmapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2370 | VkDevice device, |
| 2371 | VkDeviceMemory mem, |
| 2372 | VkResult result) |
| 2373 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2374 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2375 | |
| 2376 | if(result != VK_SUCCESS) |
| 2377 | { |
| 2378 | std::string reason = "vkUnmapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2379 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2380 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2381 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2382 | |
| 2383 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2384 | } |
| 2385 | |
| 2386 | VK_LAYER_EXPORT VkResult VKAPI vkUnmapMemory( |
| 2387 | VkDevice device, |
| 2388 | VkDeviceMemory mem) |
| 2389 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2390 | VkResult result = get_dispatch_table(pc_device_table_map, device)->UnmapMemory(device, mem); |
| 2391 | |
| 2392 | PostUnmapMemory(device, mem, result); |
| 2393 | |
| 2394 | return result; |
| 2395 | } |
| 2396 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2397 | bool PreFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2398 | VkDevice device, |
| 2399 | const VkMappedMemoryRange* pMemRanges) |
| 2400 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2401 | if(pMemRanges == nullptr) |
| 2402 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2403 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2404 | "vkFlushMappedMemoryRanges parameter, const VkMappedMemoryRange* pMemRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2405 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2406 | } |
| 2407 | if(pMemRanges->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2408 | pMemRanges->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2409 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2410 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2411 | "vkFlushMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2412 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2413 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2414 | |
| 2415 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2416 | } |
| 2417 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2418 | bool PostFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2419 | VkDevice device, |
| 2420 | uint32_t memRangeCount, |
| 2421 | VkResult result) |
| 2422 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2423 | |
| 2424 | |
| 2425 | if(result != VK_SUCCESS) |
| 2426 | { |
| 2427 | std::string reason = "vkFlushMappedMemoryRanges 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 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2435 | VK_LAYER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2436 | VkDevice device, |
| 2437 | uint32_t memRangeCount, |
| 2438 | const VkMappedMemoryRange* pMemRanges) |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2439 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2440 | PreFlushMappedMemoryRanges(device, pMemRanges); |
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)->FlushMappedMemoryRanges(device, memRangeCount, pMemRanges); |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2443 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2444 | PostFlushMappedMemoryRanges(device, memRangeCount, result); |
| 2445 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2446 | return result; |
| 2447 | } |
| 2448 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2449 | bool PreInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2450 | VkDevice device, |
| 2451 | const VkMappedMemoryRange* pMemRanges) |
| 2452 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2453 | if(pMemRanges == nullptr) |
| 2454 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2455 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2456 | "vkInvalidateMappedMemoryRanges parameter, const VkMappedMemoryRange* pMemRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2457 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2458 | } |
| 2459 | if(pMemRanges->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2460 | pMemRanges->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2461 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2462 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2463 | "vkInvalidateMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2464 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2465 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2466 | |
| 2467 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2468 | } |
| 2469 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2470 | bool PostInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2471 | VkDevice device, |
| 2472 | uint32_t memRangeCount, |
| 2473 | VkResult result) |
| 2474 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2475 | |
| 2476 | |
| 2477 | if(result != VK_SUCCESS) |
| 2478 | { |
| 2479 | std::string reason = "vkInvalidateMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2480 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2481 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2482 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2483 | |
| 2484 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2485 | } |
| 2486 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2487 | VK_LAYER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2488 | VkDevice device, |
| 2489 | uint32_t memRangeCount, |
| 2490 | const VkMappedMemoryRange* pMemRanges) |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2491 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2492 | PreInvalidateMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2493 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2494 | 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] | 2495 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2496 | PostInvalidateMappedMemoryRanges(device, memRangeCount, result); |
| 2497 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2498 | return result; |
| 2499 | } |
| 2500 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2501 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment( |
| 2502 | VkDevice device, |
| 2503 | VkDeviceMemory memory, |
| 2504 | VkDeviceSize* pCommittedMemoryInBytes) |
| 2505 | { |
| 2506 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
| 2507 | |
| 2508 | return result; |
| 2509 | } |
| 2510 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2511 | bool PostBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2512 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2513 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2514 | VkDeviceMemory mem, |
| 2515 | VkDeviceSize memOffset, |
| 2516 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2517 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2518 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2519 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2520 | |
| 2521 | |
| 2522 | if(result != VK_SUCCESS) |
| 2523 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2524 | std::string reason = "vkBindBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2525 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2526 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2527 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2528 | |
| 2529 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2530 | } |
| 2531 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2532 | VK_LAYER_EXPORT VkResult VKAPI vkBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2533 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2534 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2535 | VkDeviceMemory mem, |
| 2536 | VkDeviceSize memOffset) |
| 2537 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2538 | 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] | 2539 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2540 | PostBindBufferMemory(device, buffer, mem, memOffset, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2541 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2542 | return result; |
| 2543 | } |
| 2544 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2545 | bool PostBindImageMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2546 | VkDevice device, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2547 | VkImage image, |
| 2548 | VkDeviceMemory mem, |
| 2549 | VkDeviceSize memOffset, |
| 2550 | VkResult result) |
| 2551 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2552 | |
| 2553 | |
| 2554 | |
| 2555 | |
| 2556 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2557 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2558 | std::string reason = "vkBindImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2559 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2560 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2561 | } |
| 2562 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2563 | return true; |
| 2564 | } |
| 2565 | |
| 2566 | VK_LAYER_EXPORT VkResult VKAPI vkBindImageMemory( |
| 2567 | VkDevice device, |
| 2568 | VkImage image, |
| 2569 | VkDeviceMemory mem, |
| 2570 | VkDeviceSize memOffset) |
| 2571 | { |
| 2572 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, mem, memOffset); |
| 2573 | |
| 2574 | PostBindImageMemory(device, image, mem, memOffset, result); |
| 2575 | |
| 2576 | return result; |
| 2577 | } |
| 2578 | |
| 2579 | bool PostGetBufferMemoryRequirements( |
| 2580 | VkDevice device, |
| 2581 | VkBuffer buffer, |
| 2582 | VkMemoryRequirements* pMemoryRequirements, |
| 2583 | VkResult result) |
| 2584 | { |
| 2585 | |
| 2586 | |
| 2587 | if(pMemoryRequirements == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2588 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2589 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2590 | "vkGetBufferMemoryRequirements parameter, VkMemoryRequirements* pMemoryRequirements, is null pointer"); |
| 2591 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2592 | } |
| 2593 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2594 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2595 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2596 | std::string reason = "vkGetBufferMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2597 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2598 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2599 | } |
| 2600 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2601 | return true; |
| 2602 | } |
| 2603 | |
| 2604 | VK_LAYER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements( |
| 2605 | VkDevice device, |
| 2606 | VkBuffer buffer, |
| 2607 | VkMemoryRequirements* pMemoryRequirements) |
| 2608 | { |
| 2609 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
| 2610 | |
| 2611 | PostGetBufferMemoryRequirements(device, buffer, pMemoryRequirements, result); |
| 2612 | |
| 2613 | return result; |
| 2614 | } |
| 2615 | |
| 2616 | bool PostGetImageMemoryRequirements( |
| 2617 | VkDevice device, |
| 2618 | VkImage image, |
| 2619 | VkMemoryRequirements* pMemoryRequirements, |
| 2620 | VkResult result) |
| 2621 | { |
| 2622 | |
| 2623 | |
| 2624 | if(pMemoryRequirements == nullptr) |
| 2625 | { |
| 2626 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2627 | "vkGetImageMemoryRequirements parameter, VkMemoryRequirements* pMemoryRequirements, is null pointer"); |
| 2628 | return false; |
| 2629 | } |
| 2630 | |
| 2631 | if(result != VK_SUCCESS) |
| 2632 | { |
| 2633 | std::string reason = "vkGetImageMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2634 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2635 | return false; |
| 2636 | } |
| 2637 | |
| 2638 | return true; |
| 2639 | } |
| 2640 | |
| 2641 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageMemoryRequirements( |
| 2642 | VkDevice device, |
| 2643 | VkImage image, |
| 2644 | VkMemoryRequirements* pMemoryRequirements) |
| 2645 | { |
| 2646 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
| 2647 | |
| 2648 | PostGetImageMemoryRequirements(device, image, pMemoryRequirements, result); |
| 2649 | |
| 2650 | return result; |
| 2651 | } |
| 2652 | |
| 2653 | bool PostGetImageSparseMemoryRequirements( |
| 2654 | VkDevice device, |
| 2655 | VkImage image, |
| 2656 | uint32_t* pNumRequirements, |
| 2657 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements, |
| 2658 | VkResult result) |
| 2659 | { |
| 2660 | |
| 2661 | |
| 2662 | if(pNumRequirements == nullptr) |
| 2663 | { |
| 2664 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2665 | "vkGetImageSparseMemoryRequirements parameter, uint32_t* pNumRequirements, is null pointer"); |
| 2666 | return false; |
| 2667 | } |
| 2668 | |
| 2669 | if(pSparseMemoryRequirements == nullptr) |
| 2670 | { |
| 2671 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2672 | "vkGetImageSparseMemoryRequirements parameter, VkSparseImageMemoryRequirements* pSparseMemoryRequirements, is null pointer"); |
| 2673 | return false; |
| 2674 | } |
| 2675 | if(pSparseMemoryRequirements->formatProps.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2676 | pSparseMemoryRequirements->formatProps.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2677 | { |
| 2678 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2679 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect pSparseMemoryRequirements->formatProps.aspect, is unrecognized enumerator"); |
| 2680 | return false; |
| 2681 | } |
| 2682 | if(!ValidateEnumerator((VkSparseImageFormatFlagBits)pSparseMemoryRequirements->formatProps.flags)) |
| 2683 | { |
| 2684 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkSparseImageFormatFlags pSparseMemoryRequirements->formatProps.flags, is " + EnumeratorString((VkSparseImageFormatFlagBits)pSparseMemoryRequirements->formatProps.flags); |
| 2685 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2686 | return false; |
| 2687 | } |
| 2688 | |
| 2689 | if(result != VK_SUCCESS) |
| 2690 | { |
| 2691 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2692 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2693 | return false; |
| 2694 | } |
| 2695 | |
| 2696 | return true; |
| 2697 | } |
| 2698 | |
| 2699 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements( |
| 2700 | VkDevice device, |
| 2701 | VkImage image, |
| 2702 | uint32_t* pNumRequirements, |
| 2703 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2704 | { |
| 2705 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements); |
| 2706 | |
| 2707 | PostGetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements, result); |
| 2708 | |
| 2709 | return result; |
| 2710 | } |
| 2711 | |
| 2712 | bool PostGetPhysicalDeviceSparseImageFormatProperties( |
| 2713 | VkPhysicalDevice physicalDevice, |
| 2714 | VkFormat format, |
| 2715 | VkImageType type, |
| 2716 | uint32_t samples, |
| 2717 | VkImageUsageFlags usage, |
| 2718 | VkImageTiling tiling, |
| 2719 | uint32_t* pNumProperties, |
| 2720 | VkSparseImageFormatProperties* pProperties, |
| 2721 | VkResult result) |
| 2722 | { |
| 2723 | |
| 2724 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2725 | format > VK_FORMAT_END_RANGE) |
| 2726 | { |
| 2727 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2728 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkFormat format, is unrecognized enumerator"); |
| 2729 | return false; |
| 2730 | } |
| 2731 | |
| 2732 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 2733 | type > VK_IMAGE_TYPE_END_RANGE) |
| 2734 | { |
| 2735 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2736 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageType type, is unrecognized enumerator"); |
| 2737 | return false; |
| 2738 | } |
| 2739 | |
| 2740 | |
| 2741 | if(!ValidateEnumerator((VkImageUsageFlagBits)usage)) |
| 2742 | { |
| 2743 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageUsageFlags usage, is " + EnumeratorString((VkImageUsageFlagBits)usage); |
| 2744 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2745 | return false; |
| 2746 | } |
| 2747 | |
| 2748 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 2749 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 2750 | { |
| 2751 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2752 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageTiling tiling, is unrecognized enumerator"); |
| 2753 | return false; |
| 2754 | } |
| 2755 | |
| 2756 | if(pNumProperties == nullptr) |
| 2757 | { |
| 2758 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2759 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, uint32_t* pNumProperties, is null pointer"); |
| 2760 | return false; |
| 2761 | } |
| 2762 | |
| 2763 | if(pProperties == nullptr) |
| 2764 | { |
| 2765 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2766 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkSparseImageFormatProperties* pProperties, is null pointer"); |
| 2767 | return false; |
| 2768 | } |
| 2769 | if(pProperties->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2770 | pProperties->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2771 | { |
| 2772 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2773 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspect, is unrecognized enumerator"); |
| 2774 | return false; |
| 2775 | } |
| 2776 | if(!ValidateEnumerator((VkSparseImageFormatFlagBits)pProperties->flags)) |
| 2777 | { |
| 2778 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkSparseImageFormatFlags pProperties->flags, is " + EnumeratorString((VkSparseImageFormatFlagBits)pProperties->flags); |
| 2779 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2780 | return false; |
| 2781 | } |
| 2782 | |
| 2783 | if(result != VK_SUCCESS) |
| 2784 | { |
| 2785 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2786 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2787 | return false; |
| 2788 | } |
| 2789 | |
| 2790 | return true; |
| 2791 | } |
| 2792 | |
| 2793 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2794 | VkPhysicalDevice physicalDevice, |
| 2795 | VkFormat format, |
| 2796 | VkImageType type, |
| 2797 | uint32_t samples, |
| 2798 | VkImageUsageFlags usage, |
| 2799 | VkImageTiling tiling, |
| 2800 | uint32_t* pNumProperties, |
| 2801 | VkSparseImageFormatProperties* pProperties) |
| 2802 | { |
| 2803 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties); |
| 2804 | |
| 2805 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties, result); |
| 2806 | |
| 2807 | return result; |
| 2808 | } |
| 2809 | |
| 2810 | bool PreQueueBindSparseBufferMemory( |
| 2811 | VkQueue queue, |
| 2812 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2813 | { |
| 2814 | if(pBindInfo == nullptr) |
| 2815 | { |
| 2816 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2817 | "vkQueueBindSparseBufferMemory parameter, const VkSparseMemoryBindInfo* pBindInfo, is null pointer"); |
| 2818 | return false; |
| 2819 | } |
| 2820 | |
| 2821 | return true; |
| 2822 | } |
| 2823 | |
| 2824 | bool PostQueueBindSparseBufferMemory( |
| 2825 | VkQueue queue, |
| 2826 | VkBuffer buffer, |
| 2827 | uint32_t numBindings, |
| 2828 | VkResult result) |
| 2829 | { |
| 2830 | |
| 2831 | |
| 2832 | |
| 2833 | if(result != VK_SUCCESS) |
| 2834 | { |
| 2835 | std::string reason = "vkQueueBindSparseBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2836 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2837 | return false; |
| 2838 | } |
| 2839 | |
| 2840 | return true; |
| 2841 | } |
| 2842 | |
| 2843 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory( |
| 2844 | VkQueue queue, |
| 2845 | VkBuffer buffer, |
| 2846 | uint32_t numBindings, |
| 2847 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2848 | { |
| 2849 | PreQueueBindSparseBufferMemory(queue, pBindInfo); |
| 2850 | |
| 2851 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo); |
| 2852 | |
| 2853 | PostQueueBindSparseBufferMemory(queue, buffer, numBindings, result); |
| 2854 | |
| 2855 | return result; |
| 2856 | } |
| 2857 | |
| 2858 | bool PreQueueBindSparseImageOpaqueMemory( |
| 2859 | VkQueue queue, |
| 2860 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2861 | { |
| 2862 | if(pBindInfo == nullptr) |
| 2863 | { |
| 2864 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2865 | "vkQueueBindSparseImageOpaqueMemory parameter, const VkSparseMemoryBindInfo* pBindInfo, is null pointer"); |
| 2866 | return false; |
| 2867 | } |
| 2868 | |
| 2869 | return true; |
| 2870 | } |
| 2871 | |
| 2872 | bool PostQueueBindSparseImageOpaqueMemory( |
| 2873 | VkQueue queue, |
| 2874 | VkImage image, |
| 2875 | uint32_t numBindings, |
| 2876 | VkResult result) |
| 2877 | { |
| 2878 | |
| 2879 | |
| 2880 | |
| 2881 | if(result != VK_SUCCESS) |
| 2882 | { |
| 2883 | std::string reason = "vkQueueBindSparseImageOpaqueMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2884 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2885 | return false; |
| 2886 | } |
| 2887 | |
| 2888 | return true; |
| 2889 | } |
| 2890 | |
| 2891 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory( |
| 2892 | VkQueue queue, |
| 2893 | VkImage image, |
| 2894 | uint32_t numBindings, |
| 2895 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2896 | { |
| 2897 | PreQueueBindSparseImageOpaqueMemory(queue, pBindInfo); |
| 2898 | |
| 2899 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo); |
| 2900 | |
| 2901 | PostQueueBindSparseImageOpaqueMemory(queue, image, numBindings, result); |
| 2902 | |
| 2903 | return result; |
| 2904 | } |
| 2905 | |
| 2906 | bool PreQueueBindSparseImageMemory( |
| 2907 | VkQueue queue, |
| 2908 | const VkSparseImageMemoryBindInfo* pBindInfo) |
| 2909 | { |
| 2910 | if(pBindInfo == nullptr) |
| 2911 | { |
| 2912 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2913 | "vkQueueBindSparseImageMemory parameter, const VkSparseImageMemoryBindInfo* pBindInfo, is null pointer"); |
| 2914 | return false; |
| 2915 | } |
| 2916 | if(pBindInfo->subresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2917 | pBindInfo->subresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2918 | { |
| 2919 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2920 | "vkQueueBindSparseImageMemory parameter, VkImageAspect pBindInfo->subresource.aspect, is unrecognized enumerator"); |
| 2921 | return false; |
| 2922 | } |
| 2923 | if(!ValidateEnumerator((VkSparseMemoryBindFlagBits)pBindInfo->flags)) |
| 2924 | { |
| 2925 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkSparseMemoryBindFlags pBindInfo->flags, is " + EnumeratorString((VkSparseMemoryBindFlagBits)pBindInfo->flags); |
| 2926 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2927 | return false; |
| 2928 | } |
| 2929 | |
| 2930 | return true; |
| 2931 | } |
| 2932 | |
| 2933 | bool PostQueueBindSparseImageMemory( |
| 2934 | VkQueue queue, |
| 2935 | VkImage image, |
| 2936 | uint32_t numBindings, |
| 2937 | VkResult result) |
| 2938 | { |
| 2939 | |
| 2940 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2941 | |
| 2942 | if(result != VK_SUCCESS) |
| 2943 | { |
| 2944 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2945 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2946 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2947 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2948 | |
| 2949 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2950 | } |
| 2951 | |
| 2952 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2953 | VkQueue queue, |
| 2954 | VkImage image, |
| 2955 | uint32_t numBindings, |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 2956 | const VkSparseImageMemoryBindInfo* pBindInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2957 | { |
| 2958 | PreQueueBindSparseImageMemory(queue, pBindInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2959 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 2960 | 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] | 2961 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2962 | PostQueueBindSparseImageMemory(queue, image, numBindings, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2963 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2964 | return result; |
| 2965 | } |
| 2966 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2967 | bool PreCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2968 | VkDevice device, |
| 2969 | const VkFenceCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2970 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2971 | if(pCreateInfo == nullptr) |
| 2972 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2973 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2974 | "vkCreateFence parameter, const VkFenceCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2975 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2976 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2977 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2978 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2979 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2980 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2981 | "vkCreateFence parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2982 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2983 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2984 | if(!ValidateEnumerator((VkFenceCreateFlagBits)pCreateInfo->flags)) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2985 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2986 | std::string reason = "vkCreateFence parameter, VkFenceCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkFenceCreateFlagBits)pCreateInfo->flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2987 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2988 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2989 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2990 | |
| 2991 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2992 | } |
| 2993 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2994 | bool PostCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2995 | VkDevice device, |
| 2996 | VkFence* pFence, |
| 2997 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2998 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2999 | |
| 3000 | if(pFence == nullptr) |
| 3001 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3002 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3003 | "vkCreateFence parameter, VkFence* pFence, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3004 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3005 | } |
| 3006 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 3007 | if(result != VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3008 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3009 | std::string reason = "vkCreateFence parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3010 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3011 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3012 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3013 | |
| 3014 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3015 | } |
| 3016 | |
| 3017 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFence( |
| 3018 | VkDevice device, |
| 3019 | const VkFenceCreateInfo* pCreateInfo, |
| 3020 | VkFence* pFence) |
| 3021 | { |
| 3022 | PreCreateFence(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3023 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3024 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pFence); |
| 3025 | |
| 3026 | PostCreateFence(device, pFence, result); |
| 3027 | |
| 3028 | return result; |
| 3029 | } |
| 3030 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3031 | bool PostDestroyFence( |
| 3032 | VkDevice device, |
| 3033 | VkFence fence, |
| 3034 | VkResult result) |
| 3035 | { |
| 3036 | |
| 3037 | |
| 3038 | if(result != VK_SUCCESS) |
| 3039 | { |
| 3040 | std::string reason = "vkDestroyFence parameter, VkResult result, is " + EnumeratorString(result); |
| 3041 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3042 | return false; |
| 3043 | } |
| 3044 | |
| 3045 | return true; |
| 3046 | } |
| 3047 | |
| 3048 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyFence( |
| 3049 | VkDevice device, |
| 3050 | VkFence fence) |
| 3051 | { |
| 3052 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyFence(device, fence); |
| 3053 | |
| 3054 | PostDestroyFence(device, fence, result); |
| 3055 | |
| 3056 | return result; |
| 3057 | } |
| 3058 | |
| 3059 | bool PreResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3060 | VkDevice device, |
| 3061 | const VkFence* pFences) |
| 3062 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3063 | if(pFences == nullptr) |
| 3064 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3065 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3066 | "vkResetFences parameter, const VkFence* pFences, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3067 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3068 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3069 | |
| 3070 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3071 | } |
| 3072 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3073 | bool PostResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3074 | VkDevice device, |
| 3075 | uint32_t fenceCount, |
| 3076 | VkResult result) |
| 3077 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3078 | |
| 3079 | |
| 3080 | if(result != VK_SUCCESS) |
| 3081 | { |
| 3082 | std::string reason = "vkResetFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3083 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3084 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3085 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3086 | |
| 3087 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3088 | } |
| 3089 | |
| 3090 | VK_LAYER_EXPORT VkResult VKAPI vkResetFences( |
| 3091 | VkDevice device, |
| 3092 | uint32_t fenceCount, |
| 3093 | const VkFence* pFences) |
| 3094 | { |
| 3095 | PreResetFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3096 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3097 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences); |
| 3098 | |
| 3099 | PostResetFences(device, fenceCount, result); |
| 3100 | |
| 3101 | return result; |
| 3102 | } |
| 3103 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3104 | bool PostGetFenceStatus( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3105 | VkDevice device, |
| 3106 | VkFence fence, |
| 3107 | VkResult result) |
| 3108 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3109 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3110 | |
| 3111 | if(result != VK_SUCCESS) |
| 3112 | { |
| 3113 | std::string reason = "vkGetFenceStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3114 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3115 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3116 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3117 | |
| 3118 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3119 | } |
| 3120 | |
| 3121 | VK_LAYER_EXPORT VkResult VKAPI vkGetFenceStatus( |
| 3122 | VkDevice device, |
| 3123 | VkFence fence) |
| 3124 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3125 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence); |
| 3126 | |
| 3127 | PostGetFenceStatus(device, fence, result); |
| 3128 | |
| 3129 | return result; |
| 3130 | } |
| 3131 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3132 | bool PreWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3133 | VkDevice device, |
| 3134 | const VkFence* pFences) |
| 3135 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3136 | if(pFences == nullptr) |
| 3137 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3138 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3139 | "vkWaitForFences parameter, const VkFence* pFences, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3140 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3141 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3142 | |
| 3143 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3144 | } |
| 3145 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3146 | bool PostWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3147 | VkDevice device, |
| 3148 | uint32_t fenceCount, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3149 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3150 | uint64_t timeout, |
| 3151 | VkResult result) |
| 3152 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3153 | |
| 3154 | |
| 3155 | |
| 3156 | |
| 3157 | if(result != VK_SUCCESS) |
| 3158 | { |
| 3159 | std::string reason = "vkWaitForFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3160 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3161 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3162 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3163 | |
| 3164 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3165 | } |
| 3166 | |
| 3167 | VK_LAYER_EXPORT VkResult VKAPI vkWaitForFences( |
| 3168 | VkDevice device, |
| 3169 | uint32_t fenceCount, |
| 3170 | const VkFence* pFences, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3171 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3172 | uint64_t timeout) |
| 3173 | { |
| 3174 | PreWaitForFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3175 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3176 | VkResult result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 3177 | |
| 3178 | PostWaitForFences(device, fenceCount, waitAll, timeout, result); |
| 3179 | |
| 3180 | return result; |
| 3181 | } |
| 3182 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3183 | bool PreCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3184 | VkDevice device, |
| 3185 | const VkSemaphoreCreateInfo* pCreateInfo) |
| 3186 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3187 | if(pCreateInfo == nullptr) |
| 3188 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3189 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3190 | "vkCreateSemaphore parameter, const VkSemaphoreCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3191 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3192 | } |
| 3193 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3194 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3195 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3196 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3197 | "vkCreateSemaphore parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3198 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3199 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3200 | |
| 3201 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3202 | } |
| 3203 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3204 | bool PostCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3205 | VkDevice device, |
| 3206 | VkSemaphore* pSemaphore, |
| 3207 | VkResult result) |
| 3208 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3209 | |
| 3210 | if(pSemaphore == nullptr) |
| 3211 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3212 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3213 | "vkCreateSemaphore parameter, VkSemaphore* pSemaphore, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3214 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3215 | } |
| 3216 | |
| 3217 | if(result != VK_SUCCESS) |
| 3218 | { |
| 3219 | std::string reason = "vkCreateSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3220 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3221 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3222 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3223 | |
| 3224 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3225 | } |
| 3226 | |
| 3227 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSemaphore( |
| 3228 | VkDevice device, |
| 3229 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 3230 | VkSemaphore* pSemaphore) |
| 3231 | { |
| 3232 | PreCreateSemaphore(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3233 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3234 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pSemaphore); |
| 3235 | |
| 3236 | PostCreateSemaphore(device, pSemaphore, result); |
| 3237 | |
| 3238 | return result; |
| 3239 | } |
| 3240 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3241 | bool PostDestroySemaphore( |
| 3242 | VkDevice device, |
| 3243 | VkSemaphore semaphore, |
| 3244 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3245 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3246 | |
| 3247 | |
| 3248 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3249 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3250 | std::string reason = "vkDestroySemaphore parameter, VkResult result, is " + EnumeratorString(result); |
| 3251 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3252 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3253 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3254 | |
| 3255 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3256 | } |
| 3257 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3258 | VK_LAYER_EXPORT VkResult VKAPI vkDestroySemaphore( |
| 3259 | VkDevice device, |
| 3260 | VkSemaphore semaphore) |
| 3261 | { |
| 3262 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroySemaphore(device, semaphore); |
| 3263 | |
| 3264 | PostDestroySemaphore(device, semaphore, result); |
| 3265 | |
| 3266 | return result; |
| 3267 | } |
| 3268 | |
| 3269 | bool PostQueueSignalSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3270 | VkQueue queue, |
| 3271 | VkSemaphore semaphore, |
| 3272 | VkResult result) |
| 3273 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3274 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3275 | |
| 3276 | if(result != VK_SUCCESS) |
| 3277 | { |
| 3278 | std::string reason = "vkQueueSignalSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3279 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3280 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3281 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3282 | |
| 3283 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3284 | } |
| 3285 | |
| 3286 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSignalSemaphore( |
| 3287 | VkQueue queue, |
| 3288 | VkSemaphore semaphore) |
| 3289 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3290 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSignalSemaphore(queue, semaphore); |
| 3291 | |
| 3292 | PostQueueSignalSemaphore(queue, semaphore, result); |
| 3293 | |
| 3294 | return result; |
| 3295 | } |
| 3296 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3297 | bool PostQueueWaitSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3298 | VkQueue queue, |
| 3299 | VkSemaphore semaphore, |
| 3300 | VkResult result) |
| 3301 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3302 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3303 | |
| 3304 | if(result != VK_SUCCESS) |
| 3305 | { |
| 3306 | std::string reason = "vkQueueWaitSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3307 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3308 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3309 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3310 | |
| 3311 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3312 | } |
| 3313 | |
| 3314 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitSemaphore( |
| 3315 | VkQueue queue, |
| 3316 | VkSemaphore semaphore) |
| 3317 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3318 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitSemaphore(queue, semaphore); |
| 3319 | |
| 3320 | PostQueueWaitSemaphore(queue, semaphore, result); |
| 3321 | |
| 3322 | return result; |
| 3323 | } |
| 3324 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3325 | bool PreCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3326 | VkDevice device, |
| 3327 | const VkEventCreateInfo* pCreateInfo) |
| 3328 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3329 | if(pCreateInfo == nullptr) |
| 3330 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3331 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3332 | "vkCreateEvent parameter, const VkEventCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3333 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3334 | } |
| 3335 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3336 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3337 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3338 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3339 | "vkCreateEvent parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3340 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3341 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3342 | |
| 3343 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3344 | } |
| 3345 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3346 | bool PostCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3347 | VkDevice device, |
| 3348 | VkEvent* pEvent, |
| 3349 | VkResult result) |
| 3350 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3351 | |
| 3352 | if(pEvent == nullptr) |
| 3353 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3354 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3355 | "vkCreateEvent parameter, VkEvent* pEvent, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3356 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3357 | } |
| 3358 | |
| 3359 | if(result != VK_SUCCESS) |
| 3360 | { |
| 3361 | std::string reason = "vkCreateEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3362 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3363 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3364 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3365 | |
| 3366 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3367 | } |
| 3368 | |
| 3369 | VK_LAYER_EXPORT VkResult VKAPI vkCreateEvent( |
| 3370 | VkDevice device, |
| 3371 | const VkEventCreateInfo* pCreateInfo, |
| 3372 | VkEvent* pEvent) |
| 3373 | { |
| 3374 | PreCreateEvent(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3375 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3376 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pEvent); |
| 3377 | |
| 3378 | PostCreateEvent(device, pEvent, result); |
| 3379 | |
| 3380 | return result; |
| 3381 | } |
| 3382 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3383 | bool PostDestroyEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3384 | VkDevice device, |
| 3385 | VkEvent event, |
| 3386 | VkResult result) |
| 3387 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3388 | |
| 3389 | |
| 3390 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3391 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3392 | std::string reason = "vkDestroyEvent parameter, VkResult result, is " + EnumeratorString(result); |
| 3393 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3394 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3395 | } |
| 3396 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3397 | return true; |
| 3398 | } |
| 3399 | |
| 3400 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyEvent( |
| 3401 | VkDevice device, |
| 3402 | VkEvent event) |
| 3403 | { |
| 3404 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyEvent(device, event); |
| 3405 | |
| 3406 | PostDestroyEvent(device, event, result); |
| 3407 | |
| 3408 | return result; |
| 3409 | } |
| 3410 | |
| 3411 | bool PostGetEventStatus( |
| 3412 | VkDevice device, |
| 3413 | VkEvent event, |
| 3414 | VkResult result) |
| 3415 | { |
| 3416 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3417 | |
| 3418 | if(result != VK_SUCCESS) |
| 3419 | { |
| 3420 | std::string reason = "vkGetEventStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3421 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3422 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3423 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3424 | |
| 3425 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3426 | } |
| 3427 | |
| 3428 | VK_LAYER_EXPORT VkResult VKAPI vkGetEventStatus( |
| 3429 | VkDevice device, |
| 3430 | VkEvent event) |
| 3431 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3432 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event); |
| 3433 | |
| 3434 | PostGetEventStatus(device, event, result); |
| 3435 | |
| 3436 | return result; |
| 3437 | } |
| 3438 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3439 | bool PostSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3440 | VkDevice device, |
| 3441 | VkEvent event, |
| 3442 | VkResult result) |
| 3443 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3444 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3445 | |
| 3446 | if(result != VK_SUCCESS) |
| 3447 | { |
| 3448 | std::string reason = "vkSetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3449 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3450 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3451 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3452 | |
| 3453 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3454 | } |
| 3455 | |
| 3456 | VK_LAYER_EXPORT VkResult VKAPI vkSetEvent( |
| 3457 | VkDevice device, |
| 3458 | VkEvent event) |
| 3459 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3460 | VkResult result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event); |
| 3461 | |
| 3462 | PostSetEvent(device, event, result); |
| 3463 | |
| 3464 | return result; |
| 3465 | } |
| 3466 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3467 | bool PostResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3468 | VkDevice device, |
| 3469 | VkEvent event, |
| 3470 | VkResult result) |
| 3471 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3472 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3473 | |
| 3474 | if(result != VK_SUCCESS) |
| 3475 | { |
| 3476 | std::string reason = "vkResetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3477 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3478 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3479 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3480 | |
| 3481 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3482 | } |
| 3483 | |
| 3484 | VK_LAYER_EXPORT VkResult VKAPI vkResetEvent( |
| 3485 | VkDevice device, |
| 3486 | VkEvent event) |
| 3487 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3488 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event); |
| 3489 | |
| 3490 | PostResetEvent(device, event, result); |
| 3491 | |
| 3492 | return result; |
| 3493 | } |
| 3494 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3495 | bool PreCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3496 | VkDevice device, |
| 3497 | const VkQueryPoolCreateInfo* pCreateInfo) |
| 3498 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3499 | if(pCreateInfo == nullptr) |
| 3500 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3501 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3502 | "vkCreateQueryPool parameter, const VkQueryPoolCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3503 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3504 | } |
| 3505 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3506 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3507 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3508 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3509 | "vkCreateQueryPool parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3510 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3511 | } |
| 3512 | if(pCreateInfo->queryType < VK_QUERY_TYPE_BEGIN_RANGE || |
| 3513 | pCreateInfo->queryType > VK_QUERY_TYPE_END_RANGE) |
| 3514 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3515 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3516 | "vkCreateQueryPool parameter, VkQueryType pCreateInfo->queryType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3517 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3518 | } |
| 3519 | if(!ValidateEnumerator((VkQueryPipelineStatisticFlagBits)pCreateInfo->pipelineStatistics)) |
| 3520 | { |
| 3521 | std::string reason = "vkCreateQueryPool parameter, VkQueryPipelineStatisticFlags pCreateInfo->pipelineStatistics, is " + EnumeratorString((VkQueryPipelineStatisticFlagBits)pCreateInfo->pipelineStatistics); |
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 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3529 | bool PostCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3530 | VkDevice device, |
| 3531 | VkQueryPool* pQueryPool, |
| 3532 | VkResult result) |
| 3533 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3534 | |
| 3535 | if(pQueryPool == nullptr) |
| 3536 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3537 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3538 | "vkCreateQueryPool parameter, VkQueryPool* pQueryPool, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3539 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3540 | } |
| 3541 | |
| 3542 | if(result != VK_SUCCESS) |
| 3543 | { |
| 3544 | std::string reason = "vkCreateQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3545 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3546 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3547 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3548 | |
| 3549 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3550 | } |
| 3551 | |
| 3552 | VK_LAYER_EXPORT VkResult VKAPI vkCreateQueryPool( |
| 3553 | VkDevice device, |
| 3554 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3555 | VkQueryPool* pQueryPool) |
| 3556 | { |
| 3557 | PreCreateQueryPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3558 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3559 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 3560 | |
| 3561 | PostCreateQueryPool(device, pQueryPool, result); |
| 3562 | |
| 3563 | return result; |
| 3564 | } |
| 3565 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3566 | bool PostDestroyQueryPool( |
| 3567 | VkDevice device, |
| 3568 | VkQueryPool queryPool, |
| 3569 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3570 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3571 | |
| 3572 | |
| 3573 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3574 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3575 | std::string reason = "vkDestroyQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
| 3576 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3577 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3578 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3579 | |
| 3580 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3581 | } |
| 3582 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3583 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyQueryPool( |
| 3584 | VkDevice device, |
| 3585 | VkQueryPool queryPool) |
| 3586 | { |
| 3587 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyQueryPool(device, queryPool); |
| 3588 | |
| 3589 | PostDestroyQueryPool(device, queryPool, result); |
| 3590 | |
| 3591 | return result; |
| 3592 | } |
| 3593 | |
| 3594 | bool PostGetQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3595 | VkDevice device, |
| 3596 | VkQueryPool queryPool, |
| 3597 | uint32_t startQuery, |
| 3598 | uint32_t queryCount, |
| 3599 | size_t* pDataSize, |
| 3600 | void* pData, |
| 3601 | VkQueryResultFlags flags, |
| 3602 | VkResult result) |
| 3603 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3604 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3605 | |
| 3606 | |
| 3607 | |
| 3608 | if(pDataSize == nullptr) |
| 3609 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3610 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3611 | "vkGetQueryPoolResults parameter, size_t* pDataSize, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3612 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3613 | } |
| 3614 | |
| 3615 | if(pData == nullptr) |
| 3616 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3617 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3618 | "vkGetQueryPoolResults parameter, void* pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3619 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3620 | } |
| 3621 | |
| 3622 | if(!ValidateEnumerator((VkQueryResultFlagBits)flags)) |
| 3623 | { |
| 3624 | std::string reason = "vkGetQueryPoolResults parameter, VkQueryResultFlags flags, is " + EnumeratorString((VkQueryResultFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3625 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3626 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3627 | } |
| 3628 | |
| 3629 | if(result != VK_SUCCESS) |
| 3630 | { |
| 3631 | std::string reason = "vkGetQueryPoolResults parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3632 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3633 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3634 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3635 | |
| 3636 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3637 | } |
| 3638 | |
| 3639 | VK_LAYER_EXPORT VkResult VKAPI vkGetQueryPoolResults( |
| 3640 | VkDevice device, |
| 3641 | VkQueryPool queryPool, |
| 3642 | uint32_t startQuery, |
| 3643 | uint32_t queryCount, |
| 3644 | size_t* pDataSize, |
| 3645 | void* pData, |
| 3646 | VkQueryResultFlags flags) |
| 3647 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3648 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags); |
| 3649 | |
| 3650 | PostGetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags, result); |
| 3651 | |
| 3652 | return result; |
| 3653 | } |
| 3654 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3655 | bool PreCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3656 | VkDevice device, |
| 3657 | const VkBufferCreateInfo* pCreateInfo) |
| 3658 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3659 | if(pCreateInfo == nullptr) |
| 3660 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3661 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3662 | "vkCreateBuffer parameter, const VkBufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3663 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3664 | } |
| 3665 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3666 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3667 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3668 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3669 | "vkCreateBuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3670 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3671 | } |
| 3672 | if(!ValidateEnumerator((VkBufferUsageFlagBits)pCreateInfo->usage)) |
| 3673 | { |
| 3674 | std::string reason = "vkCreateBuffer parameter, VkBufferUsageFlags pCreateInfo->usage, is " + EnumeratorString((VkBufferUsageFlagBits)pCreateInfo->usage); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3675 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3676 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3677 | } |
| 3678 | if(!ValidateEnumerator((VkBufferCreateFlagBits)pCreateInfo->flags)) |
| 3679 | { |
| 3680 | std::string reason = "vkCreateBuffer parameter, VkBufferCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkBufferCreateFlagBits)pCreateInfo->flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3681 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3682 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3683 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3684 | |
| 3685 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3686 | } |
| 3687 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3688 | bool PostCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3689 | VkDevice device, |
| 3690 | VkBuffer* pBuffer, |
| 3691 | VkResult result) |
| 3692 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3693 | |
| 3694 | if(pBuffer == nullptr) |
| 3695 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3696 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3697 | "vkCreateBuffer parameter, VkBuffer* pBuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3698 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3699 | } |
| 3700 | |
| 3701 | if(result != VK_SUCCESS) |
| 3702 | { |
| 3703 | std::string reason = "vkCreateBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3704 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3705 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3706 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3707 | |
| 3708 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3709 | } |
| 3710 | |
| 3711 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBuffer( |
| 3712 | VkDevice device, |
| 3713 | const VkBufferCreateInfo* pCreateInfo, |
| 3714 | VkBuffer* pBuffer) |
| 3715 | { |
| 3716 | PreCreateBuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3717 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3718 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pBuffer); |
| 3719 | |
| 3720 | PostCreateBuffer(device, pBuffer, result); |
| 3721 | |
| 3722 | return result; |
| 3723 | } |
| 3724 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3725 | bool PostDestroyBuffer( |
| 3726 | VkDevice device, |
| 3727 | VkBuffer buffer, |
| 3728 | VkResult result) |
| 3729 | { |
| 3730 | |
| 3731 | |
| 3732 | if(result != VK_SUCCESS) |
| 3733 | { |
| 3734 | std::string reason = "vkDestroyBuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 3735 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3736 | return false; |
| 3737 | } |
| 3738 | |
| 3739 | return true; |
| 3740 | } |
| 3741 | |
| 3742 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyBuffer( |
| 3743 | VkDevice device, |
| 3744 | VkBuffer buffer) |
| 3745 | { |
| 3746 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyBuffer(device, buffer); |
| 3747 | |
| 3748 | PostDestroyBuffer(device, buffer, result); |
| 3749 | |
| 3750 | return result; |
| 3751 | } |
| 3752 | |
| 3753 | bool PreCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3754 | VkDevice device, |
| 3755 | const VkBufferViewCreateInfo* pCreateInfo) |
| 3756 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3757 | if(pCreateInfo == nullptr) |
| 3758 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3759 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3760 | "vkCreateBufferView parameter, const VkBufferViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3761 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3762 | } |
| 3763 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3764 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3765 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3766 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3767 | "vkCreateBufferView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3768 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3769 | } |
| 3770 | if(pCreateInfo->viewType < VK_BUFFER_VIEW_TYPE_BEGIN_RANGE || |
| 3771 | pCreateInfo->viewType > VK_BUFFER_VIEW_TYPE_END_RANGE) |
| 3772 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3773 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3774 | "vkCreateBufferView parameter, VkBufferViewType pCreateInfo->viewType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3775 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3776 | } |
| 3777 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3778 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3779 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3780 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3781 | "vkCreateBufferView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3782 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3783 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3784 | |
| 3785 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3786 | } |
| 3787 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3788 | bool PostCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3789 | VkDevice device, |
| 3790 | VkBufferView* pView, |
| 3791 | VkResult result) |
| 3792 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3793 | |
| 3794 | if(pView == nullptr) |
| 3795 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3796 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3797 | "vkCreateBufferView parameter, VkBufferView* pView, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3798 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3799 | } |
| 3800 | |
| 3801 | if(result != VK_SUCCESS) |
| 3802 | { |
| 3803 | std::string reason = "vkCreateBufferView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3804 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3805 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3806 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3807 | |
| 3808 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3809 | } |
| 3810 | |
| 3811 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBufferView( |
| 3812 | VkDevice device, |
| 3813 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3814 | VkBufferView* pView) |
| 3815 | { |
| 3816 | PreCreateBufferView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3817 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3818 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pView); |
| 3819 | |
| 3820 | PostCreateBufferView(device, pView, result); |
| 3821 | |
| 3822 | return result; |
| 3823 | } |
| 3824 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3825 | bool PostDestroyBufferView( |
| 3826 | VkDevice device, |
| 3827 | VkBufferView bufferView, |
| 3828 | VkResult result) |
| 3829 | { |
| 3830 | |
| 3831 | |
| 3832 | if(result != VK_SUCCESS) |
| 3833 | { |
| 3834 | std::string reason = "vkDestroyBufferView parameter, VkResult result, is " + EnumeratorString(result); |
| 3835 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3836 | return false; |
| 3837 | } |
| 3838 | |
| 3839 | return true; |
| 3840 | } |
| 3841 | |
| 3842 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyBufferView( |
| 3843 | VkDevice device, |
| 3844 | VkBufferView bufferView) |
| 3845 | { |
| 3846 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyBufferView(device, bufferView); |
| 3847 | |
| 3848 | PostDestroyBufferView(device, bufferView, result); |
| 3849 | |
| 3850 | return result; |
| 3851 | } |
| 3852 | |
| 3853 | bool PreCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3854 | VkDevice device, |
| 3855 | const VkImageCreateInfo* pCreateInfo) |
| 3856 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3857 | if(pCreateInfo == nullptr) |
| 3858 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3859 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3860 | "vkCreateImage parameter, const VkImageCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3861 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3862 | } |
| 3863 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3864 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3865 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3866 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3867 | "vkCreateImage parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3868 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3869 | } |
| 3870 | if(pCreateInfo->imageType < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 3871 | pCreateInfo->imageType > VK_IMAGE_TYPE_END_RANGE) |
| 3872 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3873 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3874 | "vkCreateImage parameter, VkImageType pCreateInfo->imageType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3875 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3876 | } |
| 3877 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3878 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3879 | { |
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", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3881 | "vkCreateImage parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3882 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3883 | } |
| 3884 | if(pCreateInfo->tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 3885 | pCreateInfo->tiling > VK_IMAGE_TILING_END_RANGE) |
| 3886 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3887 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3888 | "vkCreateImage parameter, VkImageTiling pCreateInfo->tiling, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3889 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3890 | } |
| 3891 | if(!ValidateEnumerator((VkImageUsageFlagBits)pCreateInfo->usage)) |
| 3892 | { |
| 3893 | std::string reason = "vkCreateImage parameter, VkImageUsageFlags pCreateInfo->usage, is " + EnumeratorString((VkImageUsageFlagBits)pCreateInfo->usage); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3894 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3895 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3896 | } |
| 3897 | if(!ValidateEnumerator((VkImageCreateFlagBits)pCreateInfo->flags)) |
| 3898 | { |
| 3899 | std::string reason = "vkCreateImage parameter, VkImageCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkImageCreateFlagBits)pCreateInfo->flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3900 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3901 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3902 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3903 | |
| 3904 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3905 | } |
| 3906 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3907 | bool PostCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3908 | VkDevice device, |
| 3909 | VkImage* pImage, |
| 3910 | VkResult result) |
| 3911 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3912 | |
| 3913 | if(pImage == nullptr) |
| 3914 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3915 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3916 | "vkCreateImage parameter, VkImage* pImage, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3917 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3918 | } |
| 3919 | |
| 3920 | if(result != VK_SUCCESS) |
| 3921 | { |
| 3922 | std::string reason = "vkCreateImage parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3923 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3924 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3925 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3926 | |
| 3927 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3928 | } |
| 3929 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3930 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImage( |
| 3931 | VkDevice device, |
| 3932 | const VkImageCreateInfo* pCreateInfo, |
| 3933 | VkImage* pImage) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3934 | { |
| 3935 | PreCreateImage(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3936 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3937 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pImage); |
| 3938 | |
| 3939 | PostCreateImage(device, pImage, result); |
| 3940 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3941 | return result; |
| 3942 | } |
| 3943 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3944 | bool PostDestroyImage( |
| 3945 | VkDevice device, |
| 3946 | VkImage image, |
| 3947 | VkResult result) |
| 3948 | { |
| 3949 | |
| 3950 | |
| 3951 | if(result != VK_SUCCESS) |
| 3952 | { |
| 3953 | std::string reason = "vkDestroyImage parameter, VkResult result, is " + EnumeratorString(result); |
| 3954 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3955 | return false; |
| 3956 | } |
| 3957 | |
| 3958 | return true; |
| 3959 | } |
| 3960 | |
| 3961 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyImage( |
| 3962 | VkDevice device, |
| 3963 | VkImage image) |
| 3964 | { |
| 3965 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyImage(device, image); |
| 3966 | |
| 3967 | PostDestroyImage(device, image, result); |
| 3968 | |
| 3969 | return result; |
| 3970 | } |
| 3971 | |
| 3972 | bool PreGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3973 | VkDevice device, |
| 3974 | const VkImageSubresource* pSubresource) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3975 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3976 | if(pSubresource == nullptr) |
| 3977 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3978 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3979 | "vkGetImageSubresourceLayout parameter, const VkImageSubresource* pSubresource, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3980 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3981 | } |
| 3982 | if(pSubresource->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 3983 | pSubresource->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 3984 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3985 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3986 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3987 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3988 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3989 | |
| 3990 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3991 | } |
| 3992 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3993 | bool PostGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3994 | VkDevice device, |
| 3995 | VkImage image, |
| 3996 | VkSubresourceLayout* pLayout, |
| 3997 | VkResult result) |
| 3998 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3999 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4000 | |
| 4001 | if(pLayout == nullptr) |
| 4002 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4003 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4004 | "vkGetImageSubresourceLayout parameter, VkSubresourceLayout* pLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4005 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4006 | } |
| 4007 | |
| 4008 | if(result != VK_SUCCESS) |
| 4009 | { |
| 4010 | std::string reason = "vkGetImageSubresourceLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4011 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4012 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4013 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4014 | |
| 4015 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4016 | } |
| 4017 | |
| 4018 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout( |
| 4019 | VkDevice device, |
| 4020 | VkImage image, |
| 4021 | const VkImageSubresource* pSubresource, |
| 4022 | VkSubresourceLayout* pLayout) |
| 4023 | { |
| 4024 | PreGetImageSubresourceLayout(device, pSubresource); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4025 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4026 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
| 4027 | |
| 4028 | PostGetImageSubresourceLayout(device, image, pLayout, result); |
| 4029 | |
| 4030 | return result; |
| 4031 | } |
| 4032 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4033 | bool PreCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4034 | VkDevice device, |
| 4035 | const VkImageViewCreateInfo* pCreateInfo) |
| 4036 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4037 | if(pCreateInfo == nullptr) |
| 4038 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4039 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4040 | "vkCreateImageView parameter, const VkImageViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4041 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4042 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4043 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4044 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4045 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4046 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4047 | "vkCreateImageView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4048 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4049 | } |
| 4050 | if(pCreateInfo->viewType < VK_IMAGE_VIEW_TYPE_BEGIN_RANGE || |
| 4051 | pCreateInfo->viewType > VK_IMAGE_VIEW_TYPE_END_RANGE) |
| 4052 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4053 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4054 | "vkCreateImageView parameter, VkImageViewType pCreateInfo->viewType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4055 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4056 | } |
| 4057 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4058 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4059 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4060 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4061 | "vkCreateImageView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4062 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4063 | } |
| 4064 | if(pCreateInfo->channels.r < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4065 | pCreateInfo->channels.r > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4066 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4067 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4068 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.r, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4069 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4070 | } |
| 4071 | if(pCreateInfo->channels.g < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4072 | pCreateInfo->channels.g > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4073 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4074 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4075 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.g, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4076 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4077 | } |
| 4078 | if(pCreateInfo->channels.b < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4079 | pCreateInfo->channels.b > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4080 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4081 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4082 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.b, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4083 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4084 | } |
| 4085 | if(pCreateInfo->channels.a < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4086 | pCreateInfo->channels.a > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4087 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4088 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4089 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.a, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4090 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4091 | } |
| 4092 | if(pCreateInfo->subresourceRange.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 4093 | pCreateInfo->subresourceRange.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 4094 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4095 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4096 | "vkCreateImageView parameter, VkImageAspect pCreateInfo->subresourceRange.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4097 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4098 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4099 | |
| 4100 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4101 | } |
| 4102 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4103 | bool PostCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4104 | VkDevice device, |
| 4105 | VkImageView* pView, |
| 4106 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4107 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4108 | |
| 4109 | if(pView == nullptr) |
| 4110 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4111 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4112 | "vkCreateImageView parameter, VkImageView* pView, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4113 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4114 | } |
| 4115 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 4116 | if(result != VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4117 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4118 | std::string reason = "vkCreateImageView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4119 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4120 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4121 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4122 | |
| 4123 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4124 | } |
| 4125 | |
| 4126 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImageView( |
| 4127 | VkDevice device, |
| 4128 | const VkImageViewCreateInfo* pCreateInfo, |
| 4129 | VkImageView* pView) |
| 4130 | { |
| 4131 | PreCreateImageView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4132 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4133 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pView); |
| 4134 | |
| 4135 | PostCreateImageView(device, pView, result); |
| 4136 | |
| 4137 | return result; |
| 4138 | } |
| 4139 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4140 | bool PostDestroyImageView( |
| 4141 | VkDevice device, |
| 4142 | VkImageView imageView, |
| 4143 | VkResult result) |
| 4144 | { |
| 4145 | |
| 4146 | |
| 4147 | if(result != VK_SUCCESS) |
| 4148 | { |
| 4149 | std::string reason = "vkDestroyImageView parameter, VkResult result, is " + EnumeratorString(result); |
| 4150 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4151 | return false; |
| 4152 | } |
| 4153 | |
| 4154 | return true; |
| 4155 | } |
| 4156 | |
| 4157 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyImageView( |
| 4158 | VkDevice device, |
| 4159 | VkImageView imageView) |
| 4160 | { |
| 4161 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyImageView(device, imageView); |
| 4162 | |
| 4163 | PostDestroyImageView(device, imageView, result); |
| 4164 | |
| 4165 | return result; |
| 4166 | } |
| 4167 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4168 | void PreCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4169 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4170 | const VkAttachmentViewCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4171 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4172 | if(pCreateInfo == nullptr) |
| 4173 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4174 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4175 | "vkCreateAttachmentView parameter, const VkAttachmentViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4176 | return; |
| 4177 | } |
| 4178 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4179 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4180 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4181 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4182 | "vkCreateAttachmentView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4183 | return; |
| 4184 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4185 | if(pCreateInfo->image.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4186 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4187 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4188 | "vkCreateAttachmentView parameter, VkImage pCreateInfo->image, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4189 | return; |
| 4190 | } |
| 4191 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4192 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4193 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4194 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4195 | "vkCreateAttachmentView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4196 | return; |
| 4197 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4198 | if(!ValidateEnumerator((VkAttachmentViewCreateFlagBits)pCreateInfo->flags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4199 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4200 | std::string reason = "vkCreateAttachmentView parameter, VkAttachmentViewCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkAttachmentViewCreateFlagBits)pCreateInfo->flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4201 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4202 | return; |
| 4203 | } |
| 4204 | } |
| 4205 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4206 | bool PostDestroyAttachmentView( |
| 4207 | VkDevice device, |
| 4208 | VkAttachmentView attachmentView, |
| 4209 | VkResult result) |
| 4210 | { |
| 4211 | |
| 4212 | |
| 4213 | if(result != VK_SUCCESS) |
| 4214 | { |
| 4215 | std::string reason = "vkDestroyAttachmentView parameter, VkResult result, is " + EnumeratorString(result); |
| 4216 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4217 | return false; |
| 4218 | } |
| 4219 | |
| 4220 | return true; |
| 4221 | } |
| 4222 | |
| 4223 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyAttachmentView( |
| 4224 | VkDevice device, |
| 4225 | VkAttachmentView attachmentView) |
| 4226 | { |
| 4227 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyAttachmentView(device, attachmentView); |
| 4228 | |
| 4229 | PostDestroyAttachmentView(device, attachmentView, result); |
| 4230 | |
| 4231 | return result; |
| 4232 | } |
| 4233 | |
| 4234 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4235 | void PostCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4236 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4237 | VkAttachmentView* pView, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4238 | VkResult result) |
| 4239 | { |
| 4240 | if(device == nullptr) |
| 4241 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4242 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4243 | "vkCreateAttachmentView parameter, VkDevice device, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4244 | return; |
| 4245 | } |
| 4246 | |
| 4247 | if(pView == nullptr) |
| 4248 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4249 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4250 | "vkCreateAttachmentView parameter, VkAttachmentView* pView, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4251 | return; |
| 4252 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4253 | if((*pView).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4254 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4255 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4256 | "vkCreateAttachmentView parameter, VkAttachmentView* pView, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4257 | return; |
| 4258 | } |
| 4259 | |
| 4260 | if(result != VK_SUCCESS) |
| 4261 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4262 | std::string reason = "vkCreateAttachmentView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4263 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4264 | return; |
| 4265 | } |
| 4266 | } |
| 4267 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4268 | VK_LAYER_EXPORT VkResult VKAPI vkCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4269 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4270 | const VkAttachmentViewCreateInfo* pCreateInfo, |
| 4271 | VkAttachmentView* pView) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4272 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4273 | PreCreateAttachmentView(device, pCreateInfo); |
| 4274 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateAttachmentView(device, pCreateInfo, pView); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4275 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4276 | PostCreateAttachmentView(device, pView, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4277 | |
| 4278 | return result; |
| 4279 | } |
| 4280 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4281 | bool PostDestroyShaderModule( |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4282 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4283 | VkShaderModule shaderModule, |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4284 | VkResult result) |
| 4285 | { |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4286 | |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4287 | |
| 4288 | if(result != VK_SUCCESS) |
| 4289 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4290 | std::string reason = "vkDestroyShaderModule parameter, VkResult result, is " + EnumeratorString(result); |
| 4291 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4292 | return false; |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4293 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4294 | |
| 4295 | return true; |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4296 | } |
| 4297 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4298 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyShaderModule( |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4299 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4300 | VkShaderModule shaderModule) |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4301 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4302 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyShaderModule(device, shaderModule); |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4303 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4304 | PostDestroyShaderModule(device, shaderModule, result); |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4305 | |
| 4306 | return result; |
| 4307 | } |
| 4308 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4309 | bool PreCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4310 | VkDevice device, |
| 4311 | const VkShaderCreateInfo* pCreateInfo) |
| 4312 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4313 | if(pCreateInfo == nullptr) |
| 4314 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4315 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4316 | "vkCreateShader parameter, const VkShaderCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4317 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4318 | } |
| 4319 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4320 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4321 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4322 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4323 | "vkCreateShader parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4324 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4325 | } |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4326 | if(pCreateInfo->pName == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4327 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4328 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4329 | "vkCreateShader parameter, const char* pCreateInfo->pName, is null pointer"); |
| 4330 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4331 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4332 | |
| 4333 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4334 | } |
| 4335 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4336 | bool PostCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4337 | VkDevice device, |
| 4338 | VkShader* pShader, |
| 4339 | VkResult result) |
| 4340 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4341 | |
| 4342 | if(pShader == nullptr) |
| 4343 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4344 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4345 | "vkCreateShader parameter, VkShader* pShader, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4346 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4347 | } |
| 4348 | |
| 4349 | if(result != VK_SUCCESS) |
| 4350 | { |
| 4351 | std::string reason = "vkCreateShader parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4352 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4353 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4354 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4355 | |
| 4356 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4357 | } |
| 4358 | |
| 4359 | VK_LAYER_EXPORT VkResult VKAPI vkCreateShader( |
| 4360 | VkDevice device, |
| 4361 | const VkShaderCreateInfo* pCreateInfo, |
| 4362 | VkShader* pShader) |
| 4363 | { |
| 4364 | PreCreateShader(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4365 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4366 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateShader(device, pCreateInfo, pShader); |
| 4367 | |
| 4368 | PostCreateShader(device, pShader, result); |
| 4369 | |
| 4370 | return result; |
| 4371 | } |
| 4372 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4373 | bool PostDestroyShader( |
| 4374 | VkDevice device, |
| 4375 | VkShader shader, |
| 4376 | VkResult result) |
| 4377 | { |
| 4378 | if(result != VK_SUCCESS) |
| 4379 | { |
| 4380 | std::string reason = "vkDestroyShader parameter, VkResult result, is " + EnumeratorString(result); |
| 4381 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4382 | return false; |
| 4383 | } |
| 4384 | |
| 4385 | return true; |
| 4386 | } |
| 4387 | |
| 4388 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyShader( |
| 4389 | VkDevice device, |
| 4390 | VkShader shader) |
| 4391 | { |
| 4392 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyShader(device, shader); |
| 4393 | |
| 4394 | PostDestroyShader(device, shader, result); |
| 4395 | |
| 4396 | return result; |
| 4397 | } |
| 4398 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 4399 | //TODO handle count > 1 |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4400 | bool PreCreateGraphicsPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4401 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 4402 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4403 | const VkGraphicsPipelineCreateInfo* pCreateInfo) |
| 4404 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4405 | if(pCreateInfo == nullptr) |
| 4406 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4407 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4408 | "vkCreateGraphicsPipeline parameter, const VkGraphicsPipelineCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4409 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4410 | } |
| 4411 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4412 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4413 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4414 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4415 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4416 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4417 | } |
| 4418 | if(pCreateInfo->pStages == nullptr) |
| 4419 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4420 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4421 | "vkCreateGraphicsPipeline parameter, const VkPipelineShaderStageCreateInfo* pCreateInfo->pStages, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4422 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4423 | } |
| 4424 | if(pCreateInfo->pStages->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4425 | pCreateInfo->pStages->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4426 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4427 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4428 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pStages->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4429 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4430 | } |
| 4431 | if(pCreateInfo->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4432 | pCreateInfo->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4433 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4434 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4435 | "vkCreateGraphicsPipeline parameter, VkShaderStage pCreateInfo->pStages->stage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4436 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4437 | } |
| 4438 | if(pCreateInfo->pStages->pSpecializationInfo == nullptr) |
| 4439 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4440 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4441 | "vkCreateGraphicsPipeline parameter, const VkSpecializationInfo* pCreateInfo->pStages->pSpecializationInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4442 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4443 | } |
| 4444 | if(pCreateInfo->pStages->pSpecializationInfo->pMap == nullptr) |
| 4445 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4446 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4447 | "vkCreateGraphicsPipeline parameter, const VkSpecializationMapEntry* pCreateInfo->pStages->pSpecializationInfo->pMap, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4448 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4449 | } |
| 4450 | if(pCreateInfo->pStages->pSpecializationInfo->pData == nullptr) |
| 4451 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4452 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4453 | "vkCreateGraphicsPipeline parameter, const void* pCreateInfo->pStages->pSpecializationInfo->pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4454 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4455 | } |
| 4456 | if(pCreateInfo->pVertexInputState == nullptr) |
| 4457 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4458 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4459 | "vkCreateGraphicsPipeline parameter, const VkPipelineVertexInputStateCreateInfo* pCreateInfo->pVertexInputState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4460 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4461 | } |
| 4462 | if(pCreateInfo->pVertexInputState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4463 | pCreateInfo->pVertexInputState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4464 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4465 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4466 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pVertexInputState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4467 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4468 | } |
| 4469 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions == nullptr) |
| 4470 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4471 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4472 | "vkCreateGraphicsPipeline parameter, const VkVertexInputBindingDescription* pCreateInfo->pVertexInputState->pVertexBindingDescriptions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4473 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4474 | } |
| 4475 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4476 | pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4477 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4478 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4479 | "vkCreateGraphicsPipeline parameter, VkVertexInputStepRate pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4480 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4481 | } |
| 4482 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions == nullptr) |
| 4483 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4484 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4485 | "vkCreateGraphicsPipeline parameter, const VkVertexInputAttributeDescription* pCreateInfo->pVertexInputState->pVertexAttributeDescriptions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4486 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4487 | } |
| 4488 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4489 | pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4490 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4491 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4492 | "vkCreateGraphicsPipeline parameter, VkFormat pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4493 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4494 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4495 | if(pCreateInfo->pInputAssemblyState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4496 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4497 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4498 | "vkCreateGraphicsPipeline parameter, const VkPipelineIaStateCreateInfo* pCreateInfo->pIaState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4499 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4500 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4501 | if(pCreateInfo->pInputAssemblyState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4502 | pCreateInfo->pInputAssemblyState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4503 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4504 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4505 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pIaState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4506 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4507 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4508 | if(pCreateInfo->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4509 | pCreateInfo->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4510 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4511 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4512 | "vkCreateGraphicsPipeline parameter, VkPrimitiveTopology pCreateInfo->pIaState->topology, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4513 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4514 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4515 | if(pCreateInfo->pTessellationState == nullptr) |
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 | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4518 | "vkCreateGraphicsPipeline parameter, const VkPipelineTessStateCreateInfo* pCreateInfo->pTessState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4519 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4520 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4521 | if(pCreateInfo->pTessellationState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4522 | pCreateInfo->pTessellationState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4523 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4524 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4525 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pTessState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4526 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4527 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4528 | if(pCreateInfo->pViewportState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4529 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4530 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4531 | "vkCreateGraphicsPipeline parameter, const VkPipelineVpStateCreateInfo* pCreateInfo->pVpState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4532 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4533 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4534 | if(pCreateInfo->pViewportState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4535 | pCreateInfo->pViewportState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4536 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4537 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4538 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pVpState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4539 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4540 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4541 | if(pCreateInfo->pRasterState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4542 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4543 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4544 | "vkCreateGraphicsPipeline parameter, const VkPipelineRsStateCreateInfo* pCreateInfo->pRsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4545 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4546 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4547 | if(pCreateInfo->pRasterState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4548 | pCreateInfo->pRasterState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4549 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4550 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4551 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pRsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4552 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4553 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4554 | if(pCreateInfo->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 4555 | pCreateInfo->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4556 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4557 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4558 | "vkCreateGraphicsPipeline parameter, VkFillMode pCreateInfo->pRsState->fillMode, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4559 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4560 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4561 | if(pCreateInfo->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 4562 | pCreateInfo->pRasterState->cullMode > VK_CULL_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4563 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4564 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4565 | "vkCreateGraphicsPipeline parameter, VkCullMode pCreateInfo->pRsState->cullMode, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4566 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4567 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4568 | if(pCreateInfo->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 4569 | pCreateInfo->pRasterState->frontFace > VK_FRONT_FACE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4570 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4571 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4572 | "vkCreateGraphicsPipeline parameter, VkFrontFace pCreateInfo->pRsState->frontFace, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4573 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4574 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4575 | if(pCreateInfo->pMultisampleState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4576 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4577 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4578 | "vkCreateGraphicsPipeline parameter, const VkPipelineMsStateCreateInfo* pCreateInfo->pMsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4579 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4580 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4581 | if(pCreateInfo->pMultisampleState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4582 | pCreateInfo->pMultisampleState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4583 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4584 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4585 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pMsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4586 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4587 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4588 | if(pCreateInfo->pDepthStencilState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4589 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4590 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4591 | "vkCreateGraphicsPipeline parameter, const VkPipelineDsStateCreateInfo* pCreateInfo->pDsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4592 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4593 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4594 | if(pCreateInfo->pDepthStencilState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4595 | pCreateInfo->pDepthStencilState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4596 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4597 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4598 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pDsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4599 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4600 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4601 | if(pCreateInfo->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4602 | pCreateInfo->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4603 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4604 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4605 | "vkCreateGraphicsPipeline parameter, VkCompareOp pCreateInfo->pDsState->depthCompareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4606 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4607 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4608 | if(pCreateInfo->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4609 | pCreateInfo->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4610 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4611 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4612 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4613 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4614 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4615 | if(pCreateInfo->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4616 | pCreateInfo->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4617 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4618 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4619 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilPassOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4620 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4621 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4622 | if(pCreateInfo->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4623 | pCreateInfo->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4624 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4625 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4626 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilDepthFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4627 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4628 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4629 | if(pCreateInfo->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4630 | pCreateInfo->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4631 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4632 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4633 | "vkCreateGraphicsPipeline parameter, VkCompareOp pCreateInfo->pDsState->front.stencilCompareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4634 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4635 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4636 | if(pCreateInfo->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4637 | pCreateInfo->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4638 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4639 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4640 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->back.stencilFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4641 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4642 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4643 | if(pCreateInfo->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4644 | pCreateInfo->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4645 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4646 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4647 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->back.stencilPassOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4648 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4649 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4650 | if(pCreateInfo->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4651 | pCreateInfo->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4652 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4653 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4654 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->back.stencilDepthFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4655 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4656 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4657 | if(pCreateInfo->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4658 | pCreateInfo->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4659 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4660 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4661 | "vkCreateGraphicsPipeline parameter, VkCompareOp pCreateInfo->pDsState->back.stencilCompareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4662 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4663 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4664 | if(pCreateInfo->pColorBlendState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4665 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4666 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4667 | "vkCreateGraphicsPipeline parameter, const VkPipelineCbStateCreateInfo* pCreateInfo->pCbState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4668 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4669 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4670 | if(pCreateInfo->pColorBlendState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4671 | pCreateInfo->pColorBlendState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4672 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4673 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4674 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pCbState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4675 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4676 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4677 | if(pCreateInfo->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 4678 | pCreateInfo->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4679 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4680 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4681 | "vkCreateGraphicsPipeline parameter, VkLogicOp pCreateInfo->pCbState->logicOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4682 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4683 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4684 | if(pCreateInfo->pColorBlendState->pAttachments == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4685 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4686 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4687 | "vkCreateGraphicsPipeline parameter, const VkPipelineCbAttachmentState* pCreateInfo->pCbState->pAttachments, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4688 | return false; |
| 4689 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4690 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4691 | pCreateInfo->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4692 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4693 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4694 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4695 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4696 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4697 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4698 | pCreateInfo->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4699 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4700 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4701 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4702 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4703 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4704 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 4705 | pCreateInfo->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4706 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4707 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4708 | "vkCreateGraphicsPipeline parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4709 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4710 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4711 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4712 | pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4713 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4714 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4715 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4716 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4717 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4718 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4719 | pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4720 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4721 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4722 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4723 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4724 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4725 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 4726 | pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4727 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4728 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4729 | "vkCreateGraphicsPipeline parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4730 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4731 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4732 | if(!ValidateEnumerator((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4733 | { |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4734 | std::string reason = "vkCreateGraphicsPipeline parameter, VkChannelFlags pCreateInfo->pCbState->pAttachments->channelWriteMask, is " + EnumeratorString((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask); |
| 4735 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4736 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4737 | } |
| 4738 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 4739 | { |
| 4740 | std::string reason = "vkCreateGraphicsPipeline parameter, VkPipelineCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkPipelineCreateFlagBits)pCreateInfo->flags); |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4741 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4742 | return false; |
| 4743 | } |
| 4744 | |
| 4745 | return true; |
| 4746 | } |
| 4747 | |
| 4748 | bool PostCreateGraphicsPipeline( |
| 4749 | VkDevice device, |
| 4750 | VkPipeline* pPipeline, |
| 4751 | VkResult result) |
| 4752 | { |
| 4753 | |
| 4754 | if(pPipeline == nullptr) |
| 4755 | { |
| 4756 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4757 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 4758 | return false; |
| 4759 | } |
| 4760 | |
| 4761 | if(result != VK_SUCCESS) |
| 4762 | { |
| 4763 | std::string reason = "vkCreateGraphicsPipeline parameter, VkResult result, is " + EnumeratorString(result); |
| 4764 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4765 | return false; |
| 4766 | } |
| 4767 | |
| 4768 | return true; |
| 4769 | } |
| 4770 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4771 | bool PostDestroyPipeline( |
| 4772 | VkDevice device, |
| 4773 | VkPipeline pipeline, |
| 4774 | VkResult result) |
| 4775 | { |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4776 | if(result != VK_SUCCESS) |
| 4777 | { |
| 4778 | std::string reason = "vkDestroyPipeline parameter, VkResult result, is " + EnumeratorString(result); |
| 4779 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4780 | return false; |
| 4781 | } |
| 4782 | |
| 4783 | return true; |
| 4784 | } |
| 4785 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4786 | bool PreCreateGraphicsPipelineDerivative( |
| 4787 | VkDevice device, |
| 4788 | const VkGraphicsPipelineCreateInfo* pCreateInfo) |
| 4789 | { |
| 4790 | if(pCreateInfo == nullptr) |
| 4791 | { |
| 4792 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4793 | "vkCreateGraphicsPipelineDerivative parameter, const VkGraphicsPipelineCreateInfo* pCreateInfo, is null pointer"); |
| 4794 | return false; |
| 4795 | } |
| 4796 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4797 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4798 | { |
| 4799 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4800 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 4801 | return false; |
| 4802 | } |
| 4803 | if(pCreateInfo->pStages == nullptr) |
| 4804 | { |
| 4805 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4806 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineShaderStageCreateInfo* pCreateInfo->pStages, is null pointer"); |
| 4807 | return false; |
| 4808 | } |
| 4809 | if(pCreateInfo->pStages->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4810 | pCreateInfo->pStages->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4811 | { |
| 4812 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4813 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pStages->sType, is unrecognized enumerator"); |
| 4814 | return false; |
| 4815 | } |
| 4816 | if(pCreateInfo->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4817 | pCreateInfo->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4818 | { |
| 4819 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4820 | "vkCreateGraphicsPipelineDerivative parameter, VkShaderStage pCreateInfo->pStages->stage, is unrecognized enumerator"); |
| 4821 | return false; |
| 4822 | } |
| 4823 | if(pCreateInfo->pStages->pSpecializationInfo == nullptr) |
| 4824 | { |
| 4825 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4826 | "vkCreateGraphicsPipelineDerivative parameter, const VkSpecializationInfo* pCreateInfo->pStages->pSpecializationInfo, is null pointer"); |
| 4827 | return false; |
| 4828 | } |
| 4829 | if(pCreateInfo->pStages->pSpecializationInfo->pMap == nullptr) |
| 4830 | { |
| 4831 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4832 | "vkCreateGraphicsPipelineDerivative parameter, const VkSpecializationMapEntry* pCreateInfo->pStages->pSpecializationInfo->pMap, is null pointer"); |
| 4833 | return false; |
| 4834 | } |
| 4835 | if(pCreateInfo->pStages->pSpecializationInfo->pData == nullptr) |
| 4836 | { |
| 4837 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4838 | "vkCreateGraphicsPipelineDerivative parameter, const void* pCreateInfo->pStages->pSpecializationInfo->pData, is null pointer"); |
| 4839 | return false; |
| 4840 | } |
| 4841 | if(pCreateInfo->pVertexInputState == nullptr) |
| 4842 | { |
| 4843 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4844 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineVertexInputStateCreateInfo* pCreateInfo->pVertexInputState, is null pointer"); |
| 4845 | return false; |
| 4846 | } |
| 4847 | if(pCreateInfo->pVertexInputState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4848 | pCreateInfo->pVertexInputState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4849 | { |
| 4850 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4851 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pVertexInputState->sType, is unrecognized enumerator"); |
| 4852 | return false; |
| 4853 | } |
| 4854 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions == nullptr) |
| 4855 | { |
| 4856 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4857 | "vkCreateGraphicsPipelineDerivative parameter, const VkVertexInputBindingDescription* pCreateInfo->pVertexInputState->pVertexBindingDescriptions, is null pointer"); |
| 4858 | return false; |
| 4859 | } |
| 4860 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4861 | pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4862 | { |
| 4863 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4864 | "vkCreateGraphicsPipelineDerivative parameter, VkVertexInputStepRate pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate, is unrecognized enumerator"); |
| 4865 | return false; |
| 4866 | } |
| 4867 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions == nullptr) |
| 4868 | { |
| 4869 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4870 | "vkCreateGraphicsPipelineDerivative parameter, const VkVertexInputAttributeDescription* pCreateInfo->pVertexInputState->pVertexAttributeDescriptions, is null pointer"); |
| 4871 | return false; |
| 4872 | } |
| 4873 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4874 | pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4875 | { |
| 4876 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4877 | "vkCreateGraphicsPipelineDerivative parameter, VkFormat pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format, is unrecognized enumerator"); |
| 4878 | return false; |
| 4879 | } |
| 4880 | if(pCreateInfo->pInputAssemblyState == nullptr) |
| 4881 | { |
| 4882 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4883 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineIaStateCreateInfo* pCreateInfo->pIaState, is null pointer"); |
| 4884 | return false; |
| 4885 | } |
| 4886 | if(pCreateInfo->pInputAssemblyState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4887 | pCreateInfo->pInputAssemblyState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4888 | { |
| 4889 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4890 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pIaState->sType, is unrecognized enumerator"); |
| 4891 | return false; |
| 4892 | } |
| 4893 | if(pCreateInfo->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4894 | pCreateInfo->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
| 4895 | { |
| 4896 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4897 | "vkCreateGraphicsPipelineDerivative parameter, VkPrimitiveTopology pCreateInfo->pIaState->topology, is unrecognized enumerator"); |
| 4898 | return false; |
| 4899 | } |
| 4900 | if(pCreateInfo->pTessellationState == nullptr) |
| 4901 | { |
| 4902 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4903 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineTessStateCreateInfo* pCreateInfo->pTessState, is null pointer"); |
| 4904 | return false; |
| 4905 | } |
| 4906 | if(pCreateInfo->pTessellationState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4907 | pCreateInfo->pTessellationState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4908 | { |
| 4909 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4910 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pTessState->sType, is unrecognized enumerator"); |
| 4911 | return false; |
| 4912 | } |
| 4913 | if(pCreateInfo->pViewportState == nullptr) |
| 4914 | { |
| 4915 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4916 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineVpStateCreateInfo* pCreateInfo->pVpState, is null pointer"); |
| 4917 | return false; |
| 4918 | } |
| 4919 | if(pCreateInfo->pViewportState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4920 | pCreateInfo->pViewportState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4921 | { |
| 4922 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4923 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pVpState->sType, is unrecognized enumerator"); |
| 4924 | return false; |
| 4925 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4926 | if(pCreateInfo->pRasterState == nullptr) |
| 4927 | { |
| 4928 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4929 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineRsStateCreateInfo* pCreateInfo->pRsState, is null pointer"); |
| 4930 | return false; |
| 4931 | } |
| 4932 | if(pCreateInfo->pRasterState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4933 | pCreateInfo->pRasterState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4934 | { |
| 4935 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4936 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pRsState->sType, is unrecognized enumerator"); |
| 4937 | return false; |
| 4938 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4939 | if(pCreateInfo->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 4940 | pCreateInfo->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
| 4941 | { |
| 4942 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4943 | "vkCreateGraphicsPipelineDerivative parameter, VkFillMode pCreateInfo->pRsState->fillMode, is unrecognized enumerator"); |
| 4944 | return false; |
| 4945 | } |
| 4946 | if(pCreateInfo->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 4947 | pCreateInfo->pRasterState->cullMode > VK_CULL_MODE_END_RANGE) |
| 4948 | { |
| 4949 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4950 | "vkCreateGraphicsPipelineDerivative parameter, VkCullMode pCreateInfo->pRsState->cullMode, is unrecognized enumerator"); |
| 4951 | return false; |
| 4952 | } |
| 4953 | if(pCreateInfo->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 4954 | pCreateInfo->pRasterState->frontFace > VK_FRONT_FACE_END_RANGE) |
| 4955 | { |
| 4956 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4957 | "vkCreateGraphicsPipelineDerivative parameter, VkFrontFace pCreateInfo->pRsState->frontFace, is unrecognized enumerator"); |
| 4958 | return false; |
| 4959 | } |
| 4960 | if(pCreateInfo->pMultisampleState == nullptr) |
| 4961 | { |
| 4962 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4963 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineMsStateCreateInfo* pCreateInfo->pMsState, is null pointer"); |
| 4964 | return false; |
| 4965 | } |
| 4966 | if(pCreateInfo->pMultisampleState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4967 | pCreateInfo->pMultisampleState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4968 | { |
| 4969 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4970 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pMsState->sType, is unrecognized enumerator"); |
| 4971 | return false; |
| 4972 | } |
| 4973 | if(pCreateInfo->pDepthStencilState == nullptr) |
| 4974 | { |
| 4975 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4976 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineDsStateCreateInfo* pCreateInfo->pDsState, is null pointer"); |
| 4977 | return false; |
| 4978 | } |
| 4979 | if(pCreateInfo->pDepthStencilState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4980 | pCreateInfo->pDepthStencilState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4981 | { |
| 4982 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4983 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pDsState->sType, is unrecognized enumerator"); |
| 4984 | return false; |
| 4985 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4986 | if(pCreateInfo->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4987 | pCreateInfo->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4988 | { |
| 4989 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4990 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->depthCompareOp, is unrecognized enumerator"); |
| 4991 | return false; |
| 4992 | } |
| 4993 | if(pCreateInfo->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4994 | pCreateInfo->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 4995 | { |
| 4996 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4997 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilFailOp, is unrecognized enumerator"); |
| 4998 | return false; |
| 4999 | } |
| 5000 | if(pCreateInfo->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5001 | pCreateInfo->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 5002 | { |
| 5003 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5004 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilPassOp, is unrecognized enumerator"); |
| 5005 | return false; |
| 5006 | } |
| 5007 | if(pCreateInfo->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5008 | pCreateInfo->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 5009 | { |
| 5010 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5011 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilDepthFailOp, is unrecognized enumerator"); |
| 5012 | return false; |
| 5013 | } |
| 5014 | if(pCreateInfo->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5015 | pCreateInfo->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 5016 | { |
| 5017 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5018 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->front.stencilCompareOp, is unrecognized enumerator"); |
| 5019 | return false; |
| 5020 | } |
| 5021 | if(pCreateInfo->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5022 | pCreateInfo->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 5023 | { |
| 5024 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5025 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilFailOp, is unrecognized enumerator"); |
| 5026 | return false; |
| 5027 | } |
| 5028 | if(pCreateInfo->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5029 | pCreateInfo->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 5030 | { |
| 5031 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5032 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilPassOp, is unrecognized enumerator"); |
| 5033 | return false; |
| 5034 | } |
| 5035 | if(pCreateInfo->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5036 | pCreateInfo->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 5037 | { |
| 5038 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5039 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilDepthFailOp, is unrecognized enumerator"); |
| 5040 | return false; |
| 5041 | } |
| 5042 | if(pCreateInfo->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5043 | pCreateInfo->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 5044 | { |
| 5045 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5046 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->back.stencilCompareOp, is unrecognized enumerator"); |
| 5047 | return false; |
| 5048 | } |
| 5049 | if(pCreateInfo->pColorBlendState == nullptr) |
| 5050 | { |
| 5051 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5052 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineCbStateCreateInfo* pCreateInfo->pCbState, is null pointer"); |
| 5053 | return false; |
| 5054 | } |
| 5055 | if(pCreateInfo->pColorBlendState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5056 | pCreateInfo->pColorBlendState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5057 | { |
| 5058 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5059 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pCbState->sType, is unrecognized enumerator"); |
| 5060 | return false; |
| 5061 | } |
| 5062 | if(pCreateInfo->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 5063 | pCreateInfo->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
| 5064 | { |
| 5065 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5066 | "vkCreateGraphicsPipelineDerivative parameter, VkLogicOp pCreateInfo->pCbState->logicOp, is unrecognized enumerator"); |
| 5067 | return false; |
| 5068 | } |
| 5069 | if(pCreateInfo->pColorBlendState->pAttachments == nullptr) |
| 5070 | { |
| 5071 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5072 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineCbAttachmentState* pCreateInfo->pCbState->pAttachments, is null pointer"); |
| 5073 | return false; |
| 5074 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 5075 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 5076 | pCreateInfo->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
| 5077 | { |
| 5078 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5079 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendColor, is unrecognized enumerator"); |
| 5080 | return false; |
| 5081 | } |
| 5082 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 5083 | pCreateInfo->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
| 5084 | { |
| 5085 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5086 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendColor, is unrecognized enumerator"); |
| 5087 | return false; |
| 5088 | } |
| 5089 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 5090 | pCreateInfo->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
| 5091 | { |
| 5092 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5093 | "vkCreateGraphicsPipelineDerivative parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpColor, is unrecognized enumerator"); |
| 5094 | return false; |
| 5095 | } |
| 5096 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 5097 | pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
| 5098 | { |
| 5099 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5100 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendAlpha, is unrecognized enumerator"); |
| 5101 | return false; |
| 5102 | } |
| 5103 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 5104 | pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
| 5105 | { |
| 5106 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5107 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendAlpha, is unrecognized enumerator"); |
| 5108 | return false; |
| 5109 | } |
| 5110 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 5111 | pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
| 5112 | { |
| 5113 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5114 | "vkCreateGraphicsPipelineDerivative parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpAlpha, is unrecognized enumerator"); |
| 5115 | return false; |
| 5116 | } |
| 5117 | if(!ValidateEnumerator((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask)) |
| 5118 | { |
| 5119 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkChannelFlags pCreateInfo->pCbState->pAttachments->channelWriteMask, is " + EnumeratorString((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask); |
| 5120 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5121 | return false; |
| 5122 | } |
| 5123 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5124 | { |
| 5125 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkPipelineCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkPipelineCreateFlagBits)pCreateInfo->flags); |
| 5126 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5127 | return false; |
| 5128 | } |
| 5129 | |
| 5130 | return true; |
| 5131 | } |
| 5132 | |
| 5133 | bool PostCreateGraphicsPipelineDerivative( |
| 5134 | VkDevice device, |
| 5135 | VkPipeline basePipeline, |
| 5136 | VkPipeline* pPipeline, |
| 5137 | VkResult result) |
| 5138 | { |
| 5139 | |
| 5140 | |
| 5141 | if(pPipeline == nullptr) |
| 5142 | { |
| 5143 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5144 | "vkCreateGraphicsPipelineDerivative parameter, VkPipeline* pPipeline, is null pointer"); |
| 5145 | return false; |
| 5146 | } |
| 5147 | |
| 5148 | if(result != VK_SUCCESS) |
| 5149 | { |
| 5150 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkResult result, is " + EnumeratorString(result); |
| 5151 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5152 | return false; |
| 5153 | } |
| 5154 | |
| 5155 | return true; |
| 5156 | } |
| 5157 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 5158 | bool PreCreateComputePipeline( |
| 5159 | VkDevice device, |
| 5160 | const VkComputePipelineCreateInfo* pCreateInfo) |
| 5161 | { |
| 5162 | if(pCreateInfo == nullptr) |
| 5163 | { |
| 5164 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5165 | "vkCreateComputePipeline parameter, const VkComputePipelineCreateInfo* pCreateInfo, is null pointer"); |
| 5166 | return false; |
| 5167 | } |
| 5168 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5169 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5170 | { |
| 5171 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5172 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5173 | return false; |
| 5174 | } |
| 5175 | if(pCreateInfo->cs.sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5176 | pCreateInfo->cs.sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5177 | { |
| 5178 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5179 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->cs.sType, is unrecognized enumerator"); |
| 5180 | return false; |
| 5181 | } |
| 5182 | if(pCreateInfo->cs.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 5183 | pCreateInfo->cs.stage > VK_SHADER_STAGE_END_RANGE) |
| 5184 | { |
| 5185 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5186 | "vkCreateComputePipeline parameter, VkShaderStage pCreateInfo->cs.stage, is unrecognized enumerator"); |
| 5187 | return false; |
| 5188 | } |
| 5189 | if(pCreateInfo->cs.pSpecializationInfo == nullptr) |
| 5190 | { |
| 5191 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5192 | "vkCreateComputePipeline parameter, const VkSpecializationInfo* pCreateInfo->cs.pSpecializationInfo, is null pointer"); |
| 5193 | return false; |
| 5194 | } |
| 5195 | if(pCreateInfo->cs.pSpecializationInfo->pMap == nullptr) |
| 5196 | { |
| 5197 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5198 | "vkCreateComputePipeline parameter, const VkSpecializationMapEntry* pCreateInfo->cs.pSpecializationInfo->pMap, is null pointer"); |
| 5199 | return false; |
| 5200 | } |
| 5201 | if(pCreateInfo->cs.pSpecializationInfo->pData == nullptr) |
| 5202 | { |
| 5203 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5204 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pSpecializationInfo->pData, is null pointer"); |
| 5205 | return false; |
| 5206 | } |
| 5207 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5208 | { |
| 5209 | std::string reason = "vkCreateComputePipeline parameter, VkPipelineCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkPipelineCreateFlagBits)pCreateInfo->flags); |
| 5210 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5211 | return false; |
| 5212 | } |
| 5213 | |
| 5214 | return true; |
| 5215 | } |
| 5216 | |
| 5217 | bool PostCreateComputePipeline( |
| 5218 | VkDevice device, |
| 5219 | VkPipeline* pPipeline, |
| 5220 | VkResult result) |
| 5221 | { |
| 5222 | |
| 5223 | if(pPipeline == nullptr) |
| 5224 | { |
| 5225 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5226 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5227 | return false; |
| 5228 | } |
| 5229 | |
| 5230 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5231 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5232 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5233 | "vkCreateGraphicsPipeline parameter, VkPipelineLayout pCreateInfo->layout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5234 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5235 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5236 | |
| 5237 | return true; |
| 5238 | } |
| 5239 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5240 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipeline( |
| 5241 | VkDevice device, |
| 5242 | VkPipeline pipeline) |
| 5243 | { |
| 5244 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipeline(device, pipeline); |
| 5245 | |
| 5246 | PostDestroyPipeline(device, pipeline, result); |
| 5247 | |
| 5248 | return result; |
| 5249 | } |
| 5250 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5251 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5252 | void PostCreateGraphicsPipeline( |
| 5253 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5254 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5255 | VkPipeline* pPipeline, |
| 5256 | VkResult result) |
| 5257 | { |
| 5258 | if(device == nullptr) |
| 5259 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5260 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5261 | "vkCreateGraphicsPipeline parameter, VkDevice device, is null pointer"); |
| 5262 | return; |
| 5263 | } |
| 5264 | |
| 5265 | if(pPipeline == nullptr) |
| 5266 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5267 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5268 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5269 | return; |
| 5270 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5271 | if((*pPipeline).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5272 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5273 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5274 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5275 | return; |
| 5276 | } |
| 5277 | |
| 5278 | if(result != VK_SUCCESS) |
| 5279 | { |
| 5280 | std::string reason = "vkCreateGraphicsPipeline parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5281 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5282 | return; |
| 5283 | } |
| 5284 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5285 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5286 | //TODO add intercept of pipelineCache entrypoints |
| 5287 | VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5288 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5289 | VkPipelineCache pipelineCache, |
| 5290 | uint32_t count, |
| 5291 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 5292 | VkPipeline* pPipelines) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5293 | { |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5294 | PreCreateGraphicsPipeline(device, count, pCreateInfos); |
| 5295 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5296 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5297 | PostCreateGraphicsPipeline(device, count, pPipelines, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5298 | |
| 5299 | return result; |
| 5300 | } |
| 5301 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5302 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5303 | void PreCreateComputePipeline( |
| 5304 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5305 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5306 | const VkComputePipelineCreateInfo* pCreateInfo) |
| 5307 | { |
| 5308 | if(device == nullptr) |
| 5309 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5310 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5311 | "vkCreateComputePipeline parameter, VkDevice device, is null pointer"); |
| 5312 | return; |
| 5313 | } |
| 5314 | |
| 5315 | if(pCreateInfo == nullptr) |
| 5316 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5317 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5318 | "vkCreateComputePipeline parameter, const VkComputePipelineCreateInfo* pCreateInfo, is null pointer"); |
| 5319 | return; |
| 5320 | } |
| 5321 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5322 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5323 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5324 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5325 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5326 | return; |
| 5327 | } |
| 5328 | if(pCreateInfo->cs.sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5329 | pCreateInfo->cs.sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5330 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5331 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5332 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->cs.sType, is unrecognized enumerator"); |
| 5333 | return; |
| 5334 | } |
| 5335 | if(pCreateInfo->cs.pNext == nullptr) |
| 5336 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5337 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5338 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pNext, is null pointer"); |
| 5339 | return; |
| 5340 | } |
| 5341 | if(pCreateInfo->cs.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 5342 | pCreateInfo->cs.stage > VK_SHADER_STAGE_END_RANGE) |
| 5343 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5344 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5345 | "vkCreateComputePipeline parameter, VkShaderStage pCreateInfo->cs.stage, is unrecognized enumerator"); |
| 5346 | return; |
| 5347 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5348 | if(pCreateInfo->cs.shader.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5349 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5350 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5351 | "vkCreateComputePipeline parameter, VkShader pCreateInfo->cs.shader, is null pointer"); |
| 5352 | return; |
| 5353 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5354 | if(pCreateInfo->cs.pSpecializationInfo == nullptr) |
| 5355 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5356 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5357 | "vkCreateComputePipeline parameter, const VkSpecializationInfo* pCreateInfo->cs.pSpecializationInfo, is null pointer"); |
| 5358 | return; |
| 5359 | } |
| 5360 | if(pCreateInfo->cs.pSpecializationInfo->pMap == nullptr) |
| 5361 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5362 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5363 | "vkCreateComputePipeline parameter, const VkSpecializationMapEntry* pCreateInfo->cs.pSpecializationInfo->pMap, is null pointer"); |
| 5364 | return; |
| 5365 | } |
| 5366 | if(pCreateInfo->cs.pSpecializationInfo->pData == nullptr) |
| 5367 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5368 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5369 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pSpecializationInfo->pData, is null pointer"); |
| 5370 | return; |
| 5371 | } |
| 5372 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5373 | { |
| 5374 | std::string reason = "vkCreateComputePipeline parameter, VkPipelineCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkPipelineCreateFlagBits)pCreateInfo->flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5375 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5376 | return; |
| 5377 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5378 | if(pCreateInfo->layout.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5379 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5380 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5381 | "vkCreateComputePipeline parameter, VkPipelineLayout pCreateInfo->layout, is null pointer"); |
| 5382 | return; |
| 5383 | } |
| 5384 | } |
| 5385 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5386 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5387 | void PostCreateComputePipeline( |
| 5388 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5389 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5390 | VkPipeline* pPipeline, |
| 5391 | VkResult result) |
| 5392 | { |
| 5393 | if(device == nullptr) |
| 5394 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5395 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5396 | "vkCreateComputePipeline parameter, VkDevice device, is null pointer"); |
| 5397 | return; |
| 5398 | } |
| 5399 | |
| 5400 | if(pPipeline == nullptr) |
| 5401 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5402 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5403 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5404 | return; |
| 5405 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5406 | if((*pPipeline).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5407 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5408 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5409 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5410 | return; |
| 5411 | } |
| 5412 | |
| 5413 | if(result != VK_SUCCESS) |
| 5414 | { |
| 5415 | std::string reason = "vkCreateComputePipeline parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5416 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5417 | return; |
| 5418 | } |
| 5419 | } |
| 5420 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5421 | VK_LAYER_EXPORT VkResult VKAPI vkCreateComputePipelines( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5422 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5423 | VkPipelineCache pipelineCache, |
| 5424 | uint32_t count, |
| 5425 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 5426 | VkPipeline* pPipelines) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5427 | { |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5428 | PreCreateComputePipeline(device, count, pCreateInfos); |
| 5429 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5430 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5431 | PostCreateComputePipeline(device, count, pPipelines, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5432 | |
| 5433 | return result; |
| 5434 | } |
| 5435 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5436 | void PreCreatePipelineLayout( |
| 5437 | VkDevice device, |
| 5438 | const VkPipelineLayoutCreateInfo* pCreateInfo) |
| 5439 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5440 | if(pCreateInfo == nullptr) |
| 5441 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5442 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5443 | "vkCreatePipelineLayout parameter, const VkPipelineLayoutCreateInfo* pCreateInfo, is null pointer"); |
| 5444 | return; |
| 5445 | } |
| 5446 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5447 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5448 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5449 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5450 | "vkCreatePipelineLayout parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5451 | return; |
| 5452 | } |
| 5453 | if(pCreateInfo->pSetLayouts == nullptr) |
| 5454 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5455 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5456 | "vkCreatePipelineLayout parameter, const VkDescriptorSetLayout* pCreateInfo->pSetLayouts, is null pointer"); |
| 5457 | return; |
| 5458 | } |
| 5459 | } |
| 5460 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5461 | bool PostCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5462 | VkDevice device, |
| 5463 | VkPipelineLayout* pPipelineLayout, |
| 5464 | VkResult result) |
| 5465 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5466 | |
| 5467 | if(pPipelineLayout == nullptr) |
| 5468 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5469 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5470 | "vkCreatePipelineLayout parameter, VkPipelineLayout* pPipelineLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5471 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5472 | } |
| 5473 | |
| 5474 | if(result != VK_SUCCESS) |
| 5475 | { |
| 5476 | std::string reason = "vkCreatePipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5477 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5478 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5479 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5480 | |
| 5481 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5482 | } |
| 5483 | |
| 5484 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineLayout( |
| 5485 | VkDevice device, |
| 5486 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 5487 | VkPipelineLayout* pPipelineLayout) |
| 5488 | { |
| 5489 | PreCreatePipelineLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5490 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5491 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); |
| 5492 | |
| 5493 | PostCreatePipelineLayout(device, pPipelineLayout, result); |
| 5494 | |
| 5495 | return result; |
| 5496 | } |
| 5497 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5498 | bool PostDestroyPipelineLayout( |
| 5499 | VkDevice device, |
| 5500 | VkPipelineLayout pipelineLayout, |
| 5501 | VkResult result) |
| 5502 | { |
| 5503 | |
| 5504 | |
| 5505 | if(result != VK_SUCCESS) |
| 5506 | { |
| 5507 | std::string reason = "vkDestroyPipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
| 5508 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5509 | return false; |
| 5510 | } |
| 5511 | |
| 5512 | return true; |
| 5513 | } |
| 5514 | |
| 5515 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipelineLayout( |
| 5516 | VkDevice device, |
| 5517 | VkPipelineLayout pipelineLayout) |
| 5518 | { |
| 5519 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipelineLayout(device, pipelineLayout); |
| 5520 | |
| 5521 | PostDestroyPipelineLayout(device, pipelineLayout, result); |
| 5522 | |
| 5523 | return result; |
| 5524 | } |
| 5525 | |
| 5526 | bool PreCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5527 | VkDevice device, |
| 5528 | const VkSamplerCreateInfo* pCreateInfo) |
| 5529 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5530 | if(pCreateInfo == nullptr) |
| 5531 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5532 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5533 | "vkCreateSampler parameter, const VkSamplerCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5534 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5535 | } |
| 5536 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5537 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5538 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5539 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5540 | "vkCreateSampler parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5541 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5542 | } |
| 5543 | if(pCreateInfo->magFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5544 | pCreateInfo->magFilter > VK_TEX_FILTER_END_RANGE) |
| 5545 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5546 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5547 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->magFilter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5548 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5549 | } |
| 5550 | if(pCreateInfo->minFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5551 | pCreateInfo->minFilter > VK_TEX_FILTER_END_RANGE) |
| 5552 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5553 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5554 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->minFilter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5555 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5556 | } |
| 5557 | if(pCreateInfo->mipMode < VK_TEX_MIPMAP_MODE_BEGIN_RANGE || |
| 5558 | pCreateInfo->mipMode > VK_TEX_MIPMAP_MODE_END_RANGE) |
| 5559 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5560 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5561 | "vkCreateSampler parameter, VkTexMipmapMode pCreateInfo->mipMode, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5562 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5563 | } |
| 5564 | if(pCreateInfo->addressU < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5565 | pCreateInfo->addressU > VK_TEX_ADDRESS_END_RANGE) |
| 5566 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5567 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5568 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressU, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5569 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5570 | } |
| 5571 | if(pCreateInfo->addressV < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5572 | pCreateInfo->addressV > VK_TEX_ADDRESS_END_RANGE) |
| 5573 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5574 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5575 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressV, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5576 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5577 | } |
| 5578 | if(pCreateInfo->addressW < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5579 | pCreateInfo->addressW > VK_TEX_ADDRESS_END_RANGE) |
| 5580 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5581 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5582 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressW, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5583 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5584 | } |
| 5585 | if(pCreateInfo->compareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5586 | pCreateInfo->compareOp > VK_COMPARE_OP_END_RANGE) |
| 5587 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5588 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5589 | "vkCreateSampler parameter, VkCompareOp pCreateInfo->compareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5590 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5591 | } |
| 5592 | if(pCreateInfo->borderColor < VK_BORDER_COLOR_BEGIN_RANGE || |
| 5593 | pCreateInfo->borderColor > VK_BORDER_COLOR_END_RANGE) |
| 5594 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5595 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5596 | "vkCreateSampler parameter, VkBorderColor pCreateInfo->borderColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5597 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5598 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5599 | |
| 5600 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5601 | } |
| 5602 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5603 | bool PostCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5604 | VkDevice device, |
| 5605 | VkSampler* pSampler, |
| 5606 | VkResult result) |
| 5607 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5608 | |
| 5609 | if(pSampler == nullptr) |
| 5610 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5611 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5612 | "vkCreateSampler parameter, VkSampler* pSampler, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5613 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5614 | } |
| 5615 | |
| 5616 | if(result != VK_SUCCESS) |
| 5617 | { |
| 5618 | std::string reason = "vkCreateSampler parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5619 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5620 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5621 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5622 | |
| 5623 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5624 | } |
| 5625 | |
| 5626 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSampler( |
| 5627 | VkDevice device, |
| 5628 | const VkSamplerCreateInfo* pCreateInfo, |
| 5629 | VkSampler* pSampler) |
| 5630 | { |
| 5631 | PreCreateSampler(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5632 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5633 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pSampler); |
| 5634 | |
| 5635 | PostCreateSampler(device, pSampler, result); |
| 5636 | |
| 5637 | return result; |
| 5638 | } |
| 5639 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5640 | bool PostDestroySampler( |
| 5641 | VkDevice device, |
| 5642 | VkSampler sampler, |
| 5643 | VkResult result) |
| 5644 | { |
| 5645 | |
| 5646 | |
| 5647 | if(result != VK_SUCCESS) |
| 5648 | { |
| 5649 | std::string reason = "vkDestroySampler parameter, VkResult result, is " + EnumeratorString(result); |
| 5650 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5651 | return false; |
| 5652 | } |
| 5653 | |
| 5654 | return true; |
| 5655 | } |
| 5656 | |
| 5657 | VK_LAYER_EXPORT VkResult VKAPI vkDestroySampler( |
| 5658 | VkDevice device, |
| 5659 | VkSampler sampler) |
| 5660 | { |
| 5661 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroySampler(device, sampler); |
| 5662 | |
| 5663 | PostDestroySampler(device, sampler, result); |
| 5664 | |
| 5665 | return result; |
| 5666 | } |
| 5667 | |
| 5668 | bool PreCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5669 | VkDevice device, |
| 5670 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo) |
| 5671 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5672 | if(pCreateInfo == nullptr) |
| 5673 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5674 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5675 | "vkCreateDescriptorSetLayout parameter, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5676 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5677 | } |
| 5678 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5679 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5680 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5681 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5682 | "vkCreateDescriptorSetLayout parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5683 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5684 | } |
| 5685 | if(pCreateInfo->pBinding == nullptr) |
| 5686 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5687 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5688 | "vkCreateDescriptorSetLayout parameter, const VkDescriptorSetLayoutBinding* pCreateInfo->pBinding, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5689 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5690 | } |
| 5691 | if(pCreateInfo->pBinding->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5692 | pCreateInfo->pBinding->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5693 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5694 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5695 | "vkCreateDescriptorSetLayout parameter, VkDescriptorType pCreateInfo->pBinding->descriptorType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5696 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5697 | } |
| 5698 | if(!ValidateEnumerator((VkShaderStageFlagBits)pCreateInfo->pBinding->stageFlags)) |
| 5699 | { |
| 5700 | std::string reason = "vkCreateDescriptorSetLayout parameter, VkShaderStageFlags pCreateInfo->pBinding->stageFlags, is " + EnumeratorString((VkShaderStageFlagBits)pCreateInfo->pBinding->stageFlags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5701 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5702 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5703 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5704 | |
| 5705 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5706 | } |
| 5707 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5708 | bool PostCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5709 | VkDevice device, |
| 5710 | VkDescriptorSetLayout* pSetLayout, |
| 5711 | VkResult result) |
| 5712 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5713 | |
| 5714 | if(pSetLayout == nullptr) |
| 5715 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5716 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5717 | "vkCreateDescriptorSetLayout parameter, VkDescriptorSetLayout* pSetLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5718 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5719 | } |
| 5720 | |
| 5721 | if(result != VK_SUCCESS) |
| 5722 | { |
| 5723 | std::string reason = "vkCreateDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5724 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5725 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5726 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5727 | |
| 5728 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5729 | } |
| 5730 | |
| 5731 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout( |
| 5732 | VkDevice device, |
| 5733 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5734 | VkDescriptorSetLayout* pSetLayout) |
| 5735 | { |
| 5736 | PreCreateDescriptorSetLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5737 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5738 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout); |
| 5739 | |
| 5740 | PostCreateDescriptorSetLayout(device, pSetLayout, result); |
| 5741 | |
| 5742 | return result; |
| 5743 | } |
| 5744 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5745 | bool PostDestroyDescriptorSetLayout( |
| 5746 | VkDevice device, |
| 5747 | VkDescriptorSetLayout descriptorSetLayout, |
| 5748 | VkResult result) |
| 5749 | { |
| 5750 | |
| 5751 | |
| 5752 | if(result != VK_SUCCESS) |
| 5753 | { |
| 5754 | std::string reason = "vkDestroyDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
| 5755 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5756 | return false; |
| 5757 | } |
| 5758 | |
| 5759 | return true; |
| 5760 | } |
| 5761 | |
| 5762 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDescriptorSetLayout( |
| 5763 | VkDevice device, |
| 5764 | VkDescriptorSetLayout descriptorSetLayout) |
| 5765 | { |
| 5766 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorSetLayout(device, descriptorSetLayout); |
| 5767 | |
| 5768 | PostDestroyDescriptorSetLayout(device, descriptorSetLayout, result); |
| 5769 | |
| 5770 | return result; |
| 5771 | } |
| 5772 | |
| 5773 | bool PreCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5774 | VkDevice device, |
| 5775 | const VkDescriptorPoolCreateInfo* pCreateInfo) |
| 5776 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5777 | if(pCreateInfo == nullptr) |
| 5778 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5779 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5780 | "vkCreateDescriptorPool parameter, const VkDescriptorPoolCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5781 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5782 | } |
| 5783 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5784 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5785 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5786 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5787 | "vkCreateDescriptorPool parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5788 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5789 | } |
| 5790 | if(pCreateInfo->pTypeCount == nullptr) |
| 5791 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5792 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5793 | "vkCreateDescriptorPool parameter, const VkDescriptorTypeCount* pCreateInfo->pTypeCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5794 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5795 | } |
| 5796 | if(pCreateInfo->pTypeCount->type < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5797 | pCreateInfo->pTypeCount->type > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5798 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5799 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5800 | "vkCreateDescriptorPool parameter, VkDescriptorType pCreateInfo->pTypeCount->type, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5801 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5802 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5803 | |
| 5804 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5805 | } |
| 5806 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5807 | bool PostCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5808 | VkDevice device, |
| 5809 | VkDescriptorPoolUsage poolUsage, |
| 5810 | uint32_t maxSets, |
| 5811 | VkDescriptorPool* pDescriptorPool, |
| 5812 | VkResult result) |
| 5813 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5814 | |
| 5815 | if(poolUsage < VK_DESCRIPTOR_POOL_USAGE_BEGIN_RANGE || |
| 5816 | poolUsage > VK_DESCRIPTOR_POOL_USAGE_END_RANGE) |
| 5817 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5818 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5819 | "vkCreateDescriptorPool parameter, VkDescriptorPoolUsage poolUsage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5820 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5821 | } |
| 5822 | |
| 5823 | |
| 5824 | if(pDescriptorPool == nullptr) |
| 5825 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5826 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5827 | "vkCreateDescriptorPool parameter, VkDescriptorPool* pDescriptorPool, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5828 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5829 | } |
| 5830 | |
| 5831 | if(result != VK_SUCCESS) |
| 5832 | { |
| 5833 | std::string reason = "vkCreateDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5834 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5835 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5836 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5837 | |
| 5838 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5839 | } |
| 5840 | |
| 5841 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool( |
| 5842 | VkDevice device, |
| 5843 | VkDescriptorPoolUsage poolUsage, |
| 5844 | uint32_t maxSets, |
| 5845 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 5846 | VkDescriptorPool* pDescriptorPool) |
| 5847 | { |
| 5848 | PreCreateDescriptorPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5849 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5850 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool); |
| 5851 | |
| 5852 | PostCreateDescriptorPool(device, poolUsage, maxSets, pDescriptorPool, result); |
| 5853 | |
| 5854 | return result; |
| 5855 | } |
| 5856 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5857 | bool PostDestroyDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5858 | VkDevice device, |
| 5859 | VkDescriptorPool descriptorPool, |
| 5860 | VkResult result) |
| 5861 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5862 | |
| 5863 | |
| 5864 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5865 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5866 | std::string reason = "vkDestroyDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
| 5867 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5868 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5869 | } |
| 5870 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5871 | return true; |
| 5872 | } |
| 5873 | |
| 5874 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDescriptorPool( |
| 5875 | VkDevice device, |
| 5876 | VkDescriptorPool descriptorPool) |
| 5877 | { |
| 5878 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorPool(device, descriptorPool); |
| 5879 | |
| 5880 | PostDestroyDescriptorPool(device, descriptorPool, result); |
| 5881 | |
| 5882 | return result; |
| 5883 | } |
| 5884 | |
| 5885 | bool PostResetDescriptorPool( |
| 5886 | VkDevice device, |
| 5887 | VkDescriptorPool descriptorPool, |
| 5888 | VkResult result) |
| 5889 | { |
| 5890 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5891 | |
| 5892 | if(result != VK_SUCCESS) |
| 5893 | { |
| 5894 | std::string reason = "vkResetDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5895 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5896 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5897 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5898 | |
| 5899 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5900 | } |
| 5901 | |
| 5902 | VK_LAYER_EXPORT VkResult VKAPI vkResetDescriptorPool( |
| 5903 | VkDevice device, |
| 5904 | VkDescriptorPool descriptorPool) |
| 5905 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5906 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool); |
| 5907 | |
| 5908 | PostResetDescriptorPool(device, descriptorPool, result); |
| 5909 | |
| 5910 | return result; |
| 5911 | } |
| 5912 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5913 | bool PreAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5914 | VkDevice device, |
| 5915 | const VkDescriptorSetLayout* pSetLayouts) |
| 5916 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5917 | if(pSetLayouts == nullptr) |
| 5918 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5919 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5920 | "vkAllocDescriptorSets parameter, const VkDescriptorSetLayout* pSetLayouts, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5921 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5922 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5923 | |
| 5924 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5925 | } |
| 5926 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5927 | bool PostAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5928 | VkDevice device, |
| 5929 | VkDescriptorPool descriptorPool, |
| 5930 | VkDescriptorSetUsage setUsage, |
| 5931 | uint32_t count, |
| 5932 | VkDescriptorSet* pDescriptorSets, |
| 5933 | uint32_t* pCount, |
| 5934 | VkResult result) |
| 5935 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5936 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5937 | |
| 5938 | if(setUsage < VK_DESCRIPTOR_SET_USAGE_BEGIN_RANGE || |
| 5939 | setUsage > VK_DESCRIPTOR_SET_USAGE_END_RANGE) |
| 5940 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5941 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5942 | "vkAllocDescriptorSets parameter, VkDescriptorSetUsage setUsage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5943 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5944 | } |
| 5945 | |
| 5946 | |
| 5947 | if(pDescriptorSets == nullptr) |
| 5948 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5949 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5950 | "vkAllocDescriptorSets parameter, VkDescriptorSet* pDescriptorSets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5951 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5952 | } |
| 5953 | |
| 5954 | if(pCount == nullptr) |
| 5955 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5956 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5957 | "vkAllocDescriptorSets parameter, uint32_t* pCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5958 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5959 | } |
| 5960 | |
| 5961 | if(result != VK_SUCCESS) |
| 5962 | { |
| 5963 | std::string reason = "vkAllocDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5964 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5965 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5966 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5967 | |
| 5968 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5969 | } |
| 5970 | |
| 5971 | VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets( |
| 5972 | VkDevice device, |
| 5973 | VkDescriptorPool descriptorPool, |
| 5974 | VkDescriptorSetUsage setUsage, |
| 5975 | uint32_t count, |
| 5976 | const VkDescriptorSetLayout* pSetLayouts, |
| 5977 | VkDescriptorSet* pDescriptorSets, |
| 5978 | uint32_t* pCount) |
| 5979 | { |
| 5980 | PreAllocDescriptorSets(device, pSetLayouts); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5981 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5982 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets, pCount); |
| 5983 | |
| 5984 | PostAllocDescriptorSets(device, descriptorPool, setUsage, count, pDescriptorSets, pCount, result); |
| 5985 | |
| 5986 | return result; |
| 5987 | } |
| 5988 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5989 | bool PreUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5990 | VkDevice device, |
| 5991 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 5992 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 5993 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5994 | if(pDescriptorWrites == nullptr) |
| 5995 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5996 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5997 | "vkUpdateDescriptorSets parameter, const VkWriteDescriptorSet* pDescriptorWrites, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5998 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5999 | } |
| 6000 | if(pDescriptorWrites->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6001 | pDescriptorWrites->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6002 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6003 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6004 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorWrites->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6005 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6006 | } |
| 6007 | if(pDescriptorWrites->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 6008 | pDescriptorWrites->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 6009 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6010 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6011 | "vkUpdateDescriptorSets parameter, VkDescriptorType pDescriptorWrites->descriptorType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6012 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6013 | } |
| 6014 | if(pDescriptorWrites->pDescriptors == nullptr) |
| 6015 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6016 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6017 | "vkUpdateDescriptorSets parameter, const VkDescriptorInfo* pDescriptorWrites->pDescriptors, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6018 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6019 | } |
| 6020 | if(pDescriptorWrites->pDescriptors->imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6021 | pDescriptorWrites->pDescriptors->imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6022 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6023 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6024 | "vkUpdateDescriptorSets parameter, VkImageLayout pDescriptorWrites->pDescriptors->imageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6025 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6026 | } |
| 6027 | |
| 6028 | if(pDescriptorCopies == nullptr) |
| 6029 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6030 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6031 | "vkUpdateDescriptorSets parameter, const VkCopyDescriptorSet* pDescriptorCopies, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6032 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6033 | } |
| 6034 | if(pDescriptorCopies->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6035 | pDescriptorCopies->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6036 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6037 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6038 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorCopies->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6039 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6040 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6041 | |
| 6042 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6043 | } |
| 6044 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6045 | bool PostUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6046 | VkDevice device, |
| 6047 | uint32_t writeCount, |
| 6048 | uint32_t copyCount, |
| 6049 | VkResult result) |
| 6050 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6051 | |
| 6052 | |
| 6053 | |
| 6054 | if(result != VK_SUCCESS) |
| 6055 | { |
| 6056 | std::string reason = "vkUpdateDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6057 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6058 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6059 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6060 | |
| 6061 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6062 | } |
| 6063 | |
| 6064 | VK_LAYER_EXPORT VkResult VKAPI vkUpdateDescriptorSets( |
| 6065 | VkDevice device, |
| 6066 | uint32_t writeCount, |
| 6067 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 6068 | uint32_t copyCount, |
| 6069 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 6070 | { |
| 6071 | PreUpdateDescriptorSets(device, pDescriptorWrites, pDescriptorCopies); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6072 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6073 | VkResult result = get_dispatch_table(pc_device_table_map, device)->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies); |
| 6074 | |
| 6075 | PostUpdateDescriptorSets(device, writeCount, copyCount, result); |
| 6076 | |
| 6077 | return result; |
| 6078 | } |
| 6079 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6080 | bool PreCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6081 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6082 | const VkDynamicViewportStateCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6083 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6084 | if(pCreateInfo == nullptr) |
| 6085 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6086 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6087 | "vkCreateDynamicViewportState parameter, const VkDynamicViewportStateCreateInfo* pCreateInfo, is null pointer"); |
| 6088 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6089 | } |
| 6090 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6091 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6092 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6093 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6094 | "vkCreateDynamicViewportState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6095 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6096 | } |
| 6097 | if(pCreateInfo->pViewports == nullptr) |
| 6098 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6099 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6100 | "vkCreateDynamicViewportState parameter, const VkViewport* pCreateInfo->pViewports, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6101 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6102 | } |
| 6103 | if(pCreateInfo->pScissors == nullptr) |
| 6104 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6105 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6106 | "vkCreateDynamicViewportState parameter, const VkRect2D* pCreateInfo->pScissors, is null pointer"); |
| 6107 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6108 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6109 | |
| 6110 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6111 | } |
| 6112 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6113 | bool PostCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6114 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6115 | VkDynamicViewportState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6116 | VkResult result) |
| 6117 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6118 | |
| 6119 | if(pState == nullptr) |
| 6120 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6121 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6122 | "vkCreateDynamicViewportState parameter, VkDynamicViewportState* pState, is null pointer"); |
| 6123 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6124 | } |
| 6125 | |
| 6126 | if(result != VK_SUCCESS) |
| 6127 | { |
| 6128 | std::string reason = "vkCreateDynamicViewportState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6129 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6130 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6131 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6132 | |
| 6133 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6134 | } |
| 6135 | |
| 6136 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicViewportState( |
| 6137 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6138 | const VkDynamicViewportStateCreateInfo* pCreateInfo, |
| 6139 | VkDynamicViewportState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6140 | { |
| 6141 | PreCreateDynamicViewportState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6142 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6143 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicViewportState(device, pCreateInfo, pState); |
| 6144 | |
| 6145 | PostCreateDynamicViewportState(device, pState, result); |
| 6146 | |
| 6147 | return result; |
| 6148 | } |
| 6149 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6150 | bool PostDestroyDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6151 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6152 | VkDynamicViewportState dynamicViewportState, |
| 6153 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6154 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6155 | |
| 6156 | |
| 6157 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6158 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6159 | std::string reason = "vkDestroyDynamicViewportState parameter, VkResult result, is " + EnumeratorString(result); |
| 6160 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6161 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6162 | } |
| 6163 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6164 | return true; |
| 6165 | } |
| 6166 | |
| 6167 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicViewportState( |
| 6168 | VkDevice device, |
| 6169 | VkDynamicViewportState dynamicViewportState) |
| 6170 | { |
| 6171 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicViewportState(device, dynamicViewportState); |
| 6172 | |
| 6173 | PostDestroyDynamicViewportState(device, dynamicViewportState, result); |
| 6174 | |
| 6175 | return result; |
| 6176 | } |
| 6177 | |
| 6178 | bool PreCreateDynamicRasterState( |
| 6179 | VkDevice device, |
| 6180 | const VkDynamicRasterStateCreateInfo* pCreateInfo) |
| 6181 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6182 | if(pCreateInfo == nullptr) |
| 6183 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6184 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6185 | "vkCreateDynamicRasterState parameter, const VkDynamicRasterStateCreateInfo* pCreateInfo, is null pointer"); |
| 6186 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6187 | } |
| 6188 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6189 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6190 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6191 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6192 | "vkCreateDynamicRasterState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6193 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6194 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6195 | |
| 6196 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6197 | } |
| 6198 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6199 | bool PostCreateDynamicRasterState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6200 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6201 | VkDynamicRasterState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6202 | VkResult result) |
| 6203 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6204 | |
| 6205 | if(pState == nullptr) |
| 6206 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6207 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6208 | "vkCreateDynamicRasterState parameter, VkDynamicRasterState* pState, is null pointer"); |
| 6209 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6210 | } |
| 6211 | |
| 6212 | if(result != VK_SUCCESS) |
| 6213 | { |
| 6214 | std::string reason = "vkCreateDynamicRasterState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6215 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6216 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6217 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6218 | |
| 6219 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6220 | } |
| 6221 | |
| 6222 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicRasterState( |
| 6223 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6224 | const VkDynamicRasterStateCreateInfo* pCreateInfo, |
| 6225 | VkDynamicRasterState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6226 | { |
| 6227 | PreCreateDynamicRasterState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6228 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6229 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicRasterState(device, pCreateInfo, pState); |
| 6230 | |
| 6231 | PostCreateDynamicRasterState(device, pState, result); |
| 6232 | |
| 6233 | return result; |
| 6234 | } |
| 6235 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6236 | bool PostDestroyDynamicRasterState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6237 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6238 | VkDynamicRasterState dynamicRasterState, |
| 6239 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6240 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6241 | |
| 6242 | |
| 6243 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6244 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6245 | std::string reason = "vkDestroyDynamicRasterState parameter, VkResult result, is " + EnumeratorString(result); |
| 6246 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6247 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6248 | } |
| 6249 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6250 | return true; |
| 6251 | } |
| 6252 | |
| 6253 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicRasterState( |
| 6254 | VkDevice device, |
| 6255 | VkDynamicRasterState dynamicRasterState) |
| 6256 | { |
| 6257 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicRasterState(device, dynamicRasterState); |
| 6258 | |
| 6259 | PostDestroyDynamicRasterState(device, dynamicRasterState, result); |
| 6260 | |
| 6261 | return result; |
| 6262 | } |
| 6263 | |
| 6264 | bool PreCreateDynamicColorBlendState( |
| 6265 | VkDevice device, |
| 6266 | const VkDynamicColorBlendStateCreateInfo* pCreateInfo) |
| 6267 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6268 | if(pCreateInfo == nullptr) |
| 6269 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6270 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6271 | "vkCreateDynamicColorBlendState parameter, const VkDynamicColorBlendStateCreateInfo* pCreateInfo, is null pointer"); |
| 6272 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6273 | } |
| 6274 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6275 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6276 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6277 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6278 | "vkCreateDynamicColorBlendState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6279 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6280 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6281 | |
| 6282 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6283 | } |
| 6284 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6285 | bool PostCreateDynamicColorBlendState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6286 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6287 | VkDynamicColorBlendState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6288 | VkResult result) |
| 6289 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6290 | |
| 6291 | if(pState == nullptr) |
| 6292 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6293 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6294 | "vkCreateDynamicColorBlendState parameter, VkDynamicColorBlendState* pState, is null pointer"); |
| 6295 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6296 | } |
| 6297 | |
| 6298 | if(result != VK_SUCCESS) |
| 6299 | { |
| 6300 | std::string reason = "vkCreateDynamicColorBlendState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6301 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6302 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6303 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6304 | |
| 6305 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6306 | } |
| 6307 | |
| 6308 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState( |
| 6309 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6310 | const VkDynamicColorBlendStateCreateInfo* pCreateInfo, |
| 6311 | VkDynamicColorBlendState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6312 | { |
| 6313 | PreCreateDynamicColorBlendState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6314 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6315 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicColorBlendState(device, pCreateInfo, pState); |
| 6316 | |
| 6317 | PostCreateDynamicColorBlendState(device, pState, result); |
| 6318 | |
| 6319 | return result; |
| 6320 | } |
| 6321 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6322 | bool PostDestroyDynamicColorBlendState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6323 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6324 | VkDynamicColorBlendState dynamicColorBlendState, |
| 6325 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6326 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6327 | |
| 6328 | |
| 6329 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6330 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6331 | std::string reason = "vkDestroyDynamicColorBlendState parameter, VkResult result, is " + EnumeratorString(result); |
| 6332 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6333 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6334 | } |
| 6335 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6336 | return true; |
| 6337 | } |
| 6338 | |
| 6339 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicColorBlendState( |
| 6340 | VkDevice device, |
| 6341 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6342 | { |
| 6343 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicColorBlendState(device, dynamicColorBlendState); |
| 6344 | |
| 6345 | PostDestroyDynamicColorBlendState(device, dynamicColorBlendState, result); |
| 6346 | |
| 6347 | return result; |
| 6348 | } |
| 6349 | |
| 6350 | bool PreCreateDynamicDepthStencilState( |
| 6351 | VkDevice device, |
| 6352 | const VkDynamicDepthStencilStateCreateInfo* pCreateInfo) |
| 6353 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6354 | if(pCreateInfo == nullptr) |
| 6355 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6356 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6357 | "vkCreateDynamicDepthStencilState parameter, const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, is null pointer"); |
| 6358 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6359 | } |
| 6360 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6361 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6362 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6363 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6364 | "vkCreateDynamicDepthStencilState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6365 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6366 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6367 | |
| 6368 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6369 | } |
| 6370 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6371 | bool PostCreateDynamicDepthStencilState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6372 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6373 | VkDynamicDepthStencilState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6374 | VkResult result) |
| 6375 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6376 | |
| 6377 | if(pState == nullptr) |
| 6378 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6379 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6380 | "vkCreateDynamicDepthStencilState parameter, VkDynamicDepthStencilState* pState, is null pointer"); |
| 6381 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6382 | } |
| 6383 | |
| 6384 | if(result != VK_SUCCESS) |
| 6385 | { |
| 6386 | std::string reason = "vkCreateDynamicDepthStencilState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6387 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6388 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6389 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6390 | |
| 6391 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6392 | } |
| 6393 | |
| 6394 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState( |
| 6395 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6396 | const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, |
| 6397 | VkDynamicDepthStencilState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6398 | { |
| 6399 | PreCreateDynamicDepthStencilState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6400 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6401 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicDepthStencilState(device, pCreateInfo, pState); |
| 6402 | |
| 6403 | PostCreateDynamicDepthStencilState(device, pState, result); |
| 6404 | |
| 6405 | return result; |
| 6406 | } |
| 6407 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6408 | bool PostDestroyDynamicDepthStencilState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6409 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6410 | VkDynamicDepthStencilState dynamicDepthStencilState, |
| 6411 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6412 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6413 | |
| 6414 | |
| 6415 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6416 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6417 | std::string reason = "vkDestroyDynamicDepthStencilState parameter, VkResult result, is " + EnumeratorString(result); |
| 6418 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6419 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6420 | } |
| 6421 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6422 | return true; |
| 6423 | } |
| 6424 | |
| 6425 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicDepthStencilState( |
| 6426 | VkDevice device, |
| 6427 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6428 | { |
| 6429 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicDepthStencilState(device, dynamicDepthStencilState); |
| 6430 | |
| 6431 | PostDestroyDynamicDepthStencilState(device, dynamicDepthStencilState, result); |
| 6432 | |
| 6433 | return result; |
| 6434 | } |
| 6435 | |
| 6436 | bool PreCreateCommandBuffer( |
| 6437 | VkDevice device, |
| 6438 | const VkCmdBufferCreateInfo* pCreateInfo) |
| 6439 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6440 | if(pCreateInfo == nullptr) |
| 6441 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6442 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6443 | "vkCreateCommandBuffer parameter, const VkCmdBufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6444 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6445 | } |
| 6446 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6447 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6448 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6449 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6450 | "vkCreateCommandBuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6451 | return false; |
| 6452 | } |
| 6453 | if(pCreateInfo->level < VK_CMD_BUFFER_LEVEL_BEGIN_RANGE || |
| 6454 | pCreateInfo->level > VK_CMD_BUFFER_LEVEL_END_RANGE) |
| 6455 | { |
| 6456 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6457 | "vkCreateCommandBuffer parameter, VkCmdBufferLevel pCreateInfo->level, is unrecognized enumerator"); |
| 6458 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6459 | } |
| 6460 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6461 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6462 | } |
| 6463 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6464 | bool PostCreateCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6465 | VkDevice device, |
| 6466 | VkCmdBuffer* pCmdBuffer, |
| 6467 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6468 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6469 | |
| 6470 | if(pCmdBuffer == nullptr) |
| 6471 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6472 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6473 | "vkCreateCommandBuffer parameter, VkCmdBuffer* pCmdBuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6474 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6475 | } |
| 6476 | |
| 6477 | if(result != VK_SUCCESS) |
| 6478 | { |
| 6479 | std::string reason = "vkCreateCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6480 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6481 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6482 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6483 | |
| 6484 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6485 | } |
| 6486 | |
| 6487 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandBuffer( |
| 6488 | VkDevice device, |
| 6489 | const VkCmdBufferCreateInfo* pCreateInfo, |
| 6490 | VkCmdBuffer* pCmdBuffer) |
| 6491 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6492 | PreCreateCommandBuffer(device, pCreateInfo); |
| 6493 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6494 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 6495 | |
| 6496 | PostCreateCommandBuffer(device, pCmdBuffer, result); |
| 6497 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6498 | return result; |
| 6499 | } |
| 6500 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6501 | bool PostDestroyCommandBuffer( |
| 6502 | VkDevice device, |
| 6503 | VkCmdBuffer commandBuffer, |
| 6504 | VkResult result) |
| 6505 | { |
| 6506 | |
| 6507 | |
| 6508 | if(result != VK_SUCCESS) |
| 6509 | { |
| 6510 | std::string reason = "vkDestroyCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 6511 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6512 | return false; |
| 6513 | } |
| 6514 | |
| 6515 | return true; |
| 6516 | } |
| 6517 | |
| 6518 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyCommandBuffer( |
| 6519 | VkDevice device, |
| 6520 | VkCmdBuffer commandBuffer) |
| 6521 | { |
| 6522 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyCommandBuffer(device, commandBuffer); |
| 6523 | |
| 6524 | PostDestroyCommandBuffer(device, commandBuffer, result); |
| 6525 | |
| 6526 | return result; |
| 6527 | } |
| 6528 | |
| 6529 | bool PreBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6530 | VkCmdBuffer cmdBuffer, |
| 6531 | const VkCmdBufferBeginInfo* pBeginInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6532 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6533 | if(pBeginInfo == nullptr) |
| 6534 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6535 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6536 | "vkBeginCommandBuffer parameter, const VkCmdBufferBeginInfo* pBeginInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6537 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6538 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6539 | if(pBeginInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6540 | pBeginInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6541 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6542 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6543 | "vkBeginCommandBuffer parameter, VkStructureType pBeginInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6544 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6545 | } |
| 6546 | if(!ValidateEnumerator((VkCmdBufferOptimizeFlagBits)pBeginInfo->flags)) |
| 6547 | { |
| 6548 | std::string reason = "vkBeginCommandBuffer parameter, VkCmdBufferOptimizeFlags pBeginInfo->flags, is " + EnumeratorString((VkCmdBufferOptimizeFlagBits)pBeginInfo->flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6549 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6550 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6551 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6552 | |
| 6553 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6554 | } |
| 6555 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6556 | bool PostBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6557 | VkCmdBuffer cmdBuffer, |
| 6558 | VkResult result) |
| 6559 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6560 | |
| 6561 | if(result != VK_SUCCESS) |
| 6562 | { |
| 6563 | std::string reason = "vkBeginCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6564 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6565 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6566 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6567 | |
| 6568 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6569 | } |
| 6570 | |
| 6571 | VK_LAYER_EXPORT VkResult VKAPI vkBeginCommandBuffer( |
| 6572 | VkCmdBuffer cmdBuffer, |
| 6573 | const VkCmdBufferBeginInfo* pBeginInfo) |
| 6574 | { |
| 6575 | PreBeginCommandBuffer(cmdBuffer, pBeginInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6576 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6577 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->BeginCommandBuffer(cmdBuffer, pBeginInfo); |
| 6578 | |
| 6579 | PostBeginCommandBuffer(cmdBuffer, result); |
| 6580 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6581 | return result; |
| 6582 | } |
| 6583 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6584 | bool PostEndCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6585 | VkCmdBuffer cmdBuffer, |
| 6586 | VkResult result) |
| 6587 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6588 | |
| 6589 | if(result != VK_SUCCESS) |
| 6590 | { |
| 6591 | std::string reason = "vkEndCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6592 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6593 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6594 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6595 | |
| 6596 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6597 | } |
| 6598 | |
| 6599 | VK_LAYER_EXPORT VkResult VKAPI vkEndCommandBuffer( |
| 6600 | VkCmdBuffer cmdBuffer) |
| 6601 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6602 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->EndCommandBuffer(cmdBuffer); |
| 6603 | |
| 6604 | PostEndCommandBuffer(cmdBuffer, result); |
| 6605 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6606 | return result; |
| 6607 | } |
| 6608 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6609 | bool PostResetCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6610 | VkCmdBuffer cmdBuffer, |
| 6611 | VkResult result) |
| 6612 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6613 | |
| 6614 | if(result != VK_SUCCESS) |
| 6615 | { |
| 6616 | std::string reason = "vkResetCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6617 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6618 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6619 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6620 | |
| 6621 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6622 | } |
| 6623 | |
| 6624 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandBuffer( |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 6625 | VkCmdBuffer cmdBuffer, |
| 6626 | VkCmdBufferResetFlags flags) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6627 | { |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 6628 | 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] | 6629 | |
| 6630 | PostResetCommandBuffer(cmdBuffer, result); |
| 6631 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6632 | return result; |
| 6633 | } |
| 6634 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6635 | bool PostCmdBindPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6636 | VkCmdBuffer cmdBuffer, |
| 6637 | VkPipelineBindPoint pipelineBindPoint, |
| 6638 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6639 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6640 | |
| 6641 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6642 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6643 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6644 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6645 | "vkCmdBindPipeline parameter, VkPipelineBindPoint pipelineBindPoint, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6646 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6647 | } |
| 6648 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6649 | |
| 6650 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6651 | } |
| 6652 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6653 | VK_LAYER_EXPORT void VKAPI vkCmdBindPipeline( |
| 6654 | VkCmdBuffer cmdBuffer, |
| 6655 | VkPipelineBindPoint pipelineBindPoint, |
| 6656 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6657 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6658 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 6659 | |
| 6660 | PostCmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 6661 | } |
| 6662 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6663 | bool PostCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6664 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6665 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6666 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6667 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6668 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6669 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6670 | } |
| 6671 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6672 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6673 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6674 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6675 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6676 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6677 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6678 | PostCmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6679 | } |
| 6680 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6681 | bool PostCmdBindDynamicRasterState( |
| 6682 | VkCmdBuffer cmdBuffer, |
| 6683 | VkDynamicRasterState dynamicRasterState) |
| 6684 | { |
| 6685 | |
| 6686 | |
| 6687 | return true; |
| 6688 | } |
| 6689 | |
| 6690 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicRasterState( |
| 6691 | VkCmdBuffer cmdBuffer, |
| 6692 | VkDynamicRasterState dynamicRasterState) |
| 6693 | { |
| 6694 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicRasterState(cmdBuffer, dynamicRasterState); |
| 6695 | |
| 6696 | PostCmdBindDynamicRasterState(cmdBuffer, dynamicRasterState); |
| 6697 | } |
| 6698 | |
| 6699 | bool PostCmdBindDynamicColorBlendState( |
| 6700 | VkCmdBuffer cmdBuffer, |
| 6701 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6702 | { |
| 6703 | |
| 6704 | |
| 6705 | return true; |
| 6706 | } |
| 6707 | |
| 6708 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicColorBlendState( |
| 6709 | VkCmdBuffer cmdBuffer, |
| 6710 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6711 | { |
| 6712 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState); |
| 6713 | |
| 6714 | PostCmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState); |
| 6715 | } |
| 6716 | |
| 6717 | bool PostCmdBindDynamicDepthStencilState( |
| 6718 | VkCmdBuffer cmdBuffer, |
| 6719 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6720 | { |
| 6721 | |
| 6722 | |
| 6723 | return true; |
| 6724 | } |
| 6725 | |
| 6726 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicDepthStencilState( |
| 6727 | VkCmdBuffer cmdBuffer, |
| 6728 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6729 | { |
| 6730 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState); |
| 6731 | |
| 6732 | PostCmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState); |
| 6733 | } |
| 6734 | |
| 6735 | bool PreCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6736 | VkCmdBuffer cmdBuffer, |
| 6737 | const VkDescriptorSet* pDescriptorSets, |
| 6738 | const uint32_t* pDynamicOffsets) |
| 6739 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6740 | if(pDescriptorSets == nullptr) |
| 6741 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6742 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6743 | "vkCmdBindDescriptorSets parameter, const VkDescriptorSet* pDescriptorSets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6744 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6745 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6746 | |
| 6747 | |
| 6748 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6749 | } |
| 6750 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6751 | bool PostCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6752 | VkCmdBuffer cmdBuffer, |
| 6753 | VkPipelineBindPoint pipelineBindPoint, |
| 6754 | VkPipelineLayout layout, |
| 6755 | uint32_t firstSet, |
| 6756 | uint32_t setCount, |
| 6757 | uint32_t dynamicOffsetCount) |
| 6758 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6759 | |
| 6760 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6761 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6762 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6763 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6764 | "vkCmdBindDescriptorSets parameter, VkPipelineBindPoint pipelineBindPoint, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6765 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6766 | } |
| 6767 | |
| 6768 | |
| 6769 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6770 | |
| 6771 | |
| 6772 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6773 | } |
| 6774 | |
| 6775 | VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets( |
| 6776 | VkCmdBuffer cmdBuffer, |
| 6777 | VkPipelineBindPoint pipelineBindPoint, |
| 6778 | VkPipelineLayout layout, |
| 6779 | uint32_t firstSet, |
| 6780 | uint32_t setCount, |
| 6781 | const VkDescriptorSet* pDescriptorSets, |
| 6782 | uint32_t dynamicOffsetCount, |
| 6783 | const uint32_t* pDynamicOffsets) |
| 6784 | { |
| 6785 | PreCmdBindDescriptorSets(cmdBuffer, pDescriptorSets, pDynamicOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6786 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6787 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 6788 | |
| 6789 | PostCmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, dynamicOffsetCount); |
| 6790 | } |
| 6791 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6792 | bool PostCmdBindIndexBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6793 | VkCmdBuffer cmdBuffer, |
| 6794 | VkBuffer buffer, |
| 6795 | VkDeviceSize offset, |
| 6796 | VkIndexType indexType) |
| 6797 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6798 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6799 | |
| 6800 | |
| 6801 | if(indexType < VK_INDEX_TYPE_BEGIN_RANGE || |
| 6802 | indexType > VK_INDEX_TYPE_END_RANGE) |
| 6803 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6804 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6805 | "vkCmdBindIndexBuffer parameter, VkIndexType indexType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6806 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6807 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6808 | |
| 6809 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6810 | } |
| 6811 | |
| 6812 | VK_LAYER_EXPORT void VKAPI vkCmdBindIndexBuffer( |
| 6813 | VkCmdBuffer cmdBuffer, |
| 6814 | VkBuffer buffer, |
| 6815 | VkDeviceSize offset, |
| 6816 | VkIndexType indexType) |
| 6817 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6818 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6819 | |
| 6820 | PostCmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6821 | } |
| 6822 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6823 | bool PreCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6824 | VkCmdBuffer cmdBuffer, |
| 6825 | const VkBuffer* pBuffers, |
| 6826 | const VkDeviceSize* pOffsets) |
| 6827 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6828 | if(pBuffers == nullptr) |
| 6829 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6830 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6831 | "vkCmdBindVertexBuffers parameter, const VkBuffer* pBuffers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6832 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6833 | } |
| 6834 | |
| 6835 | if(pOffsets == nullptr) |
| 6836 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6837 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6838 | "vkCmdBindVertexBuffers parameter, const VkDeviceSize* pOffsets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6839 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6840 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6841 | |
| 6842 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6843 | } |
| 6844 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6845 | bool PostCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6846 | VkCmdBuffer cmdBuffer, |
| 6847 | uint32_t startBinding, |
| 6848 | uint32_t bindingCount) |
| 6849 | { |
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 | |
| 6853 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6854 | } |
| 6855 | |
Courtney Goeltzenleuchter | f68ad72 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 6856 | VK_LAYER_EXPORT void VKAPI vkCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6857 | VkCmdBuffer cmdBuffer, |
| 6858 | uint32_t startBinding, |
| 6859 | uint32_t bindingCount, |
| 6860 | const VkBuffer* pBuffers, |
| 6861 | const VkDeviceSize* pOffsets) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6862 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6863 | PreCmdBindVertexBuffers(cmdBuffer, pBuffers, pOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6864 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6865 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets); |
| 6866 | |
| 6867 | PostCmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6868 | } |
| 6869 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6870 | bool PostCmdDraw( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6871 | VkCmdBuffer cmdBuffer, |
| 6872 | uint32_t firstVertex, |
| 6873 | uint32_t vertexCount, |
| 6874 | uint32_t firstInstance, |
| 6875 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6876 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6877 | |
| 6878 | |
| 6879 | |
| 6880 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6881 | |
| 6882 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6883 | } |
| 6884 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6885 | VK_LAYER_EXPORT void VKAPI vkCmdDraw( |
| 6886 | VkCmdBuffer cmdBuffer, |
| 6887 | uint32_t firstVertex, |
| 6888 | uint32_t vertexCount, |
| 6889 | uint32_t firstInstance, |
| 6890 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6891 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6892 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 6893 | |
| 6894 | PostCmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6895 | } |
| 6896 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6897 | bool PostCmdDrawIndexed( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6898 | VkCmdBuffer cmdBuffer, |
| 6899 | uint32_t firstIndex, |
| 6900 | uint32_t indexCount, |
| 6901 | int32_t vertexOffset, |
| 6902 | uint32_t firstInstance, |
| 6903 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6904 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6905 | |
| 6906 | |
| 6907 | |
| 6908 | |
| 6909 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6910 | |
| 6911 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6912 | } |
| 6913 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6914 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed( |
| 6915 | VkCmdBuffer cmdBuffer, |
| 6916 | uint32_t firstIndex, |
| 6917 | uint32_t indexCount, |
| 6918 | int32_t vertexOffset, |
| 6919 | uint32_t firstInstance, |
| 6920 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6921 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6922 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 6923 | |
| 6924 | PostCmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 6925 | } |
| 6926 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6927 | bool PostCmdDrawIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6928 | VkCmdBuffer cmdBuffer, |
| 6929 | VkBuffer buffer, |
| 6930 | VkDeviceSize offset, |
| 6931 | uint32_t count, |
| 6932 | uint32_t stride) |
| 6933 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6934 | |
| 6935 | |
| 6936 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6937 | |
| 6938 | |
| 6939 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6940 | } |
| 6941 | |
| 6942 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndirect( |
| 6943 | VkCmdBuffer cmdBuffer, |
| 6944 | VkBuffer buffer, |
| 6945 | VkDeviceSize offset, |
| 6946 | uint32_t count, |
| 6947 | uint32_t stride) |
| 6948 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6949 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6950 | |
| 6951 | PostCmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6952 | } |
| 6953 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6954 | bool PostCmdDrawIndexedIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6955 | VkCmdBuffer cmdBuffer, |
| 6956 | VkBuffer buffer, |
| 6957 | VkDeviceSize offset, |
| 6958 | uint32_t count, |
| 6959 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6960 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6961 | |
| 6962 | |
| 6963 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6964 | |
| 6965 | |
| 6966 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6967 | } |
| 6968 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6969 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexedIndirect( |
| 6970 | VkCmdBuffer cmdBuffer, |
| 6971 | VkBuffer buffer, |
| 6972 | VkDeviceSize offset, |
| 6973 | uint32_t count, |
| 6974 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6975 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6976 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6977 | |
| 6978 | PostCmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6979 | } |
| 6980 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6981 | bool PostCmdDispatch( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6982 | VkCmdBuffer cmdBuffer, |
| 6983 | uint32_t x, |
| 6984 | uint32_t y, |
| 6985 | uint32_t z) |
| 6986 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6987 | |
| 6988 | |
| 6989 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6990 | |
| 6991 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6992 | } |
| 6993 | |
| 6994 | VK_LAYER_EXPORT void VKAPI vkCmdDispatch( |
| 6995 | VkCmdBuffer cmdBuffer, |
| 6996 | uint32_t x, |
| 6997 | uint32_t y, |
| 6998 | uint32_t z) |
| 6999 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7000 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatch(cmdBuffer, x, y, z); |
| 7001 | |
| 7002 | PostCmdDispatch(cmdBuffer, x, y, z); |
| 7003 | } |
| 7004 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7005 | bool PostCmdDispatchIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7006 | VkCmdBuffer cmdBuffer, |
| 7007 | VkBuffer buffer, |
| 7008 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7009 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7010 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7011 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7012 | |
| 7013 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7014 | } |
| 7015 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7016 | VK_LAYER_EXPORT void VKAPI vkCmdDispatchIndirect( |
| 7017 | VkCmdBuffer cmdBuffer, |
| 7018 | VkBuffer buffer, |
| 7019 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7020 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7021 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatchIndirect(cmdBuffer, buffer, offset); |
| 7022 | |
| 7023 | PostCmdDispatchIndirect(cmdBuffer, buffer, offset); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7024 | } |
| 7025 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7026 | bool PreCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7027 | VkCmdBuffer cmdBuffer, |
| 7028 | const VkBufferCopy* pRegions) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7029 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7030 | if(pRegions == nullptr) |
| 7031 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7032 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7033 | "vkCmdCopyBuffer parameter, const VkBufferCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7034 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7035 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7036 | |
| 7037 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7038 | } |
| 7039 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7040 | bool PostCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7041 | VkCmdBuffer cmdBuffer, |
| 7042 | VkBuffer srcBuffer, |
| 7043 | VkBuffer destBuffer, |
| 7044 | uint32_t regionCount) |
| 7045 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7046 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7047 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7048 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7049 | |
| 7050 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7051 | } |
| 7052 | |
| 7053 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBuffer( |
| 7054 | VkCmdBuffer cmdBuffer, |
| 7055 | VkBuffer srcBuffer, |
| 7056 | VkBuffer destBuffer, |
| 7057 | uint32_t regionCount, |
| 7058 | const VkBufferCopy* pRegions) |
| 7059 | { |
| 7060 | PreCmdCopyBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7061 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7062 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); |
| 7063 | |
| 7064 | PostCmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount); |
| 7065 | } |
| 7066 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7067 | bool PreCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7068 | VkCmdBuffer cmdBuffer, |
| 7069 | const VkImageCopy* pRegions) |
| 7070 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7071 | if(pRegions == nullptr) |
| 7072 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7073 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7074 | "vkCmdCopyImage parameter, const VkImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7075 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7076 | } |
| 7077 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7078 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7079 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7080 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7081 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7082 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7083 | } |
| 7084 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7085 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7086 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7087 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7088 | "vkCmdCopyImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7089 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7090 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7091 | |
| 7092 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7093 | } |
| 7094 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7095 | bool PostCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7096 | VkCmdBuffer cmdBuffer, |
| 7097 | VkImage srcImage, |
| 7098 | VkImageLayout srcImageLayout, |
| 7099 | VkImage destImage, |
| 7100 | VkImageLayout destImageLayout, |
| 7101 | uint32_t regionCount) |
| 7102 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7103 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7104 | |
| 7105 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7106 | srcImageLayout > VK_IMAGE_LAYOUT_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 | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7109 | "vkCmdCopyImage parameter, VkImageLayout srcImageLayout, is 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 | |
| 7114 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7115 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7116 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7117 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7118 | "vkCmdCopyImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7119 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7120 | } |
| 7121 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7122 | |
| 7123 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7124 | } |
| 7125 | |
| 7126 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImage( |
| 7127 | VkCmdBuffer cmdBuffer, |
| 7128 | VkImage srcImage, |
| 7129 | VkImageLayout srcImageLayout, |
| 7130 | VkImage destImage, |
| 7131 | VkImageLayout destImageLayout, |
| 7132 | uint32_t regionCount, |
| 7133 | const VkImageCopy* pRegions) |
| 7134 | { |
| 7135 | PreCmdCopyImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7136 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7137 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 7138 | |
| 7139 | PostCmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 7140 | } |
| 7141 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7142 | bool PreCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7143 | VkCmdBuffer cmdBuffer, |
| 7144 | const VkImageBlit* pRegions) |
| 7145 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7146 | if(pRegions == nullptr) |
| 7147 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7148 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7149 | "vkCmdBlitImage parameter, const VkImageBlit* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7150 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7151 | } |
| 7152 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7153 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7154 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7155 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7156 | "vkCmdBlitImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7157 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7158 | } |
| 7159 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7160 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7161 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7162 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7163 | "vkCmdBlitImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7164 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7165 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7166 | |
| 7167 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7168 | } |
| 7169 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7170 | bool PostCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7171 | VkCmdBuffer cmdBuffer, |
| 7172 | VkImage srcImage, |
| 7173 | VkImageLayout srcImageLayout, |
| 7174 | VkImage destImage, |
| 7175 | VkImageLayout destImageLayout, |
| 7176 | uint32_t regionCount, |
| 7177 | VkTexFilter filter) |
| 7178 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7179 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7180 | |
| 7181 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7182 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7183 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7184 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7185 | "vkCmdBlitImage parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7186 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7187 | } |
| 7188 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7189 | |
| 7190 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7191 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7192 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7193 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7194 | "vkCmdBlitImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7195 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7196 | } |
| 7197 | |
| 7198 | |
| 7199 | if(filter < VK_TEX_FILTER_BEGIN_RANGE || |
| 7200 | filter > VK_TEX_FILTER_END_RANGE) |
| 7201 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7202 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7203 | "vkCmdBlitImage parameter, VkTexFilter filter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7204 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7205 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7206 | |
| 7207 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7208 | } |
| 7209 | |
| 7210 | VK_LAYER_EXPORT void VKAPI vkCmdBlitImage( |
| 7211 | VkCmdBuffer cmdBuffer, |
| 7212 | VkImage srcImage, |
| 7213 | VkImageLayout srcImageLayout, |
| 7214 | VkImage destImage, |
| 7215 | VkImageLayout destImageLayout, |
| 7216 | uint32_t regionCount, |
| 7217 | const VkImageBlit* pRegions, |
| 7218 | VkTexFilter filter) |
| 7219 | { |
| 7220 | PreCmdBlitImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7221 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7222 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); |
| 7223 | |
| 7224 | PostCmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, filter); |
| 7225 | } |
| 7226 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7227 | bool PreCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7228 | VkCmdBuffer cmdBuffer, |
| 7229 | const VkBufferImageCopy* pRegions) |
| 7230 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7231 | if(pRegions == nullptr) |
| 7232 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7233 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7234 | "vkCmdCopyBufferToImage parameter, const VkBufferImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7235 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7236 | } |
| 7237 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7238 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7239 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7240 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7241 | "vkCmdCopyBufferToImage parameter, VkImageAspect pRegions->imageSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7242 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7243 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7244 | |
| 7245 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7246 | } |
| 7247 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7248 | bool PostCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7249 | VkCmdBuffer cmdBuffer, |
| 7250 | VkBuffer srcBuffer, |
| 7251 | VkImage destImage, |
| 7252 | VkImageLayout destImageLayout, |
| 7253 | uint32_t regionCount) |
| 7254 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7255 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7256 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7257 | |
| 7258 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7259 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7260 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7261 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7262 | "vkCmdCopyBufferToImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7263 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7264 | } |
| 7265 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7266 | |
| 7267 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7268 | } |
| 7269 | |
| 7270 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBufferToImage( |
| 7271 | VkCmdBuffer cmdBuffer, |
| 7272 | VkBuffer srcBuffer, |
| 7273 | VkImage destImage, |
| 7274 | VkImageLayout destImageLayout, |
| 7275 | uint32_t regionCount, |
| 7276 | const VkBufferImageCopy* pRegions) |
| 7277 | { |
| 7278 | PreCmdCopyBufferToImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7279 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7280 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); |
| 7281 | |
| 7282 | PostCmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount); |
| 7283 | } |
| 7284 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7285 | bool PreCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7286 | VkCmdBuffer cmdBuffer, |
| 7287 | const VkBufferImageCopy* pRegions) |
| 7288 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7289 | if(pRegions == nullptr) |
| 7290 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7291 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7292 | "vkCmdCopyImageToBuffer parameter, const VkBufferImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7293 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7294 | } |
| 7295 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7296 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7297 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7298 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7299 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7300 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7301 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7302 | |
| 7303 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7304 | } |
| 7305 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7306 | bool PostCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7307 | VkCmdBuffer cmdBuffer, |
| 7308 | VkImage srcImage, |
| 7309 | VkImageLayout srcImageLayout, |
| 7310 | VkBuffer destBuffer, |
| 7311 | uint32_t regionCount) |
| 7312 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7313 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7314 | |
| 7315 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7316 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7317 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7318 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7319 | "vkCmdCopyImageToBuffer parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7320 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7321 | } |
| 7322 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7323 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7324 | |
| 7325 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7326 | } |
| 7327 | |
| 7328 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImageToBuffer( |
| 7329 | VkCmdBuffer cmdBuffer, |
| 7330 | VkImage srcImage, |
| 7331 | VkImageLayout srcImageLayout, |
| 7332 | VkBuffer destBuffer, |
| 7333 | uint32_t regionCount, |
| 7334 | const VkBufferImageCopy* pRegions) |
| 7335 | { |
| 7336 | PreCmdCopyImageToBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7337 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7338 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); |
| 7339 | |
| 7340 | PostCmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount); |
| 7341 | } |
| 7342 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7343 | bool PreCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7344 | VkCmdBuffer cmdBuffer, |
| 7345 | const uint32_t* pData) |
| 7346 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7347 | if(pData == nullptr) |
| 7348 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7349 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7350 | "vkCmdUpdateBuffer parameter, const uint32_t* pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7351 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7352 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7353 | |
| 7354 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7355 | } |
| 7356 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7357 | bool PostCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7358 | VkCmdBuffer cmdBuffer, |
| 7359 | VkBuffer destBuffer, |
| 7360 | VkDeviceSize destOffset, |
| 7361 | VkDeviceSize dataSize) |
| 7362 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7363 | |
| 7364 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7365 | |
| 7366 | |
| 7367 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7368 | } |
| 7369 | |
| 7370 | VK_LAYER_EXPORT void VKAPI vkCmdUpdateBuffer( |
| 7371 | VkCmdBuffer cmdBuffer, |
| 7372 | VkBuffer destBuffer, |
| 7373 | VkDeviceSize destOffset, |
| 7374 | VkDeviceSize dataSize, |
| 7375 | const uint32_t* pData) |
| 7376 | { |
| 7377 | PreCmdUpdateBuffer(cmdBuffer, pData); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7378 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7379 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData); |
| 7380 | |
| 7381 | PostCmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize); |
| 7382 | } |
| 7383 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7384 | bool PostCmdFillBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7385 | VkCmdBuffer cmdBuffer, |
| 7386 | VkBuffer destBuffer, |
| 7387 | VkDeviceSize destOffset, |
| 7388 | VkDeviceSize fillSize, |
| 7389 | uint32_t data) |
| 7390 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7391 | |
| 7392 | |
| 7393 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7394 | |
| 7395 | |
| 7396 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7397 | } |
| 7398 | |
| 7399 | VK_LAYER_EXPORT void VKAPI vkCmdFillBuffer( |
| 7400 | VkCmdBuffer cmdBuffer, |
| 7401 | VkBuffer destBuffer, |
| 7402 | VkDeviceSize destOffset, |
| 7403 | VkDeviceSize fillSize, |
| 7404 | uint32_t data) |
| 7405 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7406 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 7407 | |
| 7408 | PostCmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 7409 | } |
| 7410 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7411 | bool PreCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7412 | VkCmdBuffer cmdBuffer, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 7413 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7414 | const VkImageSubresourceRange* pRanges) |
| 7415 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7416 | if(pColor == nullptr) |
| 7417 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7418 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7419 | "vkCmdClearColorImage parameter, const VkClearColorValue* pColor, is null pointer"); |
| 7420 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7421 | } |
| 7422 | |
| 7423 | if(pRanges == nullptr) |
| 7424 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7425 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7426 | "vkCmdClearColorImage parameter, const VkImageSubresourceRange* pRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7427 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7428 | } |
| 7429 | if(pRanges->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7430 | pRanges->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7431 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7432 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7433 | "vkCmdClearColorImage parameter, VkImageAspect pRanges->aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7434 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7435 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7436 | |
| 7437 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7438 | } |
| 7439 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7440 | bool PostCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7441 | VkCmdBuffer cmdBuffer, |
| 7442 | VkImage image, |
| 7443 | VkImageLayout imageLayout, |
| 7444 | uint32_t rangeCount) |
| 7445 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7446 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7447 | |
| 7448 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7449 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7450 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7451 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7452 | "vkCmdClearColorImage parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7453 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7454 | } |
| 7455 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7456 | |
| 7457 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7458 | } |
| 7459 | |
| 7460 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage( |
| 7461 | VkCmdBuffer cmdBuffer, |
| 7462 | VkImage image, |
| 7463 | VkImageLayout imageLayout, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 7464 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7465 | uint32_t rangeCount, |
| 7466 | const VkImageSubresourceRange* pRanges) |
| 7467 | { |
| 7468 | PreCmdClearColorImage(cmdBuffer, pColor, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7469 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7470 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 7471 | |
| 7472 | PostCmdClearColorImage(cmdBuffer, image, imageLayout, rangeCount); |
| 7473 | } |
| 7474 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7475 | bool PreCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7476 | VkCmdBuffer cmdBuffer, |
| 7477 | const VkImageSubresourceRange* pRanges) |
| 7478 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7479 | if(pRanges == nullptr) |
| 7480 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7481 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7482 | "vkCmdClearDepthStencilImage parameter, const VkImageSubresourceRange* pRanges, is null pointer"); |
| 7483 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7484 | } |
| 7485 | if(pRanges->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7486 | pRanges->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7487 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7488 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7489 | "vkCmdClearDepthStencilImage parameter, VkImageAspect pRanges->aspect, is unrecognized enumerator"); |
| 7490 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7491 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7492 | |
| 7493 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7494 | } |
| 7495 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7496 | bool PostCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7497 | VkCmdBuffer cmdBuffer, |
| 7498 | VkImage image, |
| 7499 | VkImageLayout imageLayout, |
| 7500 | float depth, |
| 7501 | uint32_t stencil, |
| 7502 | uint32_t rangeCount) |
| 7503 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7504 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7505 | |
| 7506 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7507 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7508 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7509 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7510 | "vkCmdClearDepthStencilImage parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7511 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7512 | } |
| 7513 | |
| 7514 | |
| 7515 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7516 | |
| 7517 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7518 | } |
| 7519 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7520 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7521 | VkCmdBuffer cmdBuffer, |
| 7522 | VkImage image, |
| 7523 | VkImageLayout imageLayout, |
| 7524 | float depth, |
| 7525 | uint32_t stencil, |
| 7526 | uint32_t rangeCount, |
| 7527 | const VkImageSubresourceRange* pRanges) |
| 7528 | { |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7529 | PreCmdClearDepthStencilImage(cmdBuffer, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7530 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7531 | 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] | 7532 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7533 | PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7534 | } |
| 7535 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7536 | bool PreCmdClearColorAttachment( |
| 7537 | VkCmdBuffer cmdBuffer, |
| 7538 | const VkClearColorValue* pColor, |
| 7539 | const VkRect3D* pRects) |
| 7540 | { |
| 7541 | if(pColor == nullptr) |
| 7542 | { |
| 7543 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7544 | "vkCmdClearColorAttachment parameter, const VkClearColorValue* pColor, is null pointer"); |
| 7545 | return false; |
| 7546 | } |
| 7547 | |
| 7548 | if(pRects == nullptr) |
| 7549 | { |
| 7550 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7551 | "vkCmdClearColorAttachment parameter, const VkRect3D* pRects, is null pointer"); |
| 7552 | return false; |
| 7553 | } |
| 7554 | |
| 7555 | return true; |
| 7556 | } |
| 7557 | |
| 7558 | bool PostCmdClearColorAttachment( |
| 7559 | VkCmdBuffer cmdBuffer, |
| 7560 | uint32_t colorAttachment, |
| 7561 | VkImageLayout imageLayout, |
| 7562 | uint32_t rectCount) |
| 7563 | { |
| 7564 | |
| 7565 | |
| 7566 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7567 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7568 | { |
| 7569 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7570 | "vkCmdClearColorAttachment parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7571 | return false; |
| 7572 | } |
| 7573 | |
| 7574 | |
| 7575 | return true; |
| 7576 | } |
| 7577 | |
| 7578 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorAttachment( |
| 7579 | VkCmdBuffer cmdBuffer, |
| 7580 | uint32_t colorAttachment, |
| 7581 | VkImageLayout imageLayout, |
| 7582 | const VkClearColorValue* pColor, |
| 7583 | uint32_t rectCount, |
| 7584 | const VkRect3D* pRects) |
| 7585 | { |
| 7586 | PreCmdClearColorAttachment(cmdBuffer, pColor, pRects); |
| 7587 | |
| 7588 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects); |
| 7589 | |
| 7590 | PostCmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, rectCount); |
| 7591 | } |
| 7592 | |
| 7593 | bool PreCmdClearDepthStencilAttachment( |
| 7594 | VkCmdBuffer cmdBuffer, |
| 7595 | const VkRect3D* pRects) |
| 7596 | { |
| 7597 | if(pRects == nullptr) |
| 7598 | { |
| 7599 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7600 | "vkCmdClearDepthStencilAttachment parameter, const VkRect3D* pRects, is null pointer"); |
| 7601 | return false; |
| 7602 | } |
| 7603 | |
| 7604 | return true; |
| 7605 | } |
| 7606 | |
| 7607 | bool PostCmdClearDepthStencilAttachment( |
| 7608 | VkCmdBuffer cmdBuffer, |
| 7609 | VkImageAspectFlags imageAspectMask, |
| 7610 | VkImageLayout imageLayout, |
| 7611 | float depth, |
| 7612 | uint32_t stencil, |
| 7613 | uint32_t rectCount) |
| 7614 | { |
| 7615 | |
| 7616 | if(!ValidateEnumerator((VkImageAspectFlagBits)imageAspectMask)) |
| 7617 | { |
| 7618 | std::string reason = "vkCmdClearDepthStencilAttachment parameter, VkImageAspectFlags imageAspectMask, is " + EnumeratorString((VkImageAspectFlagBits)imageAspectMask); |
| 7619 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 7620 | return false; |
| 7621 | } |
| 7622 | |
| 7623 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7624 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7625 | { |
| 7626 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7627 | "vkCmdClearDepthStencilAttachment parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7628 | return false; |
| 7629 | } |
| 7630 | |
| 7631 | |
| 7632 | |
| 7633 | |
| 7634 | return true; |
| 7635 | } |
| 7636 | |
| 7637 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment( |
| 7638 | VkCmdBuffer cmdBuffer, |
| 7639 | VkImageAspectFlags imageAspectMask, |
| 7640 | VkImageLayout imageLayout, |
| 7641 | float depth, |
| 7642 | uint32_t stencil, |
| 7643 | uint32_t rectCount, |
| 7644 | const VkRect3D* pRects) |
| 7645 | { |
| 7646 | PreCmdClearDepthStencilAttachment(cmdBuffer, pRects); |
| 7647 | |
| 7648 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects); |
| 7649 | |
| 7650 | PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount); |
| 7651 | } |
| 7652 | |
| 7653 | bool PreCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7654 | VkCmdBuffer cmdBuffer, |
| 7655 | const VkImageResolve* pRegions) |
| 7656 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7657 | if(pRegions == nullptr) |
| 7658 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7659 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7660 | "vkCmdResolveImage parameter, const VkImageResolve* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7661 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7662 | } |
| 7663 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7664 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7665 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7666 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7667 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7668 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7669 | } |
| 7670 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7671 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7672 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7673 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7674 | "vkCmdResolveImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7675 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7676 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7677 | |
| 7678 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7679 | } |
| 7680 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7681 | bool PostCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7682 | VkCmdBuffer cmdBuffer, |
| 7683 | VkImage srcImage, |
| 7684 | VkImageLayout srcImageLayout, |
| 7685 | VkImage destImage, |
| 7686 | VkImageLayout destImageLayout, |
| 7687 | uint32_t regionCount) |
| 7688 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7689 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7690 | |
| 7691 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7692 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7693 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7694 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7695 | "vkCmdResolveImage parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7696 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7697 | } |
| 7698 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7699 | |
| 7700 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7701 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7702 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7703 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7704 | "vkCmdResolveImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7705 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7706 | } |
| 7707 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7708 | |
| 7709 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7710 | } |
| 7711 | |
| 7712 | VK_LAYER_EXPORT void VKAPI vkCmdResolveImage( |
| 7713 | VkCmdBuffer cmdBuffer, |
| 7714 | VkImage srcImage, |
| 7715 | VkImageLayout srcImageLayout, |
| 7716 | VkImage destImage, |
| 7717 | VkImageLayout destImageLayout, |
| 7718 | uint32_t regionCount, |
| 7719 | const VkImageResolve* pRegions) |
| 7720 | { |
| 7721 | PreCmdResolveImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7722 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7723 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 7724 | |
| 7725 | PostCmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 7726 | } |
| 7727 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7728 | bool PostCmdSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7729 | VkCmdBuffer cmdBuffer, |
| 7730 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7731 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7732 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7733 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7734 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7735 | |
| 7736 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7737 | } |
| 7738 | |
| 7739 | VK_LAYER_EXPORT void VKAPI vkCmdSetEvent( |
| 7740 | VkCmdBuffer cmdBuffer, |
| 7741 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7742 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7743 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7744 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7745 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7746 | PostCmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7747 | } |
| 7748 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7749 | bool PostCmdResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7750 | VkCmdBuffer cmdBuffer, |
| 7751 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7752 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7753 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7754 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7755 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7756 | |
| 7757 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7758 | } |
| 7759 | |
| 7760 | VK_LAYER_EXPORT void VKAPI vkCmdResetEvent( |
| 7761 | VkCmdBuffer cmdBuffer, |
| 7762 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7763 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7764 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7765 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7766 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7767 | PostCmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7768 | } |
| 7769 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7770 | bool PreCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7771 | VkCmdBuffer cmdBuffer, |
| 7772 | const VkEvent* pEvents, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 7773 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7774 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7775 | if(pEvents == nullptr) |
| 7776 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7777 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7778 | "vkCmdWaitEvents parameter, const VkEvent* pEvents, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7779 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7780 | } |
| 7781 | |
| 7782 | if(ppMemBarriers == nullptr) |
| 7783 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7784 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7785 | "vkCmdWaitEvents parameter, const void** ppMemBarriers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7786 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7787 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7788 | |
| 7789 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7790 | } |
| 7791 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7792 | bool PostCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7793 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7794 | uint32_t eventCount, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7795 | VkPipelineStageFlags sourceStageMask, |
| 7796 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7797 | uint32_t memBarrierCount) |
| 7798 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7799 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7800 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7801 | |
| 7802 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7803 | |
| 7804 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7805 | } |
| 7806 | |
| 7807 | VK_LAYER_EXPORT void VKAPI vkCmdWaitEvents( |
| 7808 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7809 | uint32_t eventCount, |
| 7810 | const VkEvent* pEvents, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7811 | VkPipelineStageFlags sourceStageMask, |
| 7812 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7813 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 7814 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7815 | { |
| 7816 | PreCmdWaitEvents(cmdBuffer, pEvents, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7817 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7818 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWaitEvents(cmdBuffer, eventCount, pEvents, sourceStageMask, destStageMask, memBarrierCount, ppMemBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7819 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7820 | PostCmdWaitEvents(cmdBuffer, eventCount, sourceStageMask, destStageMask, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7821 | } |
| 7822 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7823 | bool PreCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7824 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7825 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7826 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7827 | if(ppMemBarriers == nullptr) |
| 7828 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7829 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7830 | "vkCmdPipelineBarrier parameter, const void** ppMemBarriers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7831 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7832 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7833 | |
| 7834 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7835 | } |
| 7836 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7837 | bool PostCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7838 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7839 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7840 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7841 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7842 | uint32_t memBarrierCount) |
| 7843 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7844 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7845 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7846 | |
| 7847 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7848 | |
| 7849 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7850 | } |
| 7851 | |
| 7852 | VK_LAYER_EXPORT void VKAPI vkCmdPipelineBarrier( |
| 7853 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7854 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7855 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7856 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7857 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7858 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7859 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7860 | PreCmdPipelineBarrier(cmdBuffer, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7861 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7862 | 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] | 7863 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7864 | PostCmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7865 | } |
| 7866 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7867 | bool PostCmdBeginQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7868 | VkCmdBuffer cmdBuffer, |
| 7869 | VkQueryPool queryPool, |
| 7870 | uint32_t slot, |
| 7871 | VkQueryControlFlags flags) |
| 7872 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7873 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7874 | |
| 7875 | |
| 7876 | if(!ValidateEnumerator((VkQueryControlFlagBits)flags)) |
| 7877 | { |
| 7878 | std::string reason = "vkCmdBeginQuery parameter, VkQueryControlFlags flags, is " + EnumeratorString((VkQueryControlFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7879 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 7880 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7881 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7882 | |
| 7883 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7884 | } |
| 7885 | |
| 7886 | VK_LAYER_EXPORT void VKAPI vkCmdBeginQuery( |
| 7887 | VkCmdBuffer cmdBuffer, |
| 7888 | VkQueryPool queryPool, |
| 7889 | uint32_t slot, |
| 7890 | VkQueryControlFlags flags) |
| 7891 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7892 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7893 | |
| 7894 | PostCmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7895 | } |
| 7896 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7897 | bool PostCmdEndQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7898 | VkCmdBuffer cmdBuffer, |
| 7899 | VkQueryPool queryPool, |
| 7900 | uint32_t slot) |
| 7901 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7902 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7903 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7904 | |
| 7905 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7906 | } |
| 7907 | |
| 7908 | VK_LAYER_EXPORT void VKAPI vkCmdEndQuery( |
| 7909 | VkCmdBuffer cmdBuffer, |
| 7910 | VkQueryPool queryPool, |
| 7911 | uint32_t slot) |
| 7912 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7913 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndQuery(cmdBuffer, queryPool, slot); |
| 7914 | |
| 7915 | PostCmdEndQuery(cmdBuffer, queryPool, slot); |
| 7916 | } |
| 7917 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7918 | bool PostCmdResetQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7919 | VkCmdBuffer cmdBuffer, |
| 7920 | VkQueryPool queryPool, |
| 7921 | uint32_t startQuery, |
| 7922 | uint32_t queryCount) |
| 7923 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7924 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7925 | |
| 7926 | |
| 7927 | |
| 7928 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7929 | } |
| 7930 | |
| 7931 | VK_LAYER_EXPORT void VKAPI vkCmdResetQueryPool( |
| 7932 | VkCmdBuffer cmdBuffer, |
| 7933 | VkQueryPool queryPool, |
| 7934 | uint32_t startQuery, |
| 7935 | uint32_t queryCount) |
| 7936 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7937 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 7938 | |
| 7939 | PostCmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 7940 | } |
| 7941 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7942 | bool PostCmdWriteTimestamp( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7943 | VkCmdBuffer cmdBuffer, |
| 7944 | VkTimestampType timestampType, |
| 7945 | VkBuffer destBuffer, |
| 7946 | VkDeviceSize destOffset) |
| 7947 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7948 | |
| 7949 | if(timestampType < VK_TIMESTAMP_TYPE_BEGIN_RANGE || |
| 7950 | timestampType > VK_TIMESTAMP_TYPE_END_RANGE) |
| 7951 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7952 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7953 | "vkCmdWriteTimestamp parameter, VkTimestampType timestampType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7954 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7955 | } |
| 7956 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7957 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7958 | |
| 7959 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7960 | } |
| 7961 | |
| 7962 | VK_LAYER_EXPORT void VKAPI vkCmdWriteTimestamp( |
| 7963 | VkCmdBuffer cmdBuffer, |
| 7964 | VkTimestampType timestampType, |
| 7965 | VkBuffer destBuffer, |
| 7966 | VkDeviceSize destOffset) |
| 7967 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7968 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 7969 | |
| 7970 | PostCmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 7971 | } |
| 7972 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7973 | bool PostCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7974 | VkCmdBuffer cmdBuffer, |
| 7975 | VkQueryPool queryPool, |
| 7976 | uint32_t startQuery, |
| 7977 | uint32_t queryCount, |
| 7978 | VkBuffer destBuffer, |
| 7979 | VkDeviceSize destOffset, |
| 7980 | VkDeviceSize destStride, |
| 7981 | VkQueryResultFlags flags) |
| 7982 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7983 | |
| 7984 | |
| 7985 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7986 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7987 | |
| 7988 | |
| 7989 | |
| 7990 | if(!ValidateEnumerator((VkQueryResultFlagBits)flags)) |
| 7991 | { |
| 7992 | std::string reason = "vkCmdCopyQueryPoolResults parameter, VkQueryResultFlags flags, is " + EnumeratorString((VkQueryResultFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7993 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 7994 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7995 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7996 | |
| 7997 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7998 | } |
| 7999 | |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8000 | VK_LAYER_EXPORT void VKAPI vkCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8001 | VkCmdBuffer cmdBuffer, |
| 8002 | VkQueryPool queryPool, |
| 8003 | uint32_t startQuery, |
| 8004 | uint32_t queryCount, |
| 8005 | VkBuffer destBuffer, |
| 8006 | VkDeviceSize destOffset, |
| 8007 | VkDeviceSize destStride, |
| 8008 | VkQueryResultFlags flags) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8009 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8010 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
| 8011 | |
| 8012 | PostCmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8013 | } |
| 8014 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8015 | bool PreCreateFramebuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8016 | VkDevice device, |
| 8017 | const VkFramebufferCreateInfo* pCreateInfo) |
| 8018 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8019 | if(pCreateInfo == nullptr) |
| 8020 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8021 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8022 | "vkCreateFramebuffer parameter, const VkFramebufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8023 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8024 | } |
| 8025 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 8026 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 8027 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8028 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8029 | "vkCreateFramebuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8030 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8031 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8032 | if(pCreateInfo->pAttachments == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8033 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8034 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8035 | "vkCreateFramebuffer parameter, const VkAttachmentBindInfo* pCreateInfo->pAttachments, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8036 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8037 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8038 | if(pCreateInfo->pAttachments->view.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8039 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8040 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8041 | "vkCreateFramebuffer parameter, VkAttachmentView pCreateInfo->pAttachments->view, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8042 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8043 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8044 | if(pCreateInfo->pAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 8045 | pCreateInfo->pAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8046 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8047 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8048 | "vkCreateFramebuffer parameter, VkImageLayout pCreateInfo->pAttachments->layout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8049 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8050 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8051 | |
| 8052 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8053 | } |
| 8054 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8055 | bool PostCreateFramebuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8056 | VkDevice device, |
| 8057 | VkFramebuffer* pFramebuffer, |
| 8058 | VkResult result) |
| 8059 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8060 | |
| 8061 | if(pFramebuffer == nullptr) |
| 8062 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8063 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8064 | "vkCreateFramebuffer parameter, VkFramebuffer* pFramebuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8065 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8066 | } |
| 8067 | |
| 8068 | if(result != VK_SUCCESS) |
| 8069 | { |
| 8070 | std::string reason = "vkCreateFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8071 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8072 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8073 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8074 | |
| 8075 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8076 | } |
| 8077 | |
| 8078 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFramebuffer( |
| 8079 | VkDevice device, |
| 8080 | const VkFramebufferCreateInfo* pCreateInfo, |
| 8081 | VkFramebuffer* pFramebuffer) |
| 8082 | { |
| 8083 | PreCreateFramebuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8084 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8085 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pFramebuffer); |
| 8086 | |
| 8087 | PostCreateFramebuffer(device, pFramebuffer, result); |
| 8088 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8089 | return result; |
| 8090 | } |
| 8091 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8092 | bool PostDestroyFramebuffer( |
| 8093 | VkDevice device, |
| 8094 | VkFramebuffer framebuffer, |
| 8095 | VkResult result) |
| 8096 | { |
| 8097 | |
| 8098 | if(result != VK_SUCCESS) |
| 8099 | { |
| 8100 | std::string reason = "vkDestroyFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 8101 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8102 | return false; |
| 8103 | } |
| 8104 | |
| 8105 | return true; |
| 8106 | } |
| 8107 | |
| 8108 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyFramebuffer( |
| 8109 | VkDevice device, |
| 8110 | VkFramebuffer framebuffer) |
| 8111 | { |
| 8112 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyFramebuffer(device, framebuffer); |
| 8113 | |
| 8114 | PostDestroyFramebuffer(device, framebuffer, result); |
| 8115 | |
| 8116 | return result; |
| 8117 | } |
| 8118 | |
| 8119 | bool PreCreateRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8120 | VkDevice device, |
| 8121 | const VkRenderPassCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8122 | { |
| 8123 | if(pCreateInfo == nullptr) |
| 8124 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8125 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8126 | "vkCreateRenderPass parameter, const VkRenderPassCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8127 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8128 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8129 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 8130 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8131 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8132 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8133 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8134 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8135 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8136 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8137 | for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8138 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8139 | const VkAttachmentDescription *att = &pCreateInfo->pAttachments[i]; |
| 8140 | |
| 8141 | if(att->format < VK_FORMAT_BEGIN_RANGE || att->format > VK_FORMAT_END_RANGE) |
| 8142 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8143 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8144 | "vkCreateRenderPass parameter, VkFormat in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8145 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8146 | } |
| 8147 | if(att->initialLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || att->initialLayout > VK_IMAGE_LAYOUT_END_RANGE || |
| 8148 | att->finalLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || att->finalLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 8149 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8150 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8151 | "vkCreateRenderPass parameter, VkImageLayout in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8152 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8153 | } |
| 8154 | if(att->loadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || att->loadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 8155 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8156 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8157 | "vkCreateRenderPass parameter, VkAttachmentLoadOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8158 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8159 | } |
| 8160 | if(att->storeOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || att->storeOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 8161 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8162 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8163 | "vkCreateRenderPass parameter, VkAttachmentStoreOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8164 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8165 | } |
| 8166 | if(att->stencilLoadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || att->stencilLoadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 8167 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8168 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8169 | "vkCreateRenderPass parameter, VkAttachmentLoadOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8170 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8171 | } |
| 8172 | if(att->stencilStoreOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || att->stencilStoreOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 8173 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8174 | log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8175 | "vkCreateRenderPass parameter, VkAttachmentStoreOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8176 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8177 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8178 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8179 | |
| 8180 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8181 | } |
| 8182 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8183 | bool PostCreateRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8184 | VkDevice device, |
| 8185 | VkRenderPass* pRenderPass, |
| 8186 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8187 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8188 | |
| 8189 | if(pRenderPass == nullptr) |
| 8190 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8191 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8192 | "vkCreateRenderPass parameter, VkRenderPass* pRenderPass, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8193 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8194 | } |
| 8195 | |
| 8196 | if(result != VK_SUCCESS) |
| 8197 | { |
| 8198 | std::string reason = "vkCreateRenderPass parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8199 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8200 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8201 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8202 | |
| 8203 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8204 | } |
| 8205 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8206 | VK_LAYER_EXPORT VkResult VKAPI vkCreateRenderPass( |
| 8207 | VkDevice device, |
| 8208 | const VkRenderPassCreateInfo* pCreateInfo, |
| 8209 | VkRenderPass* pRenderPass) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8210 | { |
| 8211 | PreCreateRenderPass(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8212 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8213 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pRenderPass); |
| 8214 | |
| 8215 | PostCreateRenderPass(device, pRenderPass, result); |
| 8216 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8217 | return result; |
| 8218 | } |
| 8219 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8220 | bool PreCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8221 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8222 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8223 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8224 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8225 | if(pRenderPassBegin == nullptr) |
| 8226 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8227 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8228 | "vkCmdBeginRenderPass parameter, const VkRenderPassBegin* pRenderPassBegin, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8229 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 8230 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8231 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 8232 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8233 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8234 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 8235 | "vkCmdBeginRenderPass parameter, VkRenderPassContents pRenderPassBegin->contents, is unrecognized enumerator"); |
| 8236 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 8237 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8238 | |
| 8239 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8240 | } |
| 8241 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8242 | bool PostCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8243 | VkCmdBuffer cmdBuffer) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8244 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8245 | |
| 8246 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8247 | } |
| 8248 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8249 | VK_LAYER_EXPORT void VKAPI vkCmdBeginRenderPass( |
| 8250 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8251 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8252 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8253 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8254 | PreCmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
| 8255 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8256 | |
| 8257 | PostCmdBeginRenderPass(cmdBuffer); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8258 | } |
| 8259 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8260 | void PreCmdNextSubpass( |
| 8261 | VkCmdBuffer cmdBuffer, |
| 8262 | VkRenderPassContents contents) |
| 8263 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8264 | |
| 8265 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 8266 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8267 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8268 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 8269 | "vkCmdBeginRenderPass parameter, VkRenderPassContents pRenderPassBegin->contents, is unrecognized enumerator"); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8270 | return; |
| 8271 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8272 | |
| 8273 | return; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8274 | } |
| 8275 | |
| 8276 | void PostCmdNextSubpass( |
| 8277 | VkCmdBuffer cmdBuffer) |
| 8278 | { |
| 8279 | if(cmdBuffer == nullptr) |
| 8280 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8281 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8282 | "vkCmdNextSubpass parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
| 8283 | return; |
| 8284 | } |
| 8285 | } |
| 8286 | |
| 8287 | VK_LAYER_EXPORT void VKAPI vkCmdNextSubpass( |
| 8288 | VkCmdBuffer cmdBuffer, |
| 8289 | VkRenderPassContents contents) |
| 8290 | { |
| 8291 | PreCmdNextSubpass(cmdBuffer, contents); |
| 8292 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdNextSubpass(cmdBuffer, contents); |
| 8293 | |
| 8294 | PostCmdNextSubpass(cmdBuffer); |
| 8295 | } |
| 8296 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8297 | bool PreCmdExecuteCommands( |
| 8298 | VkCmdBuffer cmdBuffer, |
| 8299 | const VkCmdBuffer* pCmdBuffers) |
| 8300 | { |
| 8301 | if(pCmdBuffers == nullptr) |
| 8302 | { |
| 8303 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 346583c | 2015-07-13 15:21:40 -0600 | [diff] [blame^] | 8304 | "vkCmdExecuteCommands parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8305 | return false; |
| 8306 | } |
| 8307 | |
| 8308 | return true; |
| 8309 | } |
| 8310 | |
| 8311 | bool PostCmdExecuteCommands( |
| 8312 | VkCmdBuffer cmdBuffer, |
| 8313 | uint32_t cmdBuffersCount) |
| 8314 | { |
| 8315 | |
| 8316 | |
| 8317 | return true; |
| 8318 | } |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8319 | void PreCmdExecuteCommands( |
| 8320 | VkCmdBuffer cmdBuffer) |
| 8321 | { |
| 8322 | if(cmdBuffer == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8323 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8324 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8325 | "vkCmdExecuteCommands parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
| 8326 | return; |
| 8327 | } |
| 8328 | } |
| 8329 | |
| 8330 | void PostCmdExecuteCommands( |
| 8331 | VkCmdBuffer cmdBuffer) |
| 8332 | { |
| 8333 | if(cmdBuffer == nullptr) |
| 8334 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8335 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8336 | "vkCmdExecuteCommands parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8337 | return; |
| 8338 | } |
Chia-I Wu | f869338 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 8339 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8340 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8341 | VK_LAYER_EXPORT void VKAPI vkCmdExecuteCommands( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8342 | VkCmdBuffer cmdBuffer, |
| 8343 | uint32_t cmdBuffersCount, |
| 8344 | const VkCmdBuffer* pCmdBuffers) |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8345 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8346 | PreCmdExecuteCommands(cmdBuffer, pCmdBuffers); |
| 8347 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8348 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers); |
| 8349 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8350 | PostCmdExecuteCommands(cmdBuffer, cmdBuffersCount); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8351 | } |
| 8352 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8353 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr(VkDevice device, const char* funcName) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8354 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8355 | if (device == NULL) { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8356 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8357 | } |
| 8358 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8359 | /* loader uses this to force layer initialization; device object is wrapped */ |
| 8360 | if (!strcmp(funcName, "vkGetDeviceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8361 | initDeviceTable(pc_device_table_map, (const VkBaseLayerObject *) device); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8362 | return (PFN_vkVoidFunction) vkGetDeviceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8363 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8364 | |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 8365 | if (!strcmp(funcName, "vkCreateDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8366 | return (PFN_vkVoidFunction) vkCreateDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8367 | if (!strcmp(funcName, "vkDestroyDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8368 | return (PFN_vkVoidFunction) vkDestroyDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8369 | if (!strcmp(funcName, "vkGetDeviceQueue")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8370 | return (PFN_vkVoidFunction) vkGetDeviceQueue; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8371 | if (!strcmp(funcName, "vkQueueSubmit")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8372 | return (PFN_vkVoidFunction) vkQueueSubmit; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8373 | if (!strcmp(funcName, "vkQueueWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8374 | return (PFN_vkVoidFunction) vkQueueWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8375 | if (!strcmp(funcName, "vkDeviceWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8376 | return (PFN_vkVoidFunction) vkDeviceWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8377 | if (!strcmp(funcName, "vkAllocMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8378 | return (PFN_vkVoidFunction) vkAllocMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8379 | if (!strcmp(funcName, "vkFreeMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8380 | return (PFN_vkVoidFunction) vkFreeMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8381 | if (!strcmp(funcName, "vkMapMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8382 | return (PFN_vkVoidFunction) vkMapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8383 | if (!strcmp(funcName, "vkUnmapMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8384 | return (PFN_vkVoidFunction) vkUnmapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8385 | if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8386 | return (PFN_vkVoidFunction) vkFlushMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8387 | if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8388 | return (PFN_vkVoidFunction) vkInvalidateMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8389 | if (!strcmp(funcName, "vkCreateFence")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8390 | return (PFN_vkVoidFunction) vkCreateFence; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8391 | if (!strcmp(funcName, "vkResetFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8392 | return (PFN_vkVoidFunction) vkResetFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8393 | if (!strcmp(funcName, "vkGetFenceStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8394 | return (PFN_vkVoidFunction) vkGetFenceStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8395 | if (!strcmp(funcName, "vkWaitForFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8396 | return (PFN_vkVoidFunction) vkWaitForFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8397 | if (!strcmp(funcName, "vkCreateSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8398 | return (PFN_vkVoidFunction) vkCreateSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8399 | if (!strcmp(funcName, "vkQueueSignalSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8400 | return (PFN_vkVoidFunction) vkQueueSignalSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8401 | if (!strcmp(funcName, "vkQueueWaitSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8402 | return (PFN_vkVoidFunction) vkQueueWaitSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8403 | if (!strcmp(funcName, "vkCreateEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8404 | return (PFN_vkVoidFunction) vkCreateEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8405 | if (!strcmp(funcName, "vkGetEventStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8406 | return (PFN_vkVoidFunction) vkGetEventStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8407 | if (!strcmp(funcName, "vkSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8408 | return (PFN_vkVoidFunction) vkSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8409 | if (!strcmp(funcName, "vkResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8410 | return (PFN_vkVoidFunction) vkResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8411 | if (!strcmp(funcName, "vkCreateQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8412 | return (PFN_vkVoidFunction) vkCreateQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8413 | if (!strcmp(funcName, "vkGetQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8414 | return (PFN_vkVoidFunction) vkGetQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8415 | if (!strcmp(funcName, "vkCreateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8416 | return (PFN_vkVoidFunction) vkCreateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8417 | if (!strcmp(funcName, "vkCreateBufferView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8418 | return (PFN_vkVoidFunction) vkCreateBufferView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8419 | if (!strcmp(funcName, "vkCreateImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8420 | return (PFN_vkVoidFunction) vkCreateImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8421 | if (!strcmp(funcName, "vkGetImageSubresourceLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8422 | return (PFN_vkVoidFunction) vkGetImageSubresourceLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8423 | if (!strcmp(funcName, "vkCreateImageView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8424 | return (PFN_vkVoidFunction) vkCreateImageView; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8425 | if (!strcmp(funcName, "vkCreateAttachmentView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8426 | return (PFN_vkVoidFunction) vkCreateAttachmentView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8427 | if (!strcmp(funcName, "vkCreateShader")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8428 | return (PFN_vkVoidFunction) vkCreateShader; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 8429 | if (!strcmp(funcName, "vkCreateGraphicsPipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8430 | return (PFN_vkVoidFunction) vkCreateGraphicsPipelines; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 8431 | if (!strcmp(funcName, "vkCreateComputePipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8432 | return (PFN_vkVoidFunction) vkCreateComputePipelines; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8433 | if (!strcmp(funcName, "vkCreatePipelineLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8434 | return (PFN_vkVoidFunction) vkCreatePipelineLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8435 | if (!strcmp(funcName, "vkCreateSampler")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8436 | return (PFN_vkVoidFunction) vkCreateSampler; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8437 | if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8438 | return (PFN_vkVoidFunction) vkCreateDescriptorSetLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8439 | if (!strcmp(funcName, "vkCreateDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8440 | return (PFN_vkVoidFunction) vkCreateDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8441 | if (!strcmp(funcName, "vkResetDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8442 | return (PFN_vkVoidFunction) vkResetDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8443 | if (!strcmp(funcName, "vkAllocDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8444 | return (PFN_vkVoidFunction) vkAllocDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8445 | if (!strcmp(funcName, "vkCreateDynamicViewportState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8446 | return (PFN_vkVoidFunction) vkCreateDynamicViewportState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8447 | if (!strcmp(funcName, "vkCreateDynamicRasterState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8448 | return (PFN_vkVoidFunction) vkCreateDynamicRasterState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8449 | if (!strcmp(funcName, "vkCreateDynamicColorBlendState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8450 | return (PFN_vkVoidFunction) vkCreateDynamicColorBlendState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8451 | if (!strcmp(funcName, "vkCreateDynamicDepthStencilState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8452 | return (PFN_vkVoidFunction) vkCreateDynamicDepthStencilState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8453 | if (!strcmp(funcName, "vkCreateCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8454 | return (PFN_vkVoidFunction) vkCreateCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8455 | if (!strcmp(funcName, "vkBeginCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8456 | return (PFN_vkVoidFunction) vkBeginCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8457 | if (!strcmp(funcName, "vkEndCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8458 | return (PFN_vkVoidFunction) vkEndCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8459 | if (!strcmp(funcName, "vkResetCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8460 | return (PFN_vkVoidFunction) vkResetCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8461 | if (!strcmp(funcName, "vkCmdBindPipeline")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8462 | return (PFN_vkVoidFunction) vkCmdBindPipeline; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8463 | if (!strcmp(funcName, "vkCmdBindDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8464 | return (PFN_vkVoidFunction) vkCmdBindDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8465 | if (!strcmp(funcName, "vkCmdBindVertexBuffers")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8466 | return (PFN_vkVoidFunction) vkCmdBindVertexBuffers; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8467 | if (!strcmp(funcName, "vkCmdBindIndexBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8468 | return (PFN_vkVoidFunction) vkCmdBindIndexBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8469 | if (!strcmp(funcName, "vkCmdDraw")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8470 | return (PFN_vkVoidFunction) vkCmdDraw; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8471 | if (!strcmp(funcName, "vkCmdDrawIndexed")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8472 | return (PFN_vkVoidFunction) vkCmdDrawIndexed; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8473 | if (!strcmp(funcName, "vkCmdDrawIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8474 | return (PFN_vkVoidFunction) vkCmdDrawIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8475 | if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8476 | return (PFN_vkVoidFunction) vkCmdDrawIndexedIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8477 | if (!strcmp(funcName, "vkCmdDispatch")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8478 | return (PFN_vkVoidFunction) vkCmdDispatch; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8479 | if (!strcmp(funcName, "vkCmdDispatchIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8480 | return (PFN_vkVoidFunction) vkCmdDispatchIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8481 | if (!strcmp(funcName, "vkCmdCopyBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8482 | return (PFN_vkVoidFunction) vkCmdCopyBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8483 | if (!strcmp(funcName, "vkCmdCopyImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8484 | return (PFN_vkVoidFunction) vkCmdCopyImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8485 | if (!strcmp(funcName, "vkCmdBlitImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8486 | return (PFN_vkVoidFunction) vkCmdBlitImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8487 | if (!strcmp(funcName, "vkCmdCopyBufferToImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8488 | return (PFN_vkVoidFunction) vkCmdCopyBufferToImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8489 | if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8490 | return (PFN_vkVoidFunction) vkCmdCopyImageToBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8491 | if (!strcmp(funcName, "vkCmdUpdateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8492 | return (PFN_vkVoidFunction) vkCmdUpdateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8493 | if (!strcmp(funcName, "vkCmdFillBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8494 | return (PFN_vkVoidFunction) vkCmdFillBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8495 | if (!strcmp(funcName, "vkCmdClearColorImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8496 | return (PFN_vkVoidFunction) vkCmdClearColorImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8497 | if (!strcmp(funcName, "vkCmdResolveImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8498 | return (PFN_vkVoidFunction) vkCmdResolveImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8499 | if (!strcmp(funcName, "vkCmdSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8500 | return (PFN_vkVoidFunction) vkCmdSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8501 | if (!strcmp(funcName, "vkCmdResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8502 | return (PFN_vkVoidFunction) vkCmdResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8503 | if (!strcmp(funcName, "vkCmdWaitEvents")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8504 | return (PFN_vkVoidFunction) vkCmdWaitEvents; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8505 | if (!strcmp(funcName, "vkCmdPipelineBarrier")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8506 | return (PFN_vkVoidFunction) vkCmdPipelineBarrier; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8507 | if (!strcmp(funcName, "vkCmdBeginQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8508 | return (PFN_vkVoidFunction) vkCmdBeginQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8509 | if (!strcmp(funcName, "vkCmdEndQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8510 | return (PFN_vkVoidFunction) vkCmdEndQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8511 | if (!strcmp(funcName, "vkCmdResetQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8512 | return (PFN_vkVoidFunction) vkCmdResetQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8513 | if (!strcmp(funcName, "vkCmdWriteTimestamp")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8514 | return (PFN_vkVoidFunction) vkCmdWriteTimestamp; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8515 | if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8516 | return (PFN_vkVoidFunction) vkCmdCopyQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8517 | if (!strcmp(funcName, "vkCreateFramebuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8518 | return (PFN_vkVoidFunction) vkCreateFramebuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8519 | if (!strcmp(funcName, "vkCreateRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8520 | return (PFN_vkVoidFunction) vkCreateRenderPass; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8521 | if (!strcmp(funcName, "vkCmdBeginRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8522 | return (PFN_vkVoidFunction) vkCmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8523 | if (!strcmp(funcName, "vkCmdNextSubpass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8524 | return (PFN_vkVoidFunction) vkCmdNextSubpass; |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 8525 | |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 8526 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8527 | if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8528 | return NULL; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8529 | return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8530 | } |
| 8531 | } |
| 8532 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8533 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetInstanceProcAddr(VkInstance instance, const char* funcName) |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8534 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8535 | if (instance == NULL) { |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8536 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8537 | } |
| 8538 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8539 | /* loader uses this to force layer initialization; instance object is wrapped */ |
| 8540 | if (!strcmp(funcName, "vkGetInstanceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8541 | initInstanceTable(pc_instance_table_map, (const VkBaseLayerObject *) instance); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8542 | return (PFN_vkVoidFunction) vkGetInstanceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8543 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8544 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8545 | if (!strcmp(funcName, "vkCreateInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8546 | return (PFN_vkVoidFunction) vkCreateInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8547 | if (!strcmp(funcName, "vkDestroyInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8548 | return (PFN_vkVoidFunction) vkDestroyInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8549 | if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8550 | return (PFN_vkVoidFunction) vkEnumeratePhysicalDevices; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8551 | if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8552 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8553 | if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8554 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 8555 | if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8556 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFormatProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8557 | if (!strcmp(funcName, "vkGetPhysicalDeviceLimits")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8558 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceLimits; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8559 | if (!strcmp(funcName, "vkGetGlobalLayerProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8560 | return (PFN_vkVoidFunction) vkGetGlobalLayerProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8561 | if (!strcmp(funcName, "vkGetGlobalExtensionProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8562 | return (PFN_vkVoidFunction) vkGetGlobalExtensionProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8563 | if (!strcmp(funcName, "vkGetPhysicalDeviceLayerProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8564 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceLayerProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8565 | if (!strcmp(funcName, "vkGetPhysicalDeviceExtensionProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8566 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 8567 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8568 | 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] | 8569 | 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] | 8570 | if(fptr) |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 8571 | return fptr; |
| 8572 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8573 | { |
| 8574 | if (get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr == NULL) |
| 8575 | return NULL; |
| 8576 | return get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr(instance, funcName); |
| 8577 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8578 | } |