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 | } |
| 221 | case VK_ERROR_INVALID_OBJECT_TYPE: |
| 222 | { |
| 223 | return "VK_ERROR_INVALID_OBJECT_TYPE"; |
| 224 | break; |
| 225 | } |
| 226 | case VK_ERROR_INVALID_QUEUE_TYPE: |
| 227 | { |
| 228 | return "VK_ERROR_INVALID_QUEUE_TYPE"; |
| 229 | break; |
| 230 | } |
| 231 | case VK_ERROR_BAD_SHADER_CODE: |
| 232 | { |
| 233 | return "VK_ERROR_BAD_SHADER_CODE"; |
| 234 | break; |
| 235 | } |
| 236 | case VK_ERROR_INVALID_IMAGE: |
| 237 | { |
| 238 | return "VK_ERROR_INVALID_IMAGE"; |
| 239 | break; |
| 240 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 241 | case VK_ERROR_INVALID_FORMAT: |
| 242 | { |
| 243 | return "VK_ERROR_INVALID_FORMAT"; |
| 244 | break; |
| 245 | } |
| 246 | case VK_ERROR_INCOMPLETE_COMMAND_BUFFER: |
| 247 | { |
| 248 | return "VK_ERROR_INCOMPLETE_COMMAND_BUFFER"; |
| 249 | break; |
| 250 | } |
| 251 | case VK_ERROR_INVALID_ALIGNMENT: |
| 252 | { |
| 253 | return "VK_ERROR_INVALID_ALIGNMENT"; |
| 254 | break; |
| 255 | } |
| 256 | case VK_ERROR_UNAVAILABLE: |
| 257 | { |
| 258 | return "VK_ERROR_UNAVAILABLE"; |
| 259 | break; |
| 260 | } |
| 261 | case VK_INCOMPLETE: |
| 262 | { |
| 263 | return "VK_INCOMPLETE"; |
| 264 | break; |
| 265 | } |
| 266 | case VK_ERROR_OUT_OF_HOST_MEMORY: |
| 267 | { |
| 268 | return "VK_ERROR_OUT_OF_HOST_MEMORY"; |
| 269 | break; |
| 270 | } |
| 271 | case VK_ERROR_UNKNOWN: |
| 272 | { |
| 273 | return "VK_ERROR_UNKNOWN"; |
| 274 | break; |
| 275 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 276 | case VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION: |
| 277 | { |
| 278 | return "VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION"; |
| 279 | break; |
| 280 | } |
| 281 | case VK_ERROR_INITIALIZATION_FAILED: |
| 282 | { |
| 283 | return "VK_ERROR_INITIALIZATION_FAILED"; |
| 284 | break; |
| 285 | } |
| 286 | case VK_NOT_READY: |
| 287 | { |
| 288 | return "VK_NOT_READY"; |
| 289 | break; |
| 290 | } |
| 291 | case VK_ERROR_INVALID_POINTER: |
| 292 | { |
| 293 | return "VK_ERROR_INVALID_POINTER"; |
| 294 | break; |
| 295 | } |
| 296 | case VK_ERROR_INVALID_VALUE: |
| 297 | { |
| 298 | return "VK_ERROR_INVALID_VALUE"; |
| 299 | break; |
| 300 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 301 | case VK_ERROR_NOT_MAPPABLE: |
| 302 | { |
| 303 | return "VK_ERROR_NOT_MAPPABLE"; |
| 304 | break; |
| 305 | } |
| 306 | case VK_ERROR_OUT_OF_DEVICE_MEMORY: |
| 307 | { |
| 308 | return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; |
| 309 | break; |
| 310 | } |
| 311 | case VK_EVENT_SET: |
| 312 | { |
| 313 | return "VK_EVENT_SET"; |
| 314 | break; |
| 315 | } |
| 316 | case VK_TIMEOUT: |
| 317 | { |
| 318 | return "VK_TIMEOUT"; |
| 319 | break; |
| 320 | } |
| 321 | case VK_ERROR_INVALID_FLAGS: |
| 322 | { |
| 323 | return "VK_ERROR_INVALID_FLAGS"; |
| 324 | break; |
| 325 | } |
| 326 | case VK_EVENT_RESET: |
| 327 | { |
| 328 | return "VK_EVENT_RESET"; |
| 329 | break; |
| 330 | } |
| 331 | case VK_ERROR_INVALID_DESCRIPTOR_SET_DATA: |
| 332 | { |
| 333 | return "VK_ERROR_INVALID_DESCRIPTOR_SET_DATA"; |
| 334 | break; |
| 335 | } |
| 336 | case VK_UNSUPPORTED: |
| 337 | { |
| 338 | return "VK_UNSUPPORTED"; |
| 339 | break; |
| 340 | } |
| 341 | case VK_ERROR_INVALID_HANDLE: |
| 342 | { |
| 343 | return "VK_ERROR_INVALID_HANDLE"; |
| 344 | break; |
| 345 | } |
| 346 | case VK_ERROR_INCOMPATIBLE_DEVICE: |
| 347 | { |
| 348 | return "VK_ERROR_INCOMPATIBLE_DEVICE"; |
| 349 | break; |
| 350 | } |
| 351 | case VK_SUCCESS: |
| 352 | { |
| 353 | return "VK_SUCCESS"; |
| 354 | break; |
| 355 | } |
| 356 | case VK_ERROR_INCOMPATIBLE_QUEUE: |
| 357 | { |
| 358 | return "VK_ERROR_INCOMPATIBLE_QUEUE"; |
| 359 | break; |
| 360 | } |
| 361 | case VK_ERROR_INVALID_EXTENSION: |
| 362 | { |
| 363 | return "VK_ERROR_INVALID_EXTENSION"; |
| 364 | break; |
| 365 | } |
| 366 | case VK_ERROR_DEVICE_ALREADY_CREATED: |
| 367 | { |
| 368 | return "VK_ERROR_DEVICE_ALREADY_CREATED"; |
| 369 | break; |
| 370 | } |
| 371 | case VK_ERROR_DEVICE_LOST: |
| 372 | { |
| 373 | return "VK_ERROR_DEVICE_LOST"; |
| 374 | break; |
| 375 | } |
| 376 | case VK_ERROR_INVALID_ORDINAL: |
| 377 | { |
| 378 | return "VK_ERROR_INVALID_ORDINAL"; |
| 379 | break; |
| 380 | } |
| 381 | case VK_ERROR_INVALID_MEMORY_SIZE: |
| 382 | { |
| 383 | return "VK_ERROR_INVALID_MEMORY_SIZE"; |
| 384 | break; |
| 385 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 386 | case VK_ERROR_INVALID_LAYER: |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 387 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 388 | return "VK_ERROR_INVALID_LAYER"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 389 | break; |
| 390 | } |
| 391 | default: |
| 392 | { |
| 393 | return "unrecognized enumerator"; |
| 394 | break; |
| 395 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 396 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 397 | } |
| 398 | |
| 399 | static |
| 400 | bool ValidateEnumerator(VkQueueFlagBits const& enumerator) |
| 401 | { |
| 402 | VkQueueFlagBits allFlags = (VkQueueFlagBits)(VK_QUEUE_EXTENDED_BIT | |
| 403 | VK_QUEUE_DMA_BIT | |
| 404 | VK_QUEUE_COMPUTE_BIT | |
| 405 | VK_QUEUE_SPARSE_MEMMGR_BIT | |
| 406 | VK_QUEUE_GRAPHICS_BIT); |
| 407 | if(enumerator & (~allFlags)) |
| 408 | { |
| 409 | return false; |
| 410 | } |
| 411 | |
| 412 | return true; |
| 413 | } |
| 414 | |
| 415 | static |
| 416 | std::string EnumeratorString(VkQueueFlagBits const& enumerator) |
| 417 | { |
| 418 | if(!ValidateEnumerator(enumerator)) |
| 419 | { |
| 420 | return "unrecognized enumerator"; |
| 421 | } |
| 422 | |
| 423 | std::vector<std::string> strings; |
| 424 | if(enumerator & VK_QUEUE_EXTENDED_BIT) |
| 425 | { |
| 426 | strings.push_back("VK_QUEUE_EXTENDED_BIT"); |
| 427 | } |
| 428 | if(enumerator & VK_QUEUE_DMA_BIT) |
| 429 | { |
| 430 | strings.push_back("VK_QUEUE_DMA_BIT"); |
| 431 | } |
| 432 | if(enumerator & VK_QUEUE_COMPUTE_BIT) |
| 433 | { |
| 434 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 435 | } |
| 436 | if(enumerator & VK_QUEUE_SPARSE_MEMMGR_BIT) |
| 437 | { |
| 438 | strings.push_back("VK_QUEUE_SPARSE_MEMMGR_BIT"); |
| 439 | } |
| 440 | if(enumerator & VK_QUEUE_GRAPHICS_BIT) |
| 441 | { |
| 442 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 443 | } |
| 444 | |
| 445 | std::string enumeratorString; |
| 446 | for(auto const& string : strings) |
| 447 | { |
| 448 | enumeratorString += string; |
| 449 | |
| 450 | if(string != strings.back()) |
| 451 | { |
| 452 | enumeratorString += '|'; |
| 453 | } |
| 454 | } |
| 455 | |
| 456 | return enumeratorString; |
| 457 | } |
| 458 | |
| 459 | static |
| 460 | bool ValidateEnumerator(VkMemoryPropertyFlagBits const& enumerator) |
| 461 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 462 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)(VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 463 | VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT | |
| 464 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 465 | VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT | |
| 466 | VK_MEMORY_PROPERTY_DEVICE_ONLY); |
| 467 | if(enumerator & (~allFlags)) |
| 468 | { |
| 469 | return false; |
| 470 | } |
| 471 | |
| 472 | return true; |
| 473 | } |
| 474 | |
| 475 | static |
| 476 | std::string EnumeratorString(VkMemoryPropertyFlagBits const& enumerator) |
| 477 | { |
| 478 | if(!ValidateEnumerator(enumerator)) |
| 479 | { |
| 480 | return "unrecognized enumerator"; |
| 481 | } |
| 482 | |
| 483 | std::vector<std::string> strings; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 484 | if(enumerator & VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT) |
| 485 | { |
| 486 | strings.push_back("VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT"); |
| 487 | } |
| 488 | if(enumerator & VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT) |
| 489 | { |
| 490 | strings.push_back("VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT"); |
| 491 | } |
| 492 | if(enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) |
| 493 | { |
| 494 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 495 | } |
| 496 | if(enumerator & VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT) |
| 497 | { |
| 498 | strings.push_back("VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT"); |
| 499 | } |
| 500 | if(enumerator & VK_MEMORY_PROPERTY_DEVICE_ONLY) |
| 501 | { |
| 502 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_ONLY"); |
| 503 | } |
| 504 | |
| 505 | std::string enumeratorString; |
| 506 | for(auto const& string : strings) |
| 507 | { |
| 508 | enumeratorString += string; |
| 509 | |
| 510 | if(string != strings.back()) |
| 511 | { |
| 512 | enumeratorString += '|'; |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | return enumeratorString; |
| 517 | } |
| 518 | |
| 519 | static |
| 520 | bool ValidateEnumerator(VkMemoryOutputFlagBits const& enumerator) |
| 521 | { |
| 522 | VkMemoryOutputFlagBits allFlags = (VkMemoryOutputFlagBits)(VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 523 | VK_MEMORY_OUTPUT_TRANSFER_BIT | |
| 524 | VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT | |
| 525 | VK_MEMORY_OUTPUT_SHADER_WRITE_BIT | |
| 526 | VK_MEMORY_OUTPUT_HOST_WRITE_BIT); |
| 527 | if(enumerator & (~allFlags)) |
| 528 | { |
| 529 | return false; |
| 530 | } |
| 531 | |
| 532 | return true; |
| 533 | } |
| 534 | |
| 535 | static |
| 536 | std::string EnumeratorString(VkMemoryOutputFlagBits const& enumerator) |
| 537 | { |
| 538 | if(!ValidateEnumerator(enumerator)) |
| 539 | { |
| 540 | return "unrecognized enumerator"; |
| 541 | } |
| 542 | |
| 543 | std::vector<std::string> strings; |
| 544 | if(enumerator & VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 545 | { |
| 546 | strings.push_back("VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 547 | } |
| 548 | if(enumerator & VK_MEMORY_OUTPUT_TRANSFER_BIT) |
| 549 | { |
| 550 | strings.push_back("VK_MEMORY_OUTPUT_TRANSFER_BIT"); |
| 551 | } |
| 552 | if(enumerator & VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT) |
| 553 | { |
| 554 | strings.push_back("VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT"); |
| 555 | } |
| 556 | if(enumerator & VK_MEMORY_OUTPUT_SHADER_WRITE_BIT) |
| 557 | { |
| 558 | strings.push_back("VK_MEMORY_OUTPUT_SHADER_WRITE_BIT"); |
| 559 | } |
| 560 | if(enumerator & VK_MEMORY_OUTPUT_HOST_WRITE_BIT) |
| 561 | { |
| 562 | strings.push_back("VK_MEMORY_OUTPUT_HOST_WRITE_BIT"); |
| 563 | } |
| 564 | |
| 565 | std::string enumeratorString; |
| 566 | for(auto const& string : strings) |
| 567 | { |
| 568 | enumeratorString += string; |
| 569 | |
| 570 | if(string != strings.back()) |
| 571 | { |
| 572 | enumeratorString += '|'; |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | return enumeratorString; |
| 577 | } |
| 578 | |
| 579 | static |
| 580 | bool ValidateEnumerator(VkMemoryInputFlagBits const& enumerator) |
| 581 | { |
| 582 | VkMemoryInputFlagBits allFlags = (VkMemoryInputFlagBits)(VK_MEMORY_INPUT_TRANSFER_BIT | |
| 583 | VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 584 | VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT | |
| 585 | VK_MEMORY_INPUT_SHADER_READ_BIT | |
| 586 | VK_MEMORY_INPUT_UNIFORM_READ_BIT | |
| 587 | VK_MEMORY_INPUT_INDEX_FETCH_BIT | |
| 588 | VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT | |
| 589 | VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT | |
| 590 | VK_MEMORY_INPUT_HOST_READ_BIT); |
| 591 | if(enumerator & (~allFlags)) |
| 592 | { |
| 593 | return false; |
| 594 | } |
| 595 | |
| 596 | return true; |
| 597 | } |
| 598 | |
| 599 | static |
| 600 | std::string EnumeratorString(VkMemoryInputFlagBits const& enumerator) |
| 601 | { |
| 602 | if(!ValidateEnumerator(enumerator)) |
| 603 | { |
| 604 | return "unrecognized enumerator"; |
| 605 | } |
| 606 | |
| 607 | std::vector<std::string> strings; |
| 608 | if(enumerator & VK_MEMORY_INPUT_TRANSFER_BIT) |
| 609 | { |
| 610 | strings.push_back("VK_MEMORY_INPUT_TRANSFER_BIT"); |
| 611 | } |
| 612 | if(enumerator & VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 613 | { |
| 614 | strings.push_back("VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 615 | } |
| 616 | if(enumerator & VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT) |
| 617 | { |
| 618 | strings.push_back("VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT"); |
| 619 | } |
| 620 | if(enumerator & VK_MEMORY_INPUT_SHADER_READ_BIT) |
| 621 | { |
| 622 | strings.push_back("VK_MEMORY_INPUT_SHADER_READ_BIT"); |
| 623 | } |
| 624 | if(enumerator & VK_MEMORY_INPUT_UNIFORM_READ_BIT) |
| 625 | { |
| 626 | strings.push_back("VK_MEMORY_INPUT_UNIFORM_READ_BIT"); |
| 627 | } |
| 628 | if(enumerator & VK_MEMORY_INPUT_INDEX_FETCH_BIT) |
| 629 | { |
| 630 | strings.push_back("VK_MEMORY_INPUT_INDEX_FETCH_BIT"); |
| 631 | } |
| 632 | if(enumerator & VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT) |
| 633 | { |
| 634 | strings.push_back("VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT"); |
| 635 | } |
| 636 | if(enumerator & VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT) |
| 637 | { |
| 638 | strings.push_back("VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT"); |
| 639 | } |
| 640 | if(enumerator & VK_MEMORY_INPUT_HOST_READ_BIT) |
| 641 | { |
| 642 | strings.push_back("VK_MEMORY_INPUT_HOST_READ_BIT"); |
| 643 | } |
| 644 | |
| 645 | std::string enumeratorString; |
| 646 | for(auto const& string : strings) |
| 647 | { |
| 648 | enumeratorString += string; |
| 649 | |
| 650 | if(string != strings.back()) |
| 651 | { |
| 652 | enumeratorString += '|'; |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | return enumeratorString; |
| 657 | } |
| 658 | |
| 659 | static |
| 660 | bool ValidateEnumerator(VkBufferUsageFlagBits const& enumerator) |
| 661 | { |
| 662 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | |
| 663 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | |
| 664 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 665 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | |
| 666 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | |
| 667 | VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT | |
| 668 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | |
| 669 | VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT | |
| 670 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | |
| 671 | VK_BUFFER_USAGE_GENERAL); |
| 672 | if(enumerator & (~allFlags)) |
| 673 | { |
| 674 | return false; |
| 675 | } |
| 676 | |
| 677 | return true; |
| 678 | } |
| 679 | |
| 680 | static |
| 681 | std::string EnumeratorString(VkBufferUsageFlagBits const& enumerator) |
| 682 | { |
| 683 | if(!ValidateEnumerator(enumerator)) |
| 684 | { |
| 685 | return "unrecognized enumerator"; |
| 686 | } |
| 687 | |
| 688 | std::vector<std::string> strings; |
| 689 | if(enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) |
| 690 | { |
| 691 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 692 | } |
| 693 | if(enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) |
| 694 | { |
| 695 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 696 | } |
| 697 | if(enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) |
| 698 | { |
| 699 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 700 | } |
| 701 | if(enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) |
| 702 | { |
| 703 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 704 | } |
| 705 | if(enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) |
| 706 | { |
| 707 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 708 | } |
| 709 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT) |
| 710 | { |
| 711 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT"); |
| 712 | } |
| 713 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) |
| 714 | { |
| 715 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 716 | } |
| 717 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT) |
| 718 | { |
| 719 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT"); |
| 720 | } |
| 721 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) |
| 722 | { |
| 723 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 724 | } |
| 725 | if(enumerator & VK_BUFFER_USAGE_GENERAL) |
| 726 | { |
| 727 | strings.push_back("VK_BUFFER_USAGE_GENERAL"); |
| 728 | } |
| 729 | |
| 730 | std::string enumeratorString; |
| 731 | for(auto const& string : strings) |
| 732 | { |
| 733 | enumeratorString += string; |
| 734 | |
| 735 | if(string != strings.back()) |
| 736 | { |
| 737 | enumeratorString += '|'; |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | return enumeratorString; |
| 742 | } |
| 743 | |
| 744 | static |
| 745 | bool ValidateEnumerator(VkBufferCreateFlagBits const& enumerator) |
| 746 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 747 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)(VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | |
| 748 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | |
| 749 | VK_BUFFER_CREATE_SPARSE_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 750 | if(enumerator & (~allFlags)) |
| 751 | { |
| 752 | return false; |
| 753 | } |
| 754 | |
| 755 | return true; |
| 756 | } |
| 757 | |
| 758 | static |
| 759 | std::string EnumeratorString(VkBufferCreateFlagBits const& enumerator) |
| 760 | { |
| 761 | if(!ValidateEnumerator(enumerator)) |
| 762 | { |
| 763 | return "unrecognized enumerator"; |
| 764 | } |
| 765 | |
| 766 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 767 | if(enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) |
| 768 | { |
| 769 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 770 | } |
| 771 | if(enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) |
| 772 | { |
| 773 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 774 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 775 | if(enumerator & VK_BUFFER_CREATE_SPARSE_BIT) |
| 776 | { |
| 777 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BIT"); |
| 778 | } |
| 779 | |
| 780 | std::string enumeratorString; |
| 781 | for(auto const& string : strings) |
| 782 | { |
| 783 | enumeratorString += string; |
| 784 | |
| 785 | if(string != strings.back()) |
| 786 | { |
| 787 | enumeratorString += '|'; |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | return enumeratorString; |
| 792 | } |
| 793 | |
| 794 | static |
| 795 | bool ValidateEnumerator(VkShaderStageFlagBits const& enumerator) |
| 796 | { |
| 797 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)(VK_SHADER_STAGE_ALL | |
| 798 | VK_SHADER_STAGE_FRAGMENT_BIT | |
| 799 | VK_SHADER_STAGE_GEOMETRY_BIT | |
| 800 | VK_SHADER_STAGE_COMPUTE_BIT | |
| 801 | VK_SHADER_STAGE_TESS_EVALUATION_BIT | |
| 802 | VK_SHADER_STAGE_TESS_CONTROL_BIT | |
| 803 | VK_SHADER_STAGE_VERTEX_BIT); |
| 804 | if(enumerator & (~allFlags)) |
| 805 | { |
| 806 | return false; |
| 807 | } |
| 808 | |
| 809 | return true; |
| 810 | } |
| 811 | |
| 812 | static |
| 813 | std::string EnumeratorString(VkShaderStageFlagBits const& enumerator) |
| 814 | { |
| 815 | if(!ValidateEnumerator(enumerator)) |
| 816 | { |
| 817 | return "unrecognized enumerator"; |
| 818 | } |
| 819 | |
| 820 | std::vector<std::string> strings; |
| 821 | if(enumerator & VK_SHADER_STAGE_ALL) |
| 822 | { |
| 823 | strings.push_back("VK_SHADER_STAGE_ALL"); |
| 824 | } |
| 825 | if(enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) |
| 826 | { |
| 827 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
| 828 | } |
| 829 | if(enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) |
| 830 | { |
| 831 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 832 | } |
| 833 | if(enumerator & VK_SHADER_STAGE_COMPUTE_BIT) |
| 834 | { |
| 835 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 836 | } |
| 837 | if(enumerator & VK_SHADER_STAGE_TESS_EVALUATION_BIT) |
| 838 | { |
| 839 | strings.push_back("VK_SHADER_STAGE_TESS_EVALUATION_BIT"); |
| 840 | } |
| 841 | if(enumerator & VK_SHADER_STAGE_TESS_CONTROL_BIT) |
| 842 | { |
| 843 | strings.push_back("VK_SHADER_STAGE_TESS_CONTROL_BIT"); |
| 844 | } |
| 845 | if(enumerator & VK_SHADER_STAGE_VERTEX_BIT) |
| 846 | { |
| 847 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
| 848 | } |
| 849 | |
| 850 | std::string enumeratorString; |
| 851 | for(auto const& string : strings) |
| 852 | { |
| 853 | enumeratorString += string; |
| 854 | |
| 855 | if(string != strings.back()) |
| 856 | { |
| 857 | enumeratorString += '|'; |
| 858 | } |
| 859 | } |
| 860 | |
| 861 | return enumeratorString; |
| 862 | } |
| 863 | |
| 864 | static |
| 865 | bool ValidateEnumerator(VkImageUsageFlagBits const& enumerator) |
| 866 | { |
| 867 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)(VK_IMAGE_USAGE_DEPTH_STENCIL_BIT | |
| 868 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 869 | VK_IMAGE_USAGE_STORAGE_BIT | |
| 870 | VK_IMAGE_USAGE_SAMPLED_BIT | |
| 871 | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT | |
| 872 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | |
| 873 | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT | |
| 874 | VK_IMAGE_USAGE_GENERAL); |
| 875 | if(enumerator & (~allFlags)) |
| 876 | { |
| 877 | return false; |
| 878 | } |
| 879 | |
| 880 | return true; |
| 881 | } |
| 882 | |
| 883 | static |
| 884 | std::string EnumeratorString(VkImageUsageFlagBits const& enumerator) |
| 885 | { |
| 886 | if(!ValidateEnumerator(enumerator)) |
| 887 | { |
| 888 | return "unrecognized enumerator"; |
| 889 | } |
| 890 | |
| 891 | std::vector<std::string> strings; |
| 892 | if(enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_BIT) |
| 893 | { |
| 894 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_BIT"); |
| 895 | } |
| 896 | if(enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) |
| 897 | { |
| 898 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 899 | } |
| 900 | if(enumerator & VK_IMAGE_USAGE_STORAGE_BIT) |
| 901 | { |
| 902 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 903 | } |
| 904 | if(enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) |
| 905 | { |
| 906 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 907 | } |
| 908 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) |
| 909 | { |
| 910 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT"); |
| 911 | } |
| 912 | if(enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) |
| 913 | { |
| 914 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 915 | } |
| 916 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) |
| 917 | { |
| 918 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT"); |
| 919 | } |
| 920 | if(enumerator & VK_IMAGE_USAGE_GENERAL) |
| 921 | { |
| 922 | strings.push_back("VK_IMAGE_USAGE_GENERAL"); |
| 923 | } |
| 924 | |
| 925 | std::string enumeratorString; |
| 926 | for(auto const& string : strings) |
| 927 | { |
| 928 | enumeratorString += string; |
| 929 | |
| 930 | if(string != strings.back()) |
| 931 | { |
| 932 | enumeratorString += '|'; |
| 933 | } |
| 934 | } |
| 935 | |
| 936 | return enumeratorString; |
| 937 | } |
| 938 | |
| 939 | static |
| 940 | bool ValidateEnumerator(VkImageCreateFlagBits const& enumerator) |
| 941 | { |
| 942 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)(VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 943 | VK_IMAGE_CREATE_INVARIANT_DATA_BIT | |
| 944 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | |
| 945 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 946 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 947 | VK_IMAGE_CREATE_SPARSE_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 948 | if(enumerator & (~allFlags)) |
| 949 | { |
| 950 | return false; |
| 951 | } |
| 952 | |
| 953 | return true; |
| 954 | } |
| 955 | |
| 956 | static |
| 957 | std::string EnumeratorString(VkImageCreateFlagBits const& enumerator) |
| 958 | { |
| 959 | if(!ValidateEnumerator(enumerator)) |
| 960 | { |
| 961 | return "unrecognized enumerator"; |
| 962 | } |
| 963 | |
| 964 | std::vector<std::string> strings; |
| 965 | if(enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) |
| 966 | { |
| 967 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 968 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 969 | if(enumerator & VK_IMAGE_CREATE_INVARIANT_DATA_BIT) |
| 970 | { |
| 971 | strings.push_back("VK_IMAGE_CREATE_INVARIANT_DATA_BIT"); |
| 972 | } |
| 973 | if(enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) |
| 974 | { |
| 975 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 976 | } |
| 977 | if(enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) |
| 978 | { |
| 979 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 980 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 981 | if(enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) |
| 982 | { |
| 983 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 984 | } |
| 985 | if(enumerator & VK_IMAGE_CREATE_SPARSE_BIT) |
| 986 | { |
| 987 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BIT"); |
| 988 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 989 | |
| 990 | std::string enumeratorString; |
| 991 | for(auto const& string : strings) |
| 992 | { |
| 993 | enumeratorString += string; |
| 994 | |
| 995 | if(string != strings.back()) |
| 996 | { |
| 997 | enumeratorString += '|'; |
| 998 | } |
| 999 | } |
| 1000 | |
| 1001 | return enumeratorString; |
| 1002 | } |
| 1003 | |
| 1004 | static |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1005 | bool ValidateEnumerator(VkAttachmentViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1006 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1007 | VkAttachmentViewCreateFlagBits allFlags = (VkAttachmentViewCreateFlagBits)(VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT | |
| 1008 | VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1009 | if(enumerator & (~allFlags)) |
| 1010 | { |
| 1011 | return false; |
| 1012 | } |
| 1013 | |
| 1014 | return true; |
| 1015 | } |
| 1016 | |
| 1017 | static |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1018 | std::string EnumeratorString(VkAttachmentViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1019 | { |
| 1020 | if(!ValidateEnumerator(enumerator)) |
| 1021 | { |
| 1022 | return "unrecognized enumerator"; |
| 1023 | } |
| 1024 | |
| 1025 | std::vector<std::string> strings; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1026 | if(enumerator & VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1027 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1028 | strings.push_back("VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1029 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1030 | if(enumerator & VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1031 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1032 | strings.push_back("VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1033 | } |
| 1034 | |
| 1035 | std::string enumeratorString; |
| 1036 | for(auto const& string : strings) |
| 1037 | { |
| 1038 | enumeratorString += string; |
| 1039 | |
| 1040 | if(string != strings.back()) |
| 1041 | { |
| 1042 | enumeratorString += '|'; |
| 1043 | } |
| 1044 | } |
| 1045 | |
| 1046 | return enumeratorString; |
| 1047 | } |
| 1048 | |
| 1049 | static |
| 1050 | bool ValidateEnumerator(VkPipelineCreateFlagBits const& enumerator) |
| 1051 | { |
| 1052 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)(VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | |
| 1053 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
| 1054 | if(enumerator & (~allFlags)) |
| 1055 | { |
| 1056 | return false; |
| 1057 | } |
| 1058 | |
| 1059 | return true; |
| 1060 | } |
| 1061 | |
| 1062 | static |
| 1063 | std::string EnumeratorString(VkPipelineCreateFlagBits const& enumerator) |
| 1064 | { |
| 1065 | if(!ValidateEnumerator(enumerator)) |
| 1066 | { |
| 1067 | return "unrecognized enumerator"; |
| 1068 | } |
| 1069 | |
| 1070 | std::vector<std::string> strings; |
| 1071 | if(enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) |
| 1072 | { |
| 1073 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 1074 | } |
| 1075 | if(enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) |
| 1076 | { |
| 1077 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
| 1078 | } |
| 1079 | |
| 1080 | std::string enumeratorString; |
| 1081 | for(auto const& string : strings) |
| 1082 | { |
| 1083 | enumeratorString += string; |
| 1084 | |
| 1085 | if(string != strings.back()) |
| 1086 | { |
| 1087 | enumeratorString += '|'; |
| 1088 | } |
| 1089 | } |
| 1090 | |
| 1091 | return enumeratorString; |
| 1092 | } |
| 1093 | |
| 1094 | static |
| 1095 | bool ValidateEnumerator(VkChannelFlagBits const& enumerator) |
| 1096 | { |
| 1097 | VkChannelFlagBits allFlags = (VkChannelFlagBits)(VK_CHANNEL_A_BIT | |
| 1098 | VK_CHANNEL_B_BIT | |
| 1099 | VK_CHANNEL_G_BIT | |
| 1100 | VK_CHANNEL_R_BIT); |
| 1101 | if(enumerator & (~allFlags)) |
| 1102 | { |
| 1103 | return false; |
| 1104 | } |
| 1105 | |
| 1106 | return true; |
| 1107 | } |
| 1108 | |
| 1109 | static |
| 1110 | std::string EnumeratorString(VkChannelFlagBits const& enumerator) |
| 1111 | { |
| 1112 | if(!ValidateEnumerator(enumerator)) |
| 1113 | { |
| 1114 | return "unrecognized enumerator"; |
| 1115 | } |
| 1116 | |
| 1117 | std::vector<std::string> strings; |
| 1118 | if(enumerator & VK_CHANNEL_A_BIT) |
| 1119 | { |
| 1120 | strings.push_back("VK_CHANNEL_A_BIT"); |
| 1121 | } |
| 1122 | if(enumerator & VK_CHANNEL_B_BIT) |
| 1123 | { |
| 1124 | strings.push_back("VK_CHANNEL_B_BIT"); |
| 1125 | } |
| 1126 | if(enumerator & VK_CHANNEL_G_BIT) |
| 1127 | { |
| 1128 | strings.push_back("VK_CHANNEL_G_BIT"); |
| 1129 | } |
| 1130 | if(enumerator & VK_CHANNEL_R_BIT) |
| 1131 | { |
| 1132 | strings.push_back("VK_CHANNEL_R_BIT"); |
| 1133 | } |
| 1134 | |
| 1135 | std::string enumeratorString; |
| 1136 | for(auto const& string : strings) |
| 1137 | { |
| 1138 | enumeratorString += string; |
| 1139 | |
| 1140 | if(string != strings.back()) |
| 1141 | { |
| 1142 | enumeratorString += '|'; |
| 1143 | } |
| 1144 | } |
| 1145 | |
| 1146 | return enumeratorString; |
| 1147 | } |
| 1148 | |
| 1149 | static |
| 1150 | bool ValidateEnumerator(VkFenceCreateFlagBits const& enumerator) |
| 1151 | { |
| 1152 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
| 1153 | if(enumerator & (~allFlags)) |
| 1154 | { |
| 1155 | return false; |
| 1156 | } |
| 1157 | |
| 1158 | return true; |
| 1159 | } |
| 1160 | |
| 1161 | static |
| 1162 | std::string EnumeratorString(VkFenceCreateFlagBits const& enumerator) |
| 1163 | { |
| 1164 | if(!ValidateEnumerator(enumerator)) |
| 1165 | { |
| 1166 | return "unrecognized enumerator"; |
| 1167 | } |
| 1168 | |
| 1169 | std::vector<std::string> strings; |
| 1170 | if(enumerator & VK_FENCE_CREATE_SIGNALED_BIT) |
| 1171 | { |
| 1172 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 1173 | } |
| 1174 | |
| 1175 | std::string enumeratorString; |
| 1176 | for(auto const& string : strings) |
| 1177 | { |
| 1178 | enumeratorString += string; |
| 1179 | |
| 1180 | if(string != strings.back()) |
| 1181 | { |
| 1182 | enumeratorString += '|'; |
| 1183 | } |
| 1184 | } |
| 1185 | |
| 1186 | return enumeratorString; |
| 1187 | } |
| 1188 | |
| 1189 | static |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1190 | bool ValidateEnumerator(VkSparseImageFormatFlagBits const& enumerator) |
| 1191 | { |
| 1192 | VkSparseImageFormatFlagBits allFlags = (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT | |
| 1193 | VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT | |
| 1194 | VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT); |
| 1195 | if(enumerator & (~allFlags)) |
| 1196 | { |
| 1197 | return false; |
| 1198 | } |
| 1199 | |
| 1200 | return true; |
| 1201 | } |
| 1202 | |
| 1203 | static |
| 1204 | std::string EnumeratorString(VkSparseImageFormatFlagBits const& enumerator) |
| 1205 | { |
| 1206 | if(!ValidateEnumerator(enumerator)) |
| 1207 | { |
| 1208 | return "unrecognized enumerator"; |
| 1209 | } |
| 1210 | |
| 1211 | std::vector<std::string> strings; |
| 1212 | if(enumerator & VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT) |
| 1213 | { |
| 1214 | strings.push_back("VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT"); |
| 1215 | } |
| 1216 | if(enumerator & VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT) |
| 1217 | { |
| 1218 | strings.push_back("VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT"); |
| 1219 | } |
| 1220 | if(enumerator & VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT) |
| 1221 | { |
| 1222 | strings.push_back("VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT"); |
| 1223 | } |
| 1224 | |
| 1225 | std::string enumeratorString; |
| 1226 | for(auto const& string : strings) |
| 1227 | { |
| 1228 | enumeratorString += string; |
| 1229 | |
| 1230 | if(string != strings.back()) |
| 1231 | { |
| 1232 | enumeratorString += '|'; |
| 1233 | } |
| 1234 | } |
| 1235 | |
| 1236 | return enumeratorString; |
| 1237 | } |
| 1238 | |
| 1239 | static |
| 1240 | bool ValidateEnumerator(VkSparseMemoryBindFlagBits const& enumerator) |
| 1241 | { |
| 1242 | VkSparseMemoryBindFlagBits allFlags = (VkSparseMemoryBindFlagBits)(VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT); |
| 1243 | if(enumerator & (~allFlags)) |
| 1244 | { |
| 1245 | return false; |
| 1246 | } |
| 1247 | |
| 1248 | return true; |
| 1249 | } |
| 1250 | |
| 1251 | static |
| 1252 | std::string EnumeratorString(VkSparseMemoryBindFlagBits const& enumerator) |
| 1253 | { |
| 1254 | if(!ValidateEnumerator(enumerator)) |
| 1255 | { |
| 1256 | return "unrecognized enumerator"; |
| 1257 | } |
| 1258 | |
| 1259 | std::vector<std::string> strings; |
| 1260 | if(enumerator & VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT) |
| 1261 | { |
| 1262 | strings.push_back("VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT"); |
| 1263 | } |
| 1264 | |
| 1265 | std::string enumeratorString; |
| 1266 | for(auto const& string : strings) |
| 1267 | { |
| 1268 | enumeratorString += string; |
| 1269 | |
| 1270 | if(string != strings.back()) |
| 1271 | { |
| 1272 | enumeratorString += '|'; |
| 1273 | } |
| 1274 | } |
| 1275 | |
| 1276 | return enumeratorString; |
| 1277 | } |
| 1278 | |
| 1279 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1280 | bool ValidateEnumerator(VkFormatFeatureFlagBits const& enumerator) |
| 1281 | { |
| 1282 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)(VK_FORMAT_FEATURE_CONVERSION_BIT | |
| 1283 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | |
| 1284 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 1285 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | |
| 1286 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 1287 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | |
| 1288 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | |
| 1289 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 1290 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | |
| 1291 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
| 1292 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT); |
| 1293 | if(enumerator & (~allFlags)) |
| 1294 | { |
| 1295 | return false; |
| 1296 | } |
| 1297 | |
| 1298 | return true; |
| 1299 | } |
| 1300 | |
| 1301 | static |
| 1302 | std::string EnumeratorString(VkFormatFeatureFlagBits const& enumerator) |
| 1303 | { |
| 1304 | if(!ValidateEnumerator(enumerator)) |
| 1305 | { |
| 1306 | return "unrecognized enumerator"; |
| 1307 | } |
| 1308 | |
| 1309 | std::vector<std::string> strings; |
| 1310 | if(enumerator & VK_FORMAT_FEATURE_CONVERSION_BIT) |
| 1311 | { |
| 1312 | strings.push_back("VK_FORMAT_FEATURE_CONVERSION_BIT"); |
| 1313 | } |
| 1314 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) |
| 1315 | { |
| 1316 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 1317 | } |
| 1318 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) |
| 1319 | { |
| 1320 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 1321 | } |
| 1322 | if(enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) |
| 1323 | { |
| 1324 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 1325 | } |
| 1326 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) |
| 1327 | { |
| 1328 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 1329 | } |
| 1330 | if(enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) |
| 1331 | { |
| 1332 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 1333 | } |
| 1334 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) |
| 1335 | { |
| 1336 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 1337 | } |
| 1338 | if(enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) |
| 1339 | { |
| 1340 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 1341 | } |
| 1342 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) |
| 1343 | { |
| 1344 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 1345 | } |
| 1346 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 1347 | { |
| 1348 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 1349 | } |
| 1350 | if(enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 1351 | { |
| 1352 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 1353 | } |
| 1354 | |
| 1355 | std::string enumeratorString; |
| 1356 | for(auto const& string : strings) |
| 1357 | { |
| 1358 | enumeratorString += string; |
| 1359 | |
| 1360 | if(string != strings.back()) |
| 1361 | { |
| 1362 | enumeratorString += '|'; |
| 1363 | } |
| 1364 | } |
| 1365 | |
| 1366 | return enumeratorString; |
| 1367 | } |
| 1368 | |
| 1369 | static |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1370 | bool ValidateEnumerator(VkImageAspectFlagBits const& enumerator) |
| 1371 | { |
| 1372 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1373 | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 1374 | VK_IMAGE_ASPECT_COLOR_BIT); |
| 1375 | if(enumerator & (~allFlags)) |
| 1376 | { |
| 1377 | return false; |
| 1378 | } |
| 1379 | |
| 1380 | return true; |
| 1381 | } |
| 1382 | |
| 1383 | static |
| 1384 | std::string EnumeratorString(VkImageAspectFlagBits const& enumerator) |
| 1385 | { |
| 1386 | if(!ValidateEnumerator(enumerator)) |
| 1387 | { |
| 1388 | return "unrecognized enumerator"; |
| 1389 | } |
| 1390 | |
| 1391 | std::vector<std::string> strings; |
| 1392 | if(enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) |
| 1393 | { |
| 1394 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1395 | } |
| 1396 | if(enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) |
| 1397 | { |
| 1398 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1399 | } |
| 1400 | if(enumerator & VK_IMAGE_ASPECT_COLOR_BIT) |
| 1401 | { |
| 1402 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1403 | } |
| 1404 | |
| 1405 | std::string enumeratorString; |
| 1406 | for(auto const& string : strings) |
| 1407 | { |
| 1408 | enumeratorString += string; |
| 1409 | |
| 1410 | if(string != strings.back()) |
| 1411 | { |
| 1412 | enumeratorString += '|'; |
| 1413 | } |
| 1414 | } |
| 1415 | |
| 1416 | return enumeratorString; |
| 1417 | } |
| 1418 | |
| 1419 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1420 | bool ValidateEnumerator(VkQueryControlFlagBits const& enumerator) |
| 1421 | { |
| 1422 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_CONSERVATIVE_BIT); |
| 1423 | if(enumerator & (~allFlags)) |
| 1424 | { |
| 1425 | return false; |
| 1426 | } |
| 1427 | |
| 1428 | return true; |
| 1429 | } |
| 1430 | |
| 1431 | static |
| 1432 | std::string EnumeratorString(VkQueryControlFlagBits const& enumerator) |
| 1433 | { |
| 1434 | if(!ValidateEnumerator(enumerator)) |
| 1435 | { |
| 1436 | return "unrecognized enumerator"; |
| 1437 | } |
| 1438 | |
| 1439 | std::vector<std::string> strings; |
| 1440 | if(enumerator & VK_QUERY_CONTROL_CONSERVATIVE_BIT) |
| 1441 | { |
| 1442 | strings.push_back("VK_QUERY_CONTROL_CONSERVATIVE_BIT"); |
| 1443 | } |
| 1444 | |
| 1445 | std::string enumeratorString; |
| 1446 | for(auto const& string : strings) |
| 1447 | { |
| 1448 | enumeratorString += string; |
| 1449 | |
| 1450 | if(string != strings.back()) |
| 1451 | { |
| 1452 | enumeratorString += '|'; |
| 1453 | } |
| 1454 | } |
| 1455 | |
| 1456 | return enumeratorString; |
| 1457 | } |
| 1458 | |
| 1459 | static |
| 1460 | bool ValidateEnumerator(VkQueryResultFlagBits const& enumerator) |
| 1461 | { |
| 1462 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | |
| 1463 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 1464 | VK_QUERY_RESULT_WAIT_BIT | |
| 1465 | VK_QUERY_RESULT_64_BIT | |
| 1466 | VK_QUERY_RESULT_DEFAULT); |
| 1467 | if(enumerator & (~allFlags)) |
| 1468 | { |
| 1469 | return false; |
| 1470 | } |
| 1471 | |
| 1472 | return true; |
| 1473 | } |
| 1474 | |
| 1475 | static |
| 1476 | std::string EnumeratorString(VkQueryResultFlagBits const& enumerator) |
| 1477 | { |
| 1478 | if(!ValidateEnumerator(enumerator)) |
| 1479 | { |
| 1480 | return "unrecognized enumerator"; |
| 1481 | } |
| 1482 | |
| 1483 | std::vector<std::string> strings; |
| 1484 | if(enumerator & VK_QUERY_RESULT_PARTIAL_BIT) |
| 1485 | { |
| 1486 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 1487 | } |
| 1488 | if(enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) |
| 1489 | { |
| 1490 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 1491 | } |
| 1492 | if(enumerator & VK_QUERY_RESULT_WAIT_BIT) |
| 1493 | { |
| 1494 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 1495 | } |
| 1496 | if(enumerator & VK_QUERY_RESULT_64_BIT) |
| 1497 | { |
| 1498 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 1499 | } |
| 1500 | if(enumerator & VK_QUERY_RESULT_DEFAULT) |
| 1501 | { |
| 1502 | strings.push_back("VK_QUERY_RESULT_DEFAULT"); |
| 1503 | } |
| 1504 | |
| 1505 | std::string enumeratorString; |
| 1506 | for(auto const& string : strings) |
| 1507 | { |
| 1508 | enumeratorString += string; |
| 1509 | |
| 1510 | if(string != strings.back()) |
| 1511 | { |
| 1512 | enumeratorString += '|'; |
| 1513 | } |
| 1514 | } |
| 1515 | |
| 1516 | return enumeratorString; |
| 1517 | } |
| 1518 | |
| 1519 | static |
| 1520 | bool ValidateEnumerator(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1521 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1522 | VkCmdBufferOptimizeFlagBits allFlags = (VkCmdBufferOptimizeFlagBits)(VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT | |
| 1523 | VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1524 | VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT | |
| 1525 | VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT | |
| 1526 | VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT); |
| 1527 | if(enumerator & (~allFlags)) |
| 1528 | { |
| 1529 | return false; |
| 1530 | } |
| 1531 | |
| 1532 | return true; |
| 1533 | } |
| 1534 | |
| 1535 | static |
| 1536 | std::string EnumeratorString(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1537 | { |
| 1538 | if(!ValidateEnumerator(enumerator)) |
| 1539 | { |
| 1540 | return "unrecognized enumerator"; |
| 1541 | } |
| 1542 | |
| 1543 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1544 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT) |
| 1545 | { |
| 1546 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT"); |
| 1547 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1548 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT) |
| 1549 | { |
| 1550 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT"); |
| 1551 | } |
| 1552 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT) |
| 1553 | { |
| 1554 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT"); |
| 1555 | } |
| 1556 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT) |
| 1557 | { |
| 1558 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT"); |
| 1559 | } |
| 1560 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT) |
| 1561 | { |
| 1562 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT"); |
| 1563 | } |
| 1564 | |
| 1565 | std::string enumeratorString; |
| 1566 | for(auto const& string : strings) |
| 1567 | { |
| 1568 | enumeratorString += string; |
| 1569 | |
| 1570 | if(string != strings.back()) |
| 1571 | { |
| 1572 | enumeratorString += '|'; |
| 1573 | } |
| 1574 | } |
| 1575 | |
| 1576 | return enumeratorString; |
| 1577 | } |
| 1578 | |
| 1579 | static |
| 1580 | bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 1581 | { |
| 1582 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)(VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT | |
| 1583 | VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT | |
| 1584 | VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT | |
| 1585 | VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT | |
| 1586 | VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT | |
| 1587 | VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT | |
| 1588 | VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT | |
| 1589 | VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT | |
| 1590 | VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT | |
| 1591 | VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT | |
| 1592 | VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT); |
| 1593 | if(enumerator & (~allFlags)) |
| 1594 | { |
| 1595 | return false; |
| 1596 | } |
| 1597 | |
| 1598 | return true; |
| 1599 | } |
| 1600 | |
| 1601 | static |
| 1602 | std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 1603 | { |
| 1604 | if(!ValidateEnumerator(enumerator)) |
| 1605 | { |
| 1606 | return "unrecognized enumerator"; |
| 1607 | } |
| 1608 | |
| 1609 | std::vector<std::string> strings; |
| 1610 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT) |
| 1611 | { |
| 1612 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT"); |
| 1613 | } |
| 1614 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT) |
| 1615 | { |
| 1616 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT"); |
| 1617 | } |
| 1618 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT) |
| 1619 | { |
| 1620 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT"); |
| 1621 | } |
| 1622 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT) |
| 1623 | { |
| 1624 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT"); |
| 1625 | } |
| 1626 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT) |
| 1627 | { |
| 1628 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT"); |
| 1629 | } |
| 1630 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT) |
| 1631 | { |
| 1632 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT"); |
| 1633 | } |
| 1634 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT) |
| 1635 | { |
| 1636 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT"); |
| 1637 | } |
| 1638 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT) |
| 1639 | { |
| 1640 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT"); |
| 1641 | } |
| 1642 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT) |
| 1643 | { |
| 1644 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT"); |
| 1645 | } |
| 1646 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT) |
| 1647 | { |
| 1648 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT"); |
| 1649 | } |
| 1650 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT) |
| 1651 | { |
| 1652 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT"); |
| 1653 | } |
| 1654 | |
| 1655 | std::string enumeratorString; |
| 1656 | for(auto const& string : strings) |
| 1657 | { |
| 1658 | enumeratorString += string; |
| 1659 | |
| 1660 | if(string != strings.back()) |
| 1661 | { |
| 1662 | enumeratorString += '|'; |
| 1663 | } |
| 1664 | } |
| 1665 | |
| 1666 | return enumeratorString; |
| 1667 | } |
| 1668 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1669 | static |
| 1670 | bool ValidateEnumerator(VkMemoryHeapFlagBits const& enumerator) |
| 1671 | { |
| 1672 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_HOST_LOCAL); |
| 1673 | if(enumerator & (~allFlags)) |
| 1674 | { |
| 1675 | return false; |
| 1676 | } |
| 1677 | |
| 1678 | return true; |
| 1679 | } |
| 1680 | |
| 1681 | static |
| 1682 | std::string EnumeratorString(VkMemoryHeapFlagBits const& enumerator) |
| 1683 | { |
| 1684 | if(!ValidateEnumerator(enumerator)) |
| 1685 | { |
| 1686 | return "unrecognized enumerator"; |
| 1687 | } |
| 1688 | |
| 1689 | std::vector<std::string> strings; |
| 1690 | if(enumerator & VK_MEMORY_HEAP_HOST_LOCAL) |
| 1691 | { |
| 1692 | strings.push_back("VK_MEMORY_HEAP_HOST_LOCAL"); |
| 1693 | } |
| 1694 | |
| 1695 | std::string enumeratorString; |
| 1696 | for(auto const& string : strings) |
| 1697 | { |
| 1698 | enumeratorString += string; |
| 1699 | |
| 1700 | if(string != strings.back()) |
| 1701 | { |
| 1702 | enumeratorString += '|'; |
| 1703 | } |
| 1704 | } |
| 1705 | |
| 1706 | return enumeratorString; |
| 1707 | } |
| 1708 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1709 | VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance( |
| 1710 | const VkInstanceCreateInfo* pCreateInfo, |
| 1711 | VkInstance* pInstance) |
| 1712 | { |
| 1713 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, *pInstance); |
| 1714 | VkResult result = pTable->CreateInstance(pCreateInfo, pInstance); |
| 1715 | |
| 1716 | if (result == VK_SUCCESS) { |
| 1717 | layer_data *data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); |
| 1718 | data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->extensionCount, |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 1719 | pCreateInfo->ppEnabledExtensionNames); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1720 | |
| 1721 | InitParamChecker(data); |
| 1722 | } |
| 1723 | |
| 1724 | return result; |
| 1725 | } |
| 1726 | |
| 1727 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance( |
| 1728 | VkInstance instance) |
| 1729 | { |
| 1730 | // Grab the key before the instance is destroyed. |
| 1731 | dispatch_key key = get_dispatch_key(instance); |
| 1732 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 1733 | VkResult result = pTable->DestroyInstance(instance); |
| 1734 | |
| 1735 | // Clean up logging callback, if any |
| 1736 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 1737 | if(data->logging_callback) |
| 1738 | { |
| 1739 | layer_destroy_msg_callback(data->report_data, data->logging_callback); |
| 1740 | } |
| 1741 | |
| 1742 | layer_debug_report_destroy_instance(mid(instance)); |
| 1743 | layer_data_map.erase(pTable); |
| 1744 | |
| 1745 | pc_instance_table_map.erase(key); |
| 1746 | assert(pc_instance_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
| 1747 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1748 | return result; |
| 1749 | } |
| 1750 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1751 | bool PostEnumeratePhysicalDevices( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1752 | VkInstance instance, |
| 1753 | uint32_t* pPhysicalDeviceCount, |
| 1754 | VkPhysicalDevice* pPhysicalDevices, |
| 1755 | VkResult result) |
| 1756 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1757 | |
| 1758 | if(pPhysicalDeviceCount == nullptr) |
| 1759 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1760 | 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] | 1761 | "vkEnumeratePhysicalDevices parameter, uint32_t* pPhysicalDeviceCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1762 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1763 | } |
| 1764 | |
| 1765 | if(pPhysicalDevices == nullptr) |
| 1766 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1767 | 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] | 1768 | "vkEnumeratePhysicalDevices parameter, VkPhysicalDevice* pPhysicalDevices, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1769 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1770 | } |
| 1771 | |
| 1772 | if(result != VK_SUCCESS) |
| 1773 | { |
| 1774 | std::string reason = "vkEnumeratePhysicalDevices parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1775 | log_msg(mid(instance), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1776 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1777 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1778 | |
| 1779 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1780 | } |
| 1781 | |
| 1782 | VK_LAYER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
| 1783 | VkInstance instance, |
| 1784 | uint32_t* pPhysicalDeviceCount, |
| 1785 | VkPhysicalDevice* pPhysicalDevices) |
| 1786 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1787 | VkResult result = get_dispatch_table(pc_instance_table_map, instance)->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
| 1788 | |
| 1789 | PostEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices, result); |
| 1790 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1791 | return result; |
| 1792 | } |
| 1793 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1794 | bool PostGetPhysicalDeviceFeatures( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1795 | VkPhysicalDevice physicalDevice, |
| 1796 | VkPhysicalDeviceFeatures* pFeatures, |
| 1797 | VkResult result) |
| 1798 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1799 | |
| 1800 | if(pFeatures == nullptr) |
| 1801 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1802 | 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] | 1803 | "vkGetPhysicalDeviceFeatures parameter, VkPhysicalDeviceFeatures* pFeatures, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1804 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1805 | } |
| 1806 | |
| 1807 | if(result != VK_SUCCESS) |
| 1808 | { |
| 1809 | std::string reason = "vkGetPhysicalDeviceFeatures parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1810 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1811 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1812 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1813 | |
| 1814 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1815 | } |
| 1816 | |
| 1817 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures( |
| 1818 | VkPhysicalDevice physicalDevice, |
| 1819 | VkPhysicalDeviceFeatures* pFeatures) |
| 1820 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1821 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
| 1822 | |
| 1823 | PostGetPhysicalDeviceFeatures(physicalDevice, pFeatures, result); |
| 1824 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1825 | return result; |
| 1826 | } |
| 1827 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1828 | bool PostGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1829 | VkPhysicalDevice physicalDevice, |
| 1830 | VkFormat format, |
| 1831 | VkFormatProperties* pFormatInfo, |
| 1832 | VkResult result) |
| 1833 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1834 | |
| 1835 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 1836 | format > VK_FORMAT_END_RANGE) |
| 1837 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1838 | 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] | 1839 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormat format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1840 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1841 | } |
| 1842 | |
| 1843 | if(pFormatInfo == nullptr) |
| 1844 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1845 | 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] | 1846 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormatProperties* pFormatInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1847 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1848 | } |
| 1849 | if(!ValidateEnumerator((VkFormatFeatureFlagBits)pFormatInfo->linearTilingFeatures)) |
| 1850 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1851 | 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] | 1852 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1853 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1854 | } |
| 1855 | if(!ValidateEnumerator((VkFormatFeatureFlagBits)pFormatInfo->optimalTilingFeatures)) |
| 1856 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1857 | 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] | 1858 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1859 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1860 | } |
| 1861 | |
| 1862 | if(result != VK_SUCCESS) |
| 1863 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1864 | std::string reason = "vkGetPhysicalDeviceFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1865 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1866 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1867 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1868 | |
| 1869 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1870 | } |
| 1871 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1872 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1873 | VkPhysicalDevice physicalDevice, |
| 1874 | VkFormat format, |
| 1875 | VkFormatProperties* pFormatInfo) |
| 1876 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1877 | 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] | 1878 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1879 | PostGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatInfo, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1880 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1881 | return result; |
| 1882 | } |
| 1883 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1884 | bool PostGetPhysicalDeviceLimits( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1885 | VkPhysicalDevice physicalDevice, |
| 1886 | VkPhysicalDeviceLimits* pLimits, |
| 1887 | VkResult result) |
| 1888 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1889 | |
| 1890 | if(pLimits == nullptr) |
| 1891 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1892 | 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] | 1893 | "vkGetPhysicalDeviceLimits parameter, VkPhysicalDeviceLimits* pLimits, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1894 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1895 | } |
| 1896 | |
| 1897 | if(result != VK_SUCCESS) |
| 1898 | { |
| 1899 | std::string reason = "vkGetPhysicalDeviceLimits parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1900 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1901 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1902 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1903 | |
| 1904 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1905 | } |
| 1906 | |
| 1907 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits( |
| 1908 | VkPhysicalDevice physicalDevice, |
| 1909 | VkPhysicalDeviceLimits* pLimits) |
| 1910 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1911 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceLimits(physicalDevice, pLimits); |
| 1912 | |
| 1913 | PostGetPhysicalDeviceLimits(physicalDevice, pLimits, result); |
| 1914 | |
| 1915 | return result; |
| 1916 | } |
| 1917 | |
| 1918 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice( |
| 1919 | VkPhysicalDevice physicalDevice, |
| 1920 | const VkDeviceCreateInfo* pCreateInfo, |
| 1921 | VkDevice* pDevice) |
| 1922 | { |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 1923 | VkLayerDispatchTable *pTable = get_dispatch_table(pc_device_table_map, *pDevice); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1924 | VkResult result = pTable->CreateDevice(physicalDevice, pCreateInfo, pDevice); |
| 1925 | if(result == VK_SUCCESS) |
| 1926 | { |
| 1927 | layer_data *instance_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
| 1928 | layer_data *device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); |
| 1929 | device_data->report_data = layer_debug_report_create_device(instance_data->report_data, *pDevice); |
| 1930 | } |
| 1931 | |
| 1932 | return result; |
| 1933 | } |
| 1934 | |
| 1935 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice( |
| 1936 | VkDevice device) |
| 1937 | { |
| 1938 | layer_debug_report_destroy_device(device); |
| 1939 | |
| 1940 | dispatch_key key = get_dispatch_key(device); |
| 1941 | #if DISPATCH_MAP_DEBUG |
| 1942 | fprintf(stderr, "Device: %p, key: %p\n", device, key); |
| 1943 | #endif |
| 1944 | |
| 1945 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device); |
| 1946 | pc_device_table_map.erase(key); |
| 1947 | assert(pc_device_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
| 1948 | |
| 1949 | return result; |
| 1950 | } |
| 1951 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1952 | bool PostGetPhysicalDeviceProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1953 | VkPhysicalDevice physicalDevice, |
| 1954 | VkPhysicalDeviceProperties* pProperties, |
| 1955 | VkResult result) |
| 1956 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1957 | |
| 1958 | if(pProperties == nullptr) |
| 1959 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1960 | 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] | 1961 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceProperties* pProperties, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1962 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1963 | } |
| 1964 | if(pProperties->deviceType < VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE || |
| 1965 | pProperties->deviceType > VK_PHYSICAL_DEVICE_TYPE_END_RANGE) |
| 1966 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1967 | 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] | 1968 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceType pProperties->deviceType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1969 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1970 | } |
| 1971 | |
| 1972 | if(result != VK_SUCCESS) |
| 1973 | { |
| 1974 | std::string reason = "vkGetPhysicalDeviceProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1975 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1976 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1977 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1978 | |
| 1979 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1980 | } |
| 1981 | |
| 1982 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties( |
| 1983 | VkPhysicalDevice physicalDevice, |
| 1984 | VkPhysicalDeviceProperties* pProperties) |
| 1985 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1986 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties(physicalDevice, pProperties); |
| 1987 | |
| 1988 | PostGetPhysicalDeviceProperties(physicalDevice, pProperties, result); |
| 1989 | |
| 1990 | return result; |
| 1991 | } |
| 1992 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1993 | bool PostGetPhysicalDeviceQueueCount( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1994 | VkPhysicalDevice physicalDevice, |
| 1995 | uint32_t* pCount, |
| 1996 | VkResult result) |
| 1997 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1998 | |
| 1999 | if(pCount == nullptr) |
| 2000 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2001 | 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] | 2002 | "vkGetPhysicalDeviceQueueCount parameter, uint32_t* pCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2003 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2004 | } |
| 2005 | |
| 2006 | if(result != VK_SUCCESS) |
| 2007 | { |
| 2008 | std::string reason = "vkGetPhysicalDeviceQueueCount parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2009 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2010 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2011 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2012 | |
| 2013 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2014 | } |
| 2015 | |
| 2016 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueCount( |
| 2017 | VkPhysicalDevice physicalDevice, |
| 2018 | uint32_t* pCount) |
| 2019 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2020 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceQueueCount(physicalDevice, pCount); |
| 2021 | |
| 2022 | PostGetPhysicalDeviceQueueCount(physicalDevice, pCount, result); |
| 2023 | |
| 2024 | return result; |
| 2025 | } |
| 2026 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2027 | bool PostGetPhysicalDeviceQueueProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2028 | VkPhysicalDevice physicalDevice, |
| 2029 | uint32_t count, |
| 2030 | VkPhysicalDeviceQueueProperties* pQueueProperties, |
| 2031 | VkResult result) |
| 2032 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2033 | |
| 2034 | |
| 2035 | if(pQueueProperties == nullptr) |
| 2036 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2037 | 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] | 2038 | "vkGetPhysicalDeviceQueueProperties parameter, VkPhysicalDeviceQueueProperties* pQueueProperties, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2039 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2040 | } |
| 2041 | if(!ValidateEnumerator((VkQueueFlagBits)pQueueProperties->queueFlags)) |
| 2042 | { |
| 2043 | 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] | 2044 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2045 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2046 | } |
| 2047 | |
| 2048 | if(result != VK_SUCCESS) |
| 2049 | { |
| 2050 | std::string reason = "vkGetPhysicalDeviceQueueProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2051 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2052 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2053 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2054 | |
| 2055 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2056 | } |
| 2057 | |
| 2058 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties( |
| 2059 | VkPhysicalDevice physicalDevice, |
| 2060 | uint32_t count, |
| 2061 | VkPhysicalDeviceQueueProperties* pQueueProperties) |
| 2062 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2063 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceQueueProperties(physicalDevice, count, pQueueProperties); |
| 2064 | |
| 2065 | PostGetPhysicalDeviceQueueProperties(physicalDevice, count, pQueueProperties, result); |
| 2066 | |
| 2067 | return result; |
| 2068 | } |
| 2069 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2070 | bool PostGetPhysicalDeviceMemoryProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2071 | VkPhysicalDevice physicalDevice, |
| 2072 | VkPhysicalDeviceMemoryProperties* pMemoryProperies, |
| 2073 | VkResult result) |
| 2074 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2075 | |
| 2076 | if(pMemoryProperies == nullptr) |
| 2077 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2078 | 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] | 2079 | "vkGetPhysicalDeviceMemoryProperties parameter, VkPhysicalDeviceMemoryProperties* pMemoryProperies, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2080 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2081 | } |
| 2082 | |
| 2083 | if(result != VK_SUCCESS) |
| 2084 | { |
| 2085 | std::string reason = "vkGetPhysicalDeviceMemoryProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2086 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2087 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2088 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2089 | |
| 2090 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2091 | } |
| 2092 | |
| 2093 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( |
| 2094 | VkPhysicalDevice physicalDevice, |
| 2095 | VkPhysicalDeviceMemoryProperties* pMemoryProperies) |
| 2096 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2097 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperies); |
| 2098 | |
| 2099 | PostGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperies, result); |
| 2100 | |
| 2101 | return result; |
| 2102 | } |
| 2103 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2104 | bool PostGetDeviceQueue( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2105 | VkDevice device, |
| 2106 | uint32_t queueNodeIndex, |
| 2107 | uint32_t queueIndex, |
| 2108 | VkQueue* pQueue, |
| 2109 | VkResult result) |
| 2110 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2111 | |
| 2112 | |
| 2113 | |
| 2114 | if(pQueue == nullptr) |
| 2115 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2116 | 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] | 2117 | "vkGetDeviceQueue parameter, VkQueue* pQueue, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2118 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2119 | } |
| 2120 | |
| 2121 | if(result != VK_SUCCESS) |
| 2122 | { |
| 2123 | std::string reason = "vkGetDeviceQueue parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2124 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2125 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2126 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2127 | |
| 2128 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2129 | } |
| 2130 | |
| 2131 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceQueue( |
| 2132 | VkDevice device, |
| 2133 | uint32_t queueNodeIndex, |
| 2134 | uint32_t queueIndex, |
| 2135 | VkQueue* pQueue) |
| 2136 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2137 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); |
| 2138 | |
| 2139 | PostGetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue, result); |
| 2140 | |
| 2141 | return result; |
| 2142 | } |
| 2143 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2144 | bool PreQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2145 | VkQueue queue, |
| 2146 | const VkCmdBuffer* pCmdBuffers) |
| 2147 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2148 | if(pCmdBuffers == nullptr) |
| 2149 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2150 | 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] | 2151 | "vkQueueSubmit parameter, const VkCmdBuffer* pCmdBuffers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2152 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2153 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2154 | |
| 2155 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2156 | } |
| 2157 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2158 | bool PostQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2159 | VkQueue queue, |
| 2160 | uint32_t cmdBufferCount, |
| 2161 | VkFence fence, |
| 2162 | VkResult result) |
| 2163 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2164 | |
| 2165 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2166 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2167 | if(result != VK_SUCCESS) |
| 2168 | { |
| 2169 | std::string reason = "vkQueueSubmit parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2170 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2171 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2172 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2173 | |
| 2174 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2175 | } |
| 2176 | |
| 2177 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( |
| 2178 | VkQueue queue, |
| 2179 | uint32_t cmdBufferCount, |
| 2180 | const VkCmdBuffer* pCmdBuffers, |
| 2181 | VkFence fence) |
| 2182 | { |
| 2183 | PreQueueSubmit(queue, pCmdBuffers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2184 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2185 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence); |
| 2186 | |
| 2187 | PostQueueSubmit(queue, cmdBufferCount, fence, result); |
| 2188 | |
| 2189 | return result; |
| 2190 | } |
| 2191 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2192 | bool PostQueueWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2193 | VkQueue queue, |
| 2194 | VkResult result) |
| 2195 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2196 | |
| 2197 | if(result != VK_SUCCESS) |
| 2198 | { |
| 2199 | std::string reason = "vkQueueWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2200 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2201 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2202 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2203 | |
| 2204 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2205 | } |
| 2206 | |
| 2207 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitIdle( |
| 2208 | VkQueue queue) |
| 2209 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2210 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue); |
| 2211 | |
| 2212 | PostQueueWaitIdle(queue, result); |
| 2213 | |
| 2214 | return result; |
| 2215 | } |
| 2216 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2217 | bool PostDeviceWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2218 | VkDevice device, |
| 2219 | VkResult result) |
| 2220 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2221 | |
| 2222 | if(result != VK_SUCCESS) |
| 2223 | { |
| 2224 | std::string reason = "vkDeviceWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2225 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2226 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2227 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2228 | |
| 2229 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2230 | } |
| 2231 | |
| 2232 | VK_LAYER_EXPORT VkResult VKAPI vkDeviceWaitIdle( |
| 2233 | VkDevice device) |
| 2234 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2235 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device); |
| 2236 | |
| 2237 | PostDeviceWaitIdle(device, result); |
| 2238 | |
| 2239 | return result; |
| 2240 | } |
| 2241 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2242 | bool PreAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2243 | VkDevice device, |
| 2244 | const VkMemoryAllocInfo* pAllocInfo) |
| 2245 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2246 | if(pAllocInfo == nullptr) |
| 2247 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2248 | 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] | 2249 | "vkAllocMemory parameter, const VkMemoryAllocInfo* pAllocInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2250 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2251 | } |
| 2252 | if(pAllocInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2253 | pAllocInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2254 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2255 | 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] | 2256 | "vkAllocMemory parameter, VkStructureType pAllocInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2257 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2258 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2259 | |
| 2260 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2261 | } |
| 2262 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2263 | bool PostAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2264 | VkDevice device, |
| 2265 | VkDeviceMemory* pMem, |
| 2266 | VkResult result) |
| 2267 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2268 | |
| 2269 | if(pMem == nullptr) |
| 2270 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2271 | 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] | 2272 | "vkAllocMemory parameter, VkDeviceMemory* pMem, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2273 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2274 | } |
| 2275 | |
| 2276 | if(result != VK_SUCCESS) |
| 2277 | { |
| 2278 | std::string reason = "vkAllocMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2279 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2280 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2281 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2282 | |
| 2283 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2284 | } |
| 2285 | |
| 2286 | VK_LAYER_EXPORT VkResult VKAPI vkAllocMemory( |
| 2287 | VkDevice device, |
| 2288 | const VkMemoryAllocInfo* pAllocInfo, |
| 2289 | VkDeviceMemory* pMem) |
| 2290 | { |
| 2291 | PreAllocMemory(device, pAllocInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2292 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2293 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocMemory(device, pAllocInfo, pMem); |
| 2294 | |
| 2295 | PostAllocMemory(device, pMem, result); |
| 2296 | |
| 2297 | return result; |
| 2298 | } |
| 2299 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2300 | bool PostFreeMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2301 | VkDevice device, |
| 2302 | VkDeviceMemory mem, |
| 2303 | VkResult result) |
| 2304 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2305 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2306 | |
| 2307 | if(result != VK_SUCCESS) |
| 2308 | { |
| 2309 | std::string reason = "vkFreeMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2310 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2311 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2312 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2313 | |
| 2314 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2315 | } |
| 2316 | |
| 2317 | VK_LAYER_EXPORT VkResult VKAPI vkFreeMemory( |
| 2318 | VkDevice device, |
| 2319 | VkDeviceMemory mem) |
| 2320 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2321 | VkResult result = get_dispatch_table(pc_device_table_map, device)->FreeMemory(device, mem); |
| 2322 | |
| 2323 | PostFreeMemory(device, mem, result); |
| 2324 | |
| 2325 | return result; |
| 2326 | } |
| 2327 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2328 | bool PostMapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2329 | VkDevice device, |
| 2330 | VkDeviceMemory mem, |
| 2331 | VkDeviceSize offset, |
| 2332 | VkDeviceSize size, |
| 2333 | VkMemoryMapFlags flags, |
| 2334 | void** ppData, |
| 2335 | VkResult result) |
| 2336 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2337 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2338 | |
| 2339 | |
| 2340 | |
| 2341 | |
| 2342 | if(ppData == nullptr) |
| 2343 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2344 | 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] | 2345 | "vkMapMemory parameter, void** ppData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2346 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2347 | } |
| 2348 | |
| 2349 | if(result != VK_SUCCESS) |
| 2350 | { |
| 2351 | std::string reason = "vkMapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2352 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2353 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2354 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2355 | |
| 2356 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2357 | } |
| 2358 | |
| 2359 | VK_LAYER_EXPORT VkResult VKAPI vkMapMemory( |
| 2360 | VkDevice device, |
| 2361 | VkDeviceMemory mem, |
| 2362 | VkDeviceSize offset, |
| 2363 | VkDeviceSize size, |
| 2364 | VkMemoryMapFlags flags, |
| 2365 | void** ppData) |
| 2366 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2367 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, mem, offset, size, flags, ppData); |
| 2368 | |
| 2369 | PostMapMemory(device, mem, offset, size, flags, ppData, result); |
| 2370 | |
| 2371 | return result; |
| 2372 | } |
| 2373 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2374 | bool PostUnmapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2375 | VkDevice device, |
| 2376 | VkDeviceMemory mem, |
| 2377 | VkResult result) |
| 2378 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2379 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2380 | |
| 2381 | if(result != VK_SUCCESS) |
| 2382 | { |
| 2383 | std::string reason = "vkUnmapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2384 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2385 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2386 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2387 | |
| 2388 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2389 | } |
| 2390 | |
| 2391 | VK_LAYER_EXPORT VkResult VKAPI vkUnmapMemory( |
| 2392 | VkDevice device, |
| 2393 | VkDeviceMemory mem) |
| 2394 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2395 | VkResult result = get_dispatch_table(pc_device_table_map, device)->UnmapMemory(device, mem); |
| 2396 | |
| 2397 | PostUnmapMemory(device, mem, result); |
| 2398 | |
| 2399 | return result; |
| 2400 | } |
| 2401 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2402 | bool PreFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2403 | VkDevice device, |
| 2404 | const VkMappedMemoryRange* pMemRanges) |
| 2405 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2406 | if(pMemRanges == nullptr) |
| 2407 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2408 | 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] | 2409 | "vkFlushMappedMemoryRanges parameter, const VkMappedMemoryRange* pMemRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2410 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2411 | } |
| 2412 | if(pMemRanges->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2413 | pMemRanges->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2414 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2415 | 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] | 2416 | "vkFlushMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2417 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2418 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2419 | |
| 2420 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2421 | } |
| 2422 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2423 | bool PostFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2424 | VkDevice device, |
| 2425 | uint32_t memRangeCount, |
| 2426 | VkResult result) |
| 2427 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2428 | |
| 2429 | |
| 2430 | if(result != VK_SUCCESS) |
| 2431 | { |
| 2432 | std::string reason = "vkFlushMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2433 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2434 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2435 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2436 | |
| 2437 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2438 | } |
| 2439 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2440 | VK_LAYER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2441 | VkDevice device, |
| 2442 | uint32_t memRangeCount, |
| 2443 | const VkMappedMemoryRange* pMemRanges) |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2444 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2445 | PreFlushMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2446 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2447 | 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] | 2448 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2449 | PostFlushMappedMemoryRanges(device, memRangeCount, result); |
| 2450 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2451 | return result; |
| 2452 | } |
| 2453 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2454 | bool PreInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2455 | VkDevice device, |
| 2456 | const VkMappedMemoryRange* pMemRanges) |
| 2457 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2458 | if(pMemRanges == nullptr) |
| 2459 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2460 | 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] | 2461 | "vkInvalidateMappedMemoryRanges parameter, const VkMappedMemoryRange* pMemRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2462 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2463 | } |
| 2464 | if(pMemRanges->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2465 | pMemRanges->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2466 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2467 | 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] | 2468 | "vkInvalidateMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2469 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2470 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2471 | |
| 2472 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2473 | } |
| 2474 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2475 | bool PostInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2476 | VkDevice device, |
| 2477 | uint32_t memRangeCount, |
| 2478 | VkResult result) |
| 2479 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2480 | |
| 2481 | |
| 2482 | if(result != VK_SUCCESS) |
| 2483 | { |
| 2484 | std::string reason = "vkInvalidateMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2485 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2486 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2487 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2488 | |
| 2489 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2490 | } |
| 2491 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2492 | VK_LAYER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2493 | VkDevice device, |
| 2494 | uint32_t memRangeCount, |
| 2495 | const VkMappedMemoryRange* pMemRanges) |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2496 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2497 | PreInvalidateMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2498 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2499 | 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] | 2500 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2501 | PostInvalidateMappedMemoryRanges(device, memRangeCount, result); |
| 2502 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2503 | return result; |
| 2504 | } |
| 2505 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2506 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment( |
| 2507 | VkDevice device, |
| 2508 | VkDeviceMemory memory, |
| 2509 | VkDeviceSize* pCommittedMemoryInBytes) |
| 2510 | { |
| 2511 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
| 2512 | |
| 2513 | return result; |
| 2514 | } |
| 2515 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2516 | bool PostBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2517 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2518 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2519 | VkDeviceMemory mem, |
| 2520 | VkDeviceSize memOffset, |
| 2521 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2522 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2523 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2524 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2525 | |
| 2526 | |
| 2527 | if(result != VK_SUCCESS) |
| 2528 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2529 | std::string reason = "vkBindBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2530 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2531 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2532 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2533 | |
| 2534 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2535 | } |
| 2536 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2537 | VK_LAYER_EXPORT VkResult VKAPI vkBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2538 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2539 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2540 | VkDeviceMemory mem, |
| 2541 | VkDeviceSize memOffset) |
| 2542 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2543 | 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] | 2544 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2545 | PostBindBufferMemory(device, buffer, mem, memOffset, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2546 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2547 | return result; |
| 2548 | } |
| 2549 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2550 | bool PostBindImageMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2551 | VkDevice device, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2552 | VkImage image, |
| 2553 | VkDeviceMemory mem, |
| 2554 | VkDeviceSize memOffset, |
| 2555 | VkResult result) |
| 2556 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2557 | |
| 2558 | |
| 2559 | |
| 2560 | |
| 2561 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2562 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2563 | std::string reason = "vkBindImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2564 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2565 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2566 | } |
| 2567 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2568 | return true; |
| 2569 | } |
| 2570 | |
| 2571 | VK_LAYER_EXPORT VkResult VKAPI vkBindImageMemory( |
| 2572 | VkDevice device, |
| 2573 | VkImage image, |
| 2574 | VkDeviceMemory mem, |
| 2575 | VkDeviceSize memOffset) |
| 2576 | { |
| 2577 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, mem, memOffset); |
| 2578 | |
| 2579 | PostBindImageMemory(device, image, mem, memOffset, result); |
| 2580 | |
| 2581 | return result; |
| 2582 | } |
| 2583 | |
| 2584 | bool PostGetBufferMemoryRequirements( |
| 2585 | VkDevice device, |
| 2586 | VkBuffer buffer, |
| 2587 | VkMemoryRequirements* pMemoryRequirements, |
| 2588 | VkResult result) |
| 2589 | { |
| 2590 | |
| 2591 | |
| 2592 | if(pMemoryRequirements == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2593 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2594 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2595 | "vkGetBufferMemoryRequirements parameter, VkMemoryRequirements* pMemoryRequirements, is null pointer"); |
| 2596 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2597 | } |
| 2598 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2599 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2600 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2601 | std::string reason = "vkGetBufferMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2602 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2603 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2604 | } |
| 2605 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2606 | return true; |
| 2607 | } |
| 2608 | |
| 2609 | VK_LAYER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements( |
| 2610 | VkDevice device, |
| 2611 | VkBuffer buffer, |
| 2612 | VkMemoryRequirements* pMemoryRequirements) |
| 2613 | { |
| 2614 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
| 2615 | |
| 2616 | PostGetBufferMemoryRequirements(device, buffer, pMemoryRequirements, result); |
| 2617 | |
| 2618 | return result; |
| 2619 | } |
| 2620 | |
| 2621 | bool PostGetImageMemoryRequirements( |
| 2622 | VkDevice device, |
| 2623 | VkImage image, |
| 2624 | VkMemoryRequirements* pMemoryRequirements, |
| 2625 | VkResult result) |
| 2626 | { |
| 2627 | |
| 2628 | |
| 2629 | if(pMemoryRequirements == nullptr) |
| 2630 | { |
| 2631 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2632 | "vkGetImageMemoryRequirements parameter, VkMemoryRequirements* pMemoryRequirements, is null pointer"); |
| 2633 | return false; |
| 2634 | } |
| 2635 | |
| 2636 | if(result != VK_SUCCESS) |
| 2637 | { |
| 2638 | std::string reason = "vkGetImageMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2639 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2640 | return false; |
| 2641 | } |
| 2642 | |
| 2643 | return true; |
| 2644 | } |
| 2645 | |
| 2646 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageMemoryRequirements( |
| 2647 | VkDevice device, |
| 2648 | VkImage image, |
| 2649 | VkMemoryRequirements* pMemoryRequirements) |
| 2650 | { |
| 2651 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
| 2652 | |
| 2653 | PostGetImageMemoryRequirements(device, image, pMemoryRequirements, result); |
| 2654 | |
| 2655 | return result; |
| 2656 | } |
| 2657 | |
| 2658 | bool PostGetImageSparseMemoryRequirements( |
| 2659 | VkDevice device, |
| 2660 | VkImage image, |
| 2661 | uint32_t* pNumRequirements, |
| 2662 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements, |
| 2663 | VkResult result) |
| 2664 | { |
| 2665 | |
| 2666 | |
| 2667 | if(pNumRequirements == nullptr) |
| 2668 | { |
| 2669 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2670 | "vkGetImageSparseMemoryRequirements parameter, uint32_t* pNumRequirements, is null pointer"); |
| 2671 | return false; |
| 2672 | } |
| 2673 | |
| 2674 | if(pSparseMemoryRequirements == nullptr) |
| 2675 | { |
| 2676 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2677 | "vkGetImageSparseMemoryRequirements parameter, VkSparseImageMemoryRequirements* pSparseMemoryRequirements, is null pointer"); |
| 2678 | return false; |
| 2679 | } |
| 2680 | if(pSparseMemoryRequirements->formatProps.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2681 | pSparseMemoryRequirements->formatProps.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2682 | { |
| 2683 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2684 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect pSparseMemoryRequirements->formatProps.aspect, is unrecognized enumerator"); |
| 2685 | return false; |
| 2686 | } |
| 2687 | if(!ValidateEnumerator((VkSparseImageFormatFlagBits)pSparseMemoryRequirements->formatProps.flags)) |
| 2688 | { |
| 2689 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkSparseImageFormatFlags pSparseMemoryRequirements->formatProps.flags, is " + EnumeratorString((VkSparseImageFormatFlagBits)pSparseMemoryRequirements->formatProps.flags); |
| 2690 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2691 | return false; |
| 2692 | } |
| 2693 | |
| 2694 | if(result != VK_SUCCESS) |
| 2695 | { |
| 2696 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2697 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2698 | return false; |
| 2699 | } |
| 2700 | |
| 2701 | return true; |
| 2702 | } |
| 2703 | |
| 2704 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements( |
| 2705 | VkDevice device, |
| 2706 | VkImage image, |
| 2707 | uint32_t* pNumRequirements, |
| 2708 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2709 | { |
| 2710 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements); |
| 2711 | |
| 2712 | PostGetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements, result); |
| 2713 | |
| 2714 | return result; |
| 2715 | } |
| 2716 | |
| 2717 | bool PostGetPhysicalDeviceSparseImageFormatProperties( |
| 2718 | VkPhysicalDevice physicalDevice, |
| 2719 | VkFormat format, |
| 2720 | VkImageType type, |
| 2721 | uint32_t samples, |
| 2722 | VkImageUsageFlags usage, |
| 2723 | VkImageTiling tiling, |
| 2724 | uint32_t* pNumProperties, |
| 2725 | VkSparseImageFormatProperties* pProperties, |
| 2726 | VkResult result) |
| 2727 | { |
| 2728 | |
| 2729 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2730 | format > VK_FORMAT_END_RANGE) |
| 2731 | { |
| 2732 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2733 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkFormat format, is unrecognized enumerator"); |
| 2734 | return false; |
| 2735 | } |
| 2736 | |
| 2737 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 2738 | type > VK_IMAGE_TYPE_END_RANGE) |
| 2739 | { |
| 2740 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2741 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageType type, is unrecognized enumerator"); |
| 2742 | return false; |
| 2743 | } |
| 2744 | |
| 2745 | |
| 2746 | if(!ValidateEnumerator((VkImageUsageFlagBits)usage)) |
| 2747 | { |
| 2748 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageUsageFlags usage, is " + EnumeratorString((VkImageUsageFlagBits)usage); |
| 2749 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2750 | return false; |
| 2751 | } |
| 2752 | |
| 2753 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 2754 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 2755 | { |
| 2756 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2757 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageTiling tiling, is unrecognized enumerator"); |
| 2758 | return false; |
| 2759 | } |
| 2760 | |
| 2761 | if(pNumProperties == nullptr) |
| 2762 | { |
| 2763 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2764 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, uint32_t* pNumProperties, is null pointer"); |
| 2765 | return false; |
| 2766 | } |
| 2767 | |
| 2768 | if(pProperties == nullptr) |
| 2769 | { |
| 2770 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2771 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkSparseImageFormatProperties* pProperties, is null pointer"); |
| 2772 | return false; |
| 2773 | } |
| 2774 | if(pProperties->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2775 | pProperties->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2776 | { |
| 2777 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2778 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspect, is unrecognized enumerator"); |
| 2779 | return false; |
| 2780 | } |
| 2781 | if(!ValidateEnumerator((VkSparseImageFormatFlagBits)pProperties->flags)) |
| 2782 | { |
| 2783 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkSparseImageFormatFlags pProperties->flags, is " + EnumeratorString((VkSparseImageFormatFlagBits)pProperties->flags); |
| 2784 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2785 | return false; |
| 2786 | } |
| 2787 | |
| 2788 | if(result != VK_SUCCESS) |
| 2789 | { |
| 2790 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2791 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2792 | return false; |
| 2793 | } |
| 2794 | |
| 2795 | return true; |
| 2796 | } |
| 2797 | |
| 2798 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2799 | VkPhysicalDevice physicalDevice, |
| 2800 | VkFormat format, |
| 2801 | VkImageType type, |
| 2802 | uint32_t samples, |
| 2803 | VkImageUsageFlags usage, |
| 2804 | VkImageTiling tiling, |
| 2805 | uint32_t* pNumProperties, |
| 2806 | VkSparseImageFormatProperties* pProperties) |
| 2807 | { |
| 2808 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties); |
| 2809 | |
| 2810 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties, result); |
| 2811 | |
| 2812 | return result; |
| 2813 | } |
| 2814 | |
| 2815 | bool PreQueueBindSparseBufferMemory( |
| 2816 | VkQueue queue, |
| 2817 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2818 | { |
| 2819 | if(pBindInfo == nullptr) |
| 2820 | { |
| 2821 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2822 | "vkQueueBindSparseBufferMemory parameter, const VkSparseMemoryBindInfo* pBindInfo, is null pointer"); |
| 2823 | return false; |
| 2824 | } |
| 2825 | |
| 2826 | return true; |
| 2827 | } |
| 2828 | |
| 2829 | bool PostQueueBindSparseBufferMemory( |
| 2830 | VkQueue queue, |
| 2831 | VkBuffer buffer, |
| 2832 | uint32_t numBindings, |
| 2833 | VkResult result) |
| 2834 | { |
| 2835 | |
| 2836 | |
| 2837 | |
| 2838 | if(result != VK_SUCCESS) |
| 2839 | { |
| 2840 | std::string reason = "vkQueueBindSparseBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2841 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2842 | return false; |
| 2843 | } |
| 2844 | |
| 2845 | return true; |
| 2846 | } |
| 2847 | |
| 2848 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory( |
| 2849 | VkQueue queue, |
| 2850 | VkBuffer buffer, |
| 2851 | uint32_t numBindings, |
| 2852 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2853 | { |
| 2854 | PreQueueBindSparseBufferMemory(queue, pBindInfo); |
| 2855 | |
| 2856 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo); |
| 2857 | |
| 2858 | PostQueueBindSparseBufferMemory(queue, buffer, numBindings, result); |
| 2859 | |
| 2860 | return result; |
| 2861 | } |
| 2862 | |
| 2863 | bool PreQueueBindSparseImageOpaqueMemory( |
| 2864 | VkQueue queue, |
| 2865 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2866 | { |
| 2867 | if(pBindInfo == nullptr) |
| 2868 | { |
| 2869 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2870 | "vkQueueBindSparseImageOpaqueMemory parameter, const VkSparseMemoryBindInfo* pBindInfo, is null pointer"); |
| 2871 | return false; |
| 2872 | } |
| 2873 | |
| 2874 | return true; |
| 2875 | } |
| 2876 | |
| 2877 | bool PostQueueBindSparseImageOpaqueMemory( |
| 2878 | VkQueue queue, |
| 2879 | VkImage image, |
| 2880 | uint32_t numBindings, |
| 2881 | VkResult result) |
| 2882 | { |
| 2883 | |
| 2884 | |
| 2885 | |
| 2886 | if(result != VK_SUCCESS) |
| 2887 | { |
| 2888 | std::string reason = "vkQueueBindSparseImageOpaqueMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2889 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2890 | return false; |
| 2891 | } |
| 2892 | |
| 2893 | return true; |
| 2894 | } |
| 2895 | |
| 2896 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory( |
| 2897 | VkQueue queue, |
| 2898 | VkImage image, |
| 2899 | uint32_t numBindings, |
| 2900 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2901 | { |
| 2902 | PreQueueBindSparseImageOpaqueMemory(queue, pBindInfo); |
| 2903 | |
| 2904 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo); |
| 2905 | |
| 2906 | PostQueueBindSparseImageOpaqueMemory(queue, image, numBindings, result); |
| 2907 | |
| 2908 | return result; |
| 2909 | } |
| 2910 | |
| 2911 | bool PreQueueBindSparseImageMemory( |
| 2912 | VkQueue queue, |
| 2913 | const VkSparseImageMemoryBindInfo* pBindInfo) |
| 2914 | { |
| 2915 | if(pBindInfo == nullptr) |
| 2916 | { |
| 2917 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2918 | "vkQueueBindSparseImageMemory parameter, const VkSparseImageMemoryBindInfo* pBindInfo, is null pointer"); |
| 2919 | return false; |
| 2920 | } |
| 2921 | if(pBindInfo->subresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2922 | pBindInfo->subresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2923 | { |
| 2924 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2925 | "vkQueueBindSparseImageMemory parameter, VkImageAspect pBindInfo->subresource.aspect, is unrecognized enumerator"); |
| 2926 | return false; |
| 2927 | } |
| 2928 | if(!ValidateEnumerator((VkSparseMemoryBindFlagBits)pBindInfo->flags)) |
| 2929 | { |
| 2930 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkSparseMemoryBindFlags pBindInfo->flags, is " + EnumeratorString((VkSparseMemoryBindFlagBits)pBindInfo->flags); |
| 2931 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2932 | return false; |
| 2933 | } |
| 2934 | |
| 2935 | return true; |
| 2936 | } |
| 2937 | |
| 2938 | bool PostQueueBindSparseImageMemory( |
| 2939 | VkQueue queue, |
| 2940 | VkImage image, |
| 2941 | uint32_t numBindings, |
| 2942 | VkResult result) |
| 2943 | { |
| 2944 | |
| 2945 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2946 | |
| 2947 | if(result != VK_SUCCESS) |
| 2948 | { |
| 2949 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2950 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2951 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2952 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2953 | |
| 2954 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2955 | } |
| 2956 | |
| 2957 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2958 | VkQueue queue, |
| 2959 | VkImage image, |
| 2960 | uint32_t numBindings, |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 2961 | const VkSparseImageMemoryBindInfo* pBindInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2962 | { |
| 2963 | PreQueueBindSparseImageMemory(queue, pBindInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2964 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 2965 | 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] | 2966 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2967 | PostQueueBindSparseImageMemory(queue, image, numBindings, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2968 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2969 | return result; |
| 2970 | } |
| 2971 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2972 | bool PreCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2973 | VkDevice device, |
| 2974 | const VkFenceCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2975 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2976 | if(pCreateInfo == nullptr) |
| 2977 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2978 | 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] | 2979 | "vkCreateFence parameter, const VkFenceCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2980 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2981 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2982 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2983 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2984 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2985 | 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] | 2986 | "vkCreateFence parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2987 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2988 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2989 | if(!ValidateEnumerator((VkFenceCreateFlagBits)pCreateInfo->flags)) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2990 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2991 | 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] | 2992 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2993 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2994 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2995 | |
| 2996 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2997 | } |
| 2998 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2999 | bool PostCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3000 | VkDevice device, |
| 3001 | VkFence* pFence, |
| 3002 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3003 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3004 | |
| 3005 | if(pFence == nullptr) |
| 3006 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3007 | 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] | 3008 | "vkCreateFence parameter, VkFence* pFence, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3009 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3010 | } |
| 3011 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 3012 | if(result != VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3013 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3014 | std::string reason = "vkCreateFence parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3015 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3016 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3017 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3018 | |
| 3019 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3020 | } |
| 3021 | |
| 3022 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFence( |
| 3023 | VkDevice device, |
| 3024 | const VkFenceCreateInfo* pCreateInfo, |
| 3025 | VkFence* pFence) |
| 3026 | { |
| 3027 | PreCreateFence(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3028 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3029 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pFence); |
| 3030 | |
| 3031 | PostCreateFence(device, pFence, result); |
| 3032 | |
| 3033 | return result; |
| 3034 | } |
| 3035 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3036 | bool PostDestroyFence( |
| 3037 | VkDevice device, |
| 3038 | VkFence fence, |
| 3039 | VkResult result) |
| 3040 | { |
| 3041 | |
| 3042 | |
| 3043 | if(result != VK_SUCCESS) |
| 3044 | { |
| 3045 | std::string reason = "vkDestroyFence parameter, VkResult result, is " + EnumeratorString(result); |
| 3046 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3047 | return false; |
| 3048 | } |
| 3049 | |
| 3050 | return true; |
| 3051 | } |
| 3052 | |
| 3053 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyFence( |
| 3054 | VkDevice device, |
| 3055 | VkFence fence) |
| 3056 | { |
| 3057 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyFence(device, fence); |
| 3058 | |
| 3059 | PostDestroyFence(device, fence, result); |
| 3060 | |
| 3061 | return result; |
| 3062 | } |
| 3063 | |
| 3064 | bool PreResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3065 | VkDevice device, |
| 3066 | const VkFence* pFences) |
| 3067 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3068 | if(pFences == nullptr) |
| 3069 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3070 | 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] | 3071 | "vkResetFences parameter, const VkFence* pFences, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3072 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3073 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3074 | |
| 3075 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3076 | } |
| 3077 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3078 | bool PostResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3079 | VkDevice device, |
| 3080 | uint32_t fenceCount, |
| 3081 | VkResult result) |
| 3082 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3083 | |
| 3084 | |
| 3085 | if(result != VK_SUCCESS) |
| 3086 | { |
| 3087 | std::string reason = "vkResetFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3088 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3089 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3090 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3091 | |
| 3092 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3093 | } |
| 3094 | |
| 3095 | VK_LAYER_EXPORT VkResult VKAPI vkResetFences( |
| 3096 | VkDevice device, |
| 3097 | uint32_t fenceCount, |
| 3098 | const VkFence* pFences) |
| 3099 | { |
| 3100 | PreResetFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3101 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3102 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences); |
| 3103 | |
| 3104 | PostResetFences(device, fenceCount, result); |
| 3105 | |
| 3106 | return result; |
| 3107 | } |
| 3108 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3109 | bool PostGetFenceStatus( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3110 | VkDevice device, |
| 3111 | VkFence fence, |
| 3112 | VkResult result) |
| 3113 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3114 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3115 | |
| 3116 | if(result != VK_SUCCESS) |
| 3117 | { |
| 3118 | std::string reason = "vkGetFenceStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3119 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3120 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3121 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3122 | |
| 3123 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3124 | } |
| 3125 | |
| 3126 | VK_LAYER_EXPORT VkResult VKAPI vkGetFenceStatus( |
| 3127 | VkDevice device, |
| 3128 | VkFence fence) |
| 3129 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3130 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence); |
| 3131 | |
| 3132 | PostGetFenceStatus(device, fence, result); |
| 3133 | |
| 3134 | return result; |
| 3135 | } |
| 3136 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3137 | bool PreWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3138 | VkDevice device, |
| 3139 | const VkFence* pFences) |
| 3140 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3141 | if(pFences == nullptr) |
| 3142 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3143 | 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] | 3144 | "vkWaitForFences parameter, const VkFence* pFences, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3145 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3146 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3147 | |
| 3148 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3149 | } |
| 3150 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3151 | bool PostWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3152 | VkDevice device, |
| 3153 | uint32_t fenceCount, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3154 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3155 | uint64_t timeout, |
| 3156 | VkResult result) |
| 3157 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3158 | |
| 3159 | |
| 3160 | |
| 3161 | |
| 3162 | if(result != VK_SUCCESS) |
| 3163 | { |
| 3164 | std::string reason = "vkWaitForFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3165 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3166 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3167 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3168 | |
| 3169 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3170 | } |
| 3171 | |
| 3172 | VK_LAYER_EXPORT VkResult VKAPI vkWaitForFences( |
| 3173 | VkDevice device, |
| 3174 | uint32_t fenceCount, |
| 3175 | const VkFence* pFences, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3176 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3177 | uint64_t timeout) |
| 3178 | { |
| 3179 | PreWaitForFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3180 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3181 | VkResult result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 3182 | |
| 3183 | PostWaitForFences(device, fenceCount, waitAll, timeout, result); |
| 3184 | |
| 3185 | return result; |
| 3186 | } |
| 3187 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3188 | bool PreCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3189 | VkDevice device, |
| 3190 | const VkSemaphoreCreateInfo* pCreateInfo) |
| 3191 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3192 | if(pCreateInfo == nullptr) |
| 3193 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3194 | 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] | 3195 | "vkCreateSemaphore parameter, const VkSemaphoreCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3196 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3197 | } |
| 3198 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3199 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3200 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3201 | 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] | 3202 | "vkCreateSemaphore parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3203 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3204 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3205 | |
| 3206 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3207 | } |
| 3208 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3209 | bool PostCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3210 | VkDevice device, |
| 3211 | VkSemaphore* pSemaphore, |
| 3212 | VkResult result) |
| 3213 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3214 | |
| 3215 | if(pSemaphore == nullptr) |
| 3216 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3217 | 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] | 3218 | "vkCreateSemaphore parameter, VkSemaphore* pSemaphore, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3219 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3220 | } |
| 3221 | |
| 3222 | if(result != VK_SUCCESS) |
| 3223 | { |
| 3224 | std::string reason = "vkCreateSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3225 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3226 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3227 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3228 | |
| 3229 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3230 | } |
| 3231 | |
| 3232 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSemaphore( |
| 3233 | VkDevice device, |
| 3234 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 3235 | VkSemaphore* pSemaphore) |
| 3236 | { |
| 3237 | PreCreateSemaphore(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3238 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3239 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pSemaphore); |
| 3240 | |
| 3241 | PostCreateSemaphore(device, pSemaphore, result); |
| 3242 | |
| 3243 | return result; |
| 3244 | } |
| 3245 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3246 | bool PostDestroySemaphore( |
| 3247 | VkDevice device, |
| 3248 | VkSemaphore semaphore, |
| 3249 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3250 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3251 | |
| 3252 | |
| 3253 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3254 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3255 | std::string reason = "vkDestroySemaphore parameter, VkResult result, is " + EnumeratorString(result); |
| 3256 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3257 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3258 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3259 | |
| 3260 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3261 | } |
| 3262 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3263 | VK_LAYER_EXPORT VkResult VKAPI vkDestroySemaphore( |
| 3264 | VkDevice device, |
| 3265 | VkSemaphore semaphore) |
| 3266 | { |
| 3267 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroySemaphore(device, semaphore); |
| 3268 | |
| 3269 | PostDestroySemaphore(device, semaphore, result); |
| 3270 | |
| 3271 | return result; |
| 3272 | } |
| 3273 | |
| 3274 | bool PostQueueSignalSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3275 | VkQueue queue, |
| 3276 | VkSemaphore semaphore, |
| 3277 | VkResult result) |
| 3278 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3279 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3280 | |
| 3281 | if(result != VK_SUCCESS) |
| 3282 | { |
| 3283 | std::string reason = "vkQueueSignalSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3284 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3285 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3286 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3287 | |
| 3288 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3289 | } |
| 3290 | |
| 3291 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSignalSemaphore( |
| 3292 | VkQueue queue, |
| 3293 | VkSemaphore semaphore) |
| 3294 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3295 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSignalSemaphore(queue, semaphore); |
| 3296 | |
| 3297 | PostQueueSignalSemaphore(queue, semaphore, result); |
| 3298 | |
| 3299 | return result; |
| 3300 | } |
| 3301 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3302 | bool PostQueueWaitSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3303 | VkQueue queue, |
| 3304 | VkSemaphore semaphore, |
| 3305 | VkResult result) |
| 3306 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3307 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3308 | |
| 3309 | if(result != VK_SUCCESS) |
| 3310 | { |
| 3311 | std::string reason = "vkQueueWaitSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3312 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3313 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3314 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3315 | |
| 3316 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3317 | } |
| 3318 | |
| 3319 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitSemaphore( |
| 3320 | VkQueue queue, |
| 3321 | VkSemaphore semaphore) |
| 3322 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3323 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitSemaphore(queue, semaphore); |
| 3324 | |
| 3325 | PostQueueWaitSemaphore(queue, semaphore, result); |
| 3326 | |
| 3327 | return result; |
| 3328 | } |
| 3329 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3330 | bool PreCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3331 | VkDevice device, |
| 3332 | const VkEventCreateInfo* pCreateInfo) |
| 3333 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3334 | if(pCreateInfo == nullptr) |
| 3335 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3336 | 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] | 3337 | "vkCreateEvent parameter, const VkEventCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3338 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3339 | } |
| 3340 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3341 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3342 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3343 | 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] | 3344 | "vkCreateEvent parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3345 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3346 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3347 | |
| 3348 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3349 | } |
| 3350 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3351 | bool PostCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3352 | VkDevice device, |
| 3353 | VkEvent* pEvent, |
| 3354 | VkResult result) |
| 3355 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3356 | |
| 3357 | if(pEvent == nullptr) |
| 3358 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3359 | 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] | 3360 | "vkCreateEvent parameter, VkEvent* pEvent, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3361 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3362 | } |
| 3363 | |
| 3364 | if(result != VK_SUCCESS) |
| 3365 | { |
| 3366 | std::string reason = "vkCreateEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3367 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3368 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3369 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3370 | |
| 3371 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3372 | } |
| 3373 | |
| 3374 | VK_LAYER_EXPORT VkResult VKAPI vkCreateEvent( |
| 3375 | VkDevice device, |
| 3376 | const VkEventCreateInfo* pCreateInfo, |
| 3377 | VkEvent* pEvent) |
| 3378 | { |
| 3379 | PreCreateEvent(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3380 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3381 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pEvent); |
| 3382 | |
| 3383 | PostCreateEvent(device, pEvent, result); |
| 3384 | |
| 3385 | return result; |
| 3386 | } |
| 3387 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3388 | bool PostDestroyEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3389 | VkDevice device, |
| 3390 | VkEvent event, |
| 3391 | VkResult result) |
| 3392 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3393 | |
| 3394 | |
| 3395 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3396 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3397 | std::string reason = "vkDestroyEvent parameter, VkResult result, is " + EnumeratorString(result); |
| 3398 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3399 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3400 | } |
| 3401 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3402 | return true; |
| 3403 | } |
| 3404 | |
| 3405 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyEvent( |
| 3406 | VkDevice device, |
| 3407 | VkEvent event) |
| 3408 | { |
| 3409 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyEvent(device, event); |
| 3410 | |
| 3411 | PostDestroyEvent(device, event, result); |
| 3412 | |
| 3413 | return result; |
| 3414 | } |
| 3415 | |
| 3416 | bool PostGetEventStatus( |
| 3417 | VkDevice device, |
| 3418 | VkEvent event, |
| 3419 | VkResult result) |
| 3420 | { |
| 3421 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3422 | |
| 3423 | if(result != VK_SUCCESS) |
| 3424 | { |
| 3425 | std::string reason = "vkGetEventStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3426 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3427 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3428 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3429 | |
| 3430 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3431 | } |
| 3432 | |
| 3433 | VK_LAYER_EXPORT VkResult VKAPI vkGetEventStatus( |
| 3434 | VkDevice device, |
| 3435 | VkEvent event) |
| 3436 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3437 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event); |
| 3438 | |
| 3439 | PostGetEventStatus(device, event, result); |
| 3440 | |
| 3441 | return result; |
| 3442 | } |
| 3443 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3444 | bool PostSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3445 | VkDevice device, |
| 3446 | VkEvent event, |
| 3447 | VkResult result) |
| 3448 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3449 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3450 | |
| 3451 | if(result != VK_SUCCESS) |
| 3452 | { |
| 3453 | std::string reason = "vkSetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3454 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3455 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3456 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3457 | |
| 3458 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3459 | } |
| 3460 | |
| 3461 | VK_LAYER_EXPORT VkResult VKAPI vkSetEvent( |
| 3462 | VkDevice device, |
| 3463 | VkEvent event) |
| 3464 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3465 | VkResult result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event); |
| 3466 | |
| 3467 | PostSetEvent(device, event, result); |
| 3468 | |
| 3469 | return result; |
| 3470 | } |
| 3471 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3472 | bool PostResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3473 | VkDevice device, |
| 3474 | VkEvent event, |
| 3475 | VkResult result) |
| 3476 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3477 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3478 | |
| 3479 | if(result != VK_SUCCESS) |
| 3480 | { |
| 3481 | std::string reason = "vkResetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3482 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3483 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3484 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3485 | |
| 3486 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3487 | } |
| 3488 | |
| 3489 | VK_LAYER_EXPORT VkResult VKAPI vkResetEvent( |
| 3490 | VkDevice device, |
| 3491 | VkEvent event) |
| 3492 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3493 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event); |
| 3494 | |
| 3495 | PostResetEvent(device, event, result); |
| 3496 | |
| 3497 | return result; |
| 3498 | } |
| 3499 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3500 | bool PreCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3501 | VkDevice device, |
| 3502 | const VkQueryPoolCreateInfo* pCreateInfo) |
| 3503 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3504 | if(pCreateInfo == nullptr) |
| 3505 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3506 | 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] | 3507 | "vkCreateQueryPool parameter, const VkQueryPoolCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3508 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3509 | } |
| 3510 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3511 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3512 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3513 | 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] | 3514 | "vkCreateQueryPool parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3515 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3516 | } |
| 3517 | if(pCreateInfo->queryType < VK_QUERY_TYPE_BEGIN_RANGE || |
| 3518 | pCreateInfo->queryType > VK_QUERY_TYPE_END_RANGE) |
| 3519 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3520 | 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] | 3521 | "vkCreateQueryPool parameter, VkQueryType pCreateInfo->queryType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3522 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3523 | } |
| 3524 | if(!ValidateEnumerator((VkQueryPipelineStatisticFlagBits)pCreateInfo->pipelineStatistics)) |
| 3525 | { |
| 3526 | 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] | 3527 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3528 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3529 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3530 | |
| 3531 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3532 | } |
| 3533 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3534 | bool PostCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3535 | VkDevice device, |
| 3536 | VkQueryPool* pQueryPool, |
| 3537 | VkResult result) |
| 3538 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3539 | |
| 3540 | if(pQueryPool == nullptr) |
| 3541 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3542 | 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] | 3543 | "vkCreateQueryPool parameter, VkQueryPool* pQueryPool, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3544 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3545 | } |
| 3546 | |
| 3547 | if(result != VK_SUCCESS) |
| 3548 | { |
| 3549 | std::string reason = "vkCreateQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3550 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3551 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3552 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3553 | |
| 3554 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3555 | } |
| 3556 | |
| 3557 | VK_LAYER_EXPORT VkResult VKAPI vkCreateQueryPool( |
| 3558 | VkDevice device, |
| 3559 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3560 | VkQueryPool* pQueryPool) |
| 3561 | { |
| 3562 | PreCreateQueryPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3563 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3564 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 3565 | |
| 3566 | PostCreateQueryPool(device, pQueryPool, result); |
| 3567 | |
| 3568 | return result; |
| 3569 | } |
| 3570 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3571 | bool PostDestroyQueryPool( |
| 3572 | VkDevice device, |
| 3573 | VkQueryPool queryPool, |
| 3574 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3575 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3576 | |
| 3577 | |
| 3578 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3579 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3580 | std::string reason = "vkDestroyQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
| 3581 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3582 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3583 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3584 | |
| 3585 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3586 | } |
| 3587 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3588 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyQueryPool( |
| 3589 | VkDevice device, |
| 3590 | VkQueryPool queryPool) |
| 3591 | { |
| 3592 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyQueryPool(device, queryPool); |
| 3593 | |
| 3594 | PostDestroyQueryPool(device, queryPool, result); |
| 3595 | |
| 3596 | return result; |
| 3597 | } |
| 3598 | |
| 3599 | bool PostGetQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3600 | VkDevice device, |
| 3601 | VkQueryPool queryPool, |
| 3602 | uint32_t startQuery, |
| 3603 | uint32_t queryCount, |
| 3604 | size_t* pDataSize, |
| 3605 | void* pData, |
| 3606 | VkQueryResultFlags flags, |
| 3607 | VkResult result) |
| 3608 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3609 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3610 | |
| 3611 | |
| 3612 | |
| 3613 | if(pDataSize == nullptr) |
| 3614 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3615 | 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] | 3616 | "vkGetQueryPoolResults parameter, size_t* pDataSize, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3617 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3618 | } |
| 3619 | |
| 3620 | if(pData == nullptr) |
| 3621 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3622 | 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] | 3623 | "vkGetQueryPoolResults parameter, void* pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3624 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3625 | } |
| 3626 | |
| 3627 | if(!ValidateEnumerator((VkQueryResultFlagBits)flags)) |
| 3628 | { |
| 3629 | std::string reason = "vkGetQueryPoolResults parameter, VkQueryResultFlags flags, is " + EnumeratorString((VkQueryResultFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3630 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3631 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3632 | } |
| 3633 | |
| 3634 | if(result != VK_SUCCESS) |
| 3635 | { |
| 3636 | std::string reason = "vkGetQueryPoolResults parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3637 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3638 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3639 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3640 | |
| 3641 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3642 | } |
| 3643 | |
| 3644 | VK_LAYER_EXPORT VkResult VKAPI vkGetQueryPoolResults( |
| 3645 | VkDevice device, |
| 3646 | VkQueryPool queryPool, |
| 3647 | uint32_t startQuery, |
| 3648 | uint32_t queryCount, |
| 3649 | size_t* pDataSize, |
| 3650 | void* pData, |
| 3651 | VkQueryResultFlags flags) |
| 3652 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3653 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags); |
| 3654 | |
| 3655 | PostGetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags, result); |
| 3656 | |
| 3657 | return result; |
| 3658 | } |
| 3659 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3660 | bool PreCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3661 | VkDevice device, |
| 3662 | const VkBufferCreateInfo* pCreateInfo) |
| 3663 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3664 | if(pCreateInfo == nullptr) |
| 3665 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3666 | 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] | 3667 | "vkCreateBuffer parameter, const VkBufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3668 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3669 | } |
| 3670 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3671 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3672 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3673 | 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] | 3674 | "vkCreateBuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3675 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3676 | } |
| 3677 | if(!ValidateEnumerator((VkBufferUsageFlagBits)pCreateInfo->usage)) |
| 3678 | { |
| 3679 | 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] | 3680 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3681 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3682 | } |
| 3683 | if(!ValidateEnumerator((VkBufferCreateFlagBits)pCreateInfo->flags)) |
| 3684 | { |
| 3685 | 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] | 3686 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3687 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3688 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3689 | |
| 3690 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3691 | } |
| 3692 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3693 | bool PostCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3694 | VkDevice device, |
| 3695 | VkBuffer* pBuffer, |
| 3696 | VkResult result) |
| 3697 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3698 | |
| 3699 | if(pBuffer == nullptr) |
| 3700 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3701 | 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] | 3702 | "vkCreateBuffer parameter, VkBuffer* pBuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3703 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3704 | } |
| 3705 | |
| 3706 | if(result != VK_SUCCESS) |
| 3707 | { |
| 3708 | std::string reason = "vkCreateBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3709 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3710 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3711 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3712 | |
| 3713 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3714 | } |
| 3715 | |
| 3716 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBuffer( |
| 3717 | VkDevice device, |
| 3718 | const VkBufferCreateInfo* pCreateInfo, |
| 3719 | VkBuffer* pBuffer) |
| 3720 | { |
| 3721 | PreCreateBuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3722 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3723 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pBuffer); |
| 3724 | |
| 3725 | PostCreateBuffer(device, pBuffer, result); |
| 3726 | |
| 3727 | return result; |
| 3728 | } |
| 3729 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3730 | bool PostDestroyBuffer( |
| 3731 | VkDevice device, |
| 3732 | VkBuffer buffer, |
| 3733 | VkResult result) |
| 3734 | { |
| 3735 | |
| 3736 | |
| 3737 | if(result != VK_SUCCESS) |
| 3738 | { |
| 3739 | std::string reason = "vkDestroyBuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 3740 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3741 | return false; |
| 3742 | } |
| 3743 | |
| 3744 | return true; |
| 3745 | } |
| 3746 | |
| 3747 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyBuffer( |
| 3748 | VkDevice device, |
| 3749 | VkBuffer buffer) |
| 3750 | { |
| 3751 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyBuffer(device, buffer); |
| 3752 | |
| 3753 | PostDestroyBuffer(device, buffer, result); |
| 3754 | |
| 3755 | return result; |
| 3756 | } |
| 3757 | |
| 3758 | bool PreCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3759 | VkDevice device, |
| 3760 | const VkBufferViewCreateInfo* pCreateInfo) |
| 3761 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3762 | if(pCreateInfo == nullptr) |
| 3763 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3764 | 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] | 3765 | "vkCreateBufferView parameter, const VkBufferViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3766 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3767 | } |
| 3768 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3769 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3770 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3771 | 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] | 3772 | "vkCreateBufferView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3773 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3774 | } |
| 3775 | if(pCreateInfo->viewType < VK_BUFFER_VIEW_TYPE_BEGIN_RANGE || |
| 3776 | pCreateInfo->viewType > VK_BUFFER_VIEW_TYPE_END_RANGE) |
| 3777 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3778 | 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] | 3779 | "vkCreateBufferView parameter, VkBufferViewType pCreateInfo->viewType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3780 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3781 | } |
| 3782 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3783 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3784 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3785 | 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] | 3786 | "vkCreateBufferView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3787 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3788 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3789 | |
| 3790 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3791 | } |
| 3792 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3793 | bool PostCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3794 | VkDevice device, |
| 3795 | VkBufferView* pView, |
| 3796 | VkResult result) |
| 3797 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3798 | |
| 3799 | if(pView == nullptr) |
| 3800 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3801 | 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] | 3802 | "vkCreateBufferView parameter, VkBufferView* pView, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3803 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3804 | } |
| 3805 | |
| 3806 | if(result != VK_SUCCESS) |
| 3807 | { |
| 3808 | std::string reason = "vkCreateBufferView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3809 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3810 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3811 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3812 | |
| 3813 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3814 | } |
| 3815 | |
| 3816 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBufferView( |
| 3817 | VkDevice device, |
| 3818 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3819 | VkBufferView* pView) |
| 3820 | { |
| 3821 | PreCreateBufferView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3822 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3823 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pView); |
| 3824 | |
| 3825 | PostCreateBufferView(device, pView, result); |
| 3826 | |
| 3827 | return result; |
| 3828 | } |
| 3829 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3830 | bool PostDestroyBufferView( |
| 3831 | VkDevice device, |
| 3832 | VkBufferView bufferView, |
| 3833 | VkResult result) |
| 3834 | { |
| 3835 | |
| 3836 | |
| 3837 | if(result != VK_SUCCESS) |
| 3838 | { |
| 3839 | std::string reason = "vkDestroyBufferView parameter, VkResult result, is " + EnumeratorString(result); |
| 3840 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3841 | return false; |
| 3842 | } |
| 3843 | |
| 3844 | return true; |
| 3845 | } |
| 3846 | |
| 3847 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyBufferView( |
| 3848 | VkDevice device, |
| 3849 | VkBufferView bufferView) |
| 3850 | { |
| 3851 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyBufferView(device, bufferView); |
| 3852 | |
| 3853 | PostDestroyBufferView(device, bufferView, result); |
| 3854 | |
| 3855 | return result; |
| 3856 | } |
| 3857 | |
| 3858 | bool PreCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3859 | VkDevice device, |
| 3860 | const VkImageCreateInfo* pCreateInfo) |
| 3861 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3862 | if(pCreateInfo == nullptr) |
| 3863 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3864 | 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] | 3865 | "vkCreateImage parameter, const VkImageCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3866 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3867 | } |
| 3868 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3869 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3870 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3871 | 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] | 3872 | "vkCreateImage parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3873 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3874 | } |
| 3875 | if(pCreateInfo->imageType < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 3876 | pCreateInfo->imageType > VK_IMAGE_TYPE_END_RANGE) |
| 3877 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3878 | 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] | 3879 | "vkCreateImage parameter, VkImageType pCreateInfo->imageType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3880 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3881 | } |
| 3882 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3883 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3884 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3885 | 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] | 3886 | "vkCreateImage parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3887 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3888 | } |
| 3889 | if(pCreateInfo->tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 3890 | pCreateInfo->tiling > VK_IMAGE_TILING_END_RANGE) |
| 3891 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3892 | 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] | 3893 | "vkCreateImage parameter, VkImageTiling pCreateInfo->tiling, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3894 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3895 | } |
| 3896 | if(!ValidateEnumerator((VkImageUsageFlagBits)pCreateInfo->usage)) |
| 3897 | { |
| 3898 | 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] | 3899 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3900 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3901 | } |
| 3902 | if(!ValidateEnumerator((VkImageCreateFlagBits)pCreateInfo->flags)) |
| 3903 | { |
| 3904 | 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] | 3905 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3906 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3907 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3908 | |
| 3909 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3910 | } |
| 3911 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3912 | bool PostCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3913 | VkDevice device, |
| 3914 | VkImage* pImage, |
| 3915 | VkResult result) |
| 3916 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3917 | |
| 3918 | if(pImage == nullptr) |
| 3919 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3920 | 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] | 3921 | "vkCreateImage parameter, VkImage* pImage, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3922 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3923 | } |
| 3924 | |
| 3925 | if(result != VK_SUCCESS) |
| 3926 | { |
| 3927 | std::string reason = "vkCreateImage parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3928 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3929 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3930 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3931 | |
| 3932 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3933 | } |
| 3934 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3935 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImage( |
| 3936 | VkDevice device, |
| 3937 | const VkImageCreateInfo* pCreateInfo, |
| 3938 | VkImage* pImage) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3939 | { |
| 3940 | PreCreateImage(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3941 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3942 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pImage); |
| 3943 | |
| 3944 | PostCreateImage(device, pImage, result); |
| 3945 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3946 | return result; |
| 3947 | } |
| 3948 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3949 | bool PostDestroyImage( |
| 3950 | VkDevice device, |
| 3951 | VkImage image, |
| 3952 | VkResult result) |
| 3953 | { |
| 3954 | |
| 3955 | |
| 3956 | if(result != VK_SUCCESS) |
| 3957 | { |
| 3958 | std::string reason = "vkDestroyImage parameter, VkResult result, is " + EnumeratorString(result); |
| 3959 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3960 | return false; |
| 3961 | } |
| 3962 | |
| 3963 | return true; |
| 3964 | } |
| 3965 | |
| 3966 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyImage( |
| 3967 | VkDevice device, |
| 3968 | VkImage image) |
| 3969 | { |
| 3970 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyImage(device, image); |
| 3971 | |
| 3972 | PostDestroyImage(device, image, result); |
| 3973 | |
| 3974 | return result; |
| 3975 | } |
| 3976 | |
| 3977 | bool PreGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3978 | VkDevice device, |
| 3979 | const VkImageSubresource* pSubresource) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3980 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3981 | if(pSubresource == nullptr) |
| 3982 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3983 | 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] | 3984 | "vkGetImageSubresourceLayout parameter, const VkImageSubresource* pSubresource, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3985 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3986 | } |
| 3987 | if(pSubresource->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 3988 | pSubresource->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 3989 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3990 | 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] | 3991 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3992 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3993 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3994 | |
| 3995 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3996 | } |
| 3997 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3998 | bool PostGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3999 | VkDevice device, |
| 4000 | VkImage image, |
| 4001 | VkSubresourceLayout* pLayout, |
| 4002 | VkResult result) |
| 4003 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4004 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4005 | |
| 4006 | if(pLayout == nullptr) |
| 4007 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4008 | 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] | 4009 | "vkGetImageSubresourceLayout parameter, VkSubresourceLayout* pLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4010 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4011 | } |
| 4012 | |
| 4013 | if(result != VK_SUCCESS) |
| 4014 | { |
| 4015 | std::string reason = "vkGetImageSubresourceLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4016 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4017 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4018 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4019 | |
| 4020 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4021 | } |
| 4022 | |
| 4023 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout( |
| 4024 | VkDevice device, |
| 4025 | VkImage image, |
| 4026 | const VkImageSubresource* pSubresource, |
| 4027 | VkSubresourceLayout* pLayout) |
| 4028 | { |
| 4029 | PreGetImageSubresourceLayout(device, pSubresource); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4030 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4031 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
| 4032 | |
| 4033 | PostGetImageSubresourceLayout(device, image, pLayout, result); |
| 4034 | |
| 4035 | return result; |
| 4036 | } |
| 4037 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4038 | bool PreCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4039 | VkDevice device, |
| 4040 | const VkImageViewCreateInfo* pCreateInfo) |
| 4041 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4042 | if(pCreateInfo == nullptr) |
| 4043 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4044 | 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] | 4045 | "vkCreateImageView parameter, const VkImageViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4046 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4047 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4048 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4049 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4050 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4051 | 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] | 4052 | "vkCreateImageView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4053 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4054 | } |
| 4055 | if(pCreateInfo->viewType < VK_IMAGE_VIEW_TYPE_BEGIN_RANGE || |
| 4056 | pCreateInfo->viewType > VK_IMAGE_VIEW_TYPE_END_RANGE) |
| 4057 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4058 | 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] | 4059 | "vkCreateImageView parameter, VkImageViewType pCreateInfo->viewType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4060 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4061 | } |
| 4062 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4063 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4064 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4065 | 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] | 4066 | "vkCreateImageView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4067 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4068 | } |
| 4069 | if(pCreateInfo->channels.r < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4070 | pCreateInfo->channels.r > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4071 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4072 | 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] | 4073 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.r, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4074 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4075 | } |
| 4076 | if(pCreateInfo->channels.g < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4077 | pCreateInfo->channels.g > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4078 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4079 | 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] | 4080 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.g, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4081 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4082 | } |
| 4083 | if(pCreateInfo->channels.b < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4084 | pCreateInfo->channels.b > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4085 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4086 | 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] | 4087 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.b, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4088 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4089 | } |
| 4090 | if(pCreateInfo->channels.a < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4091 | pCreateInfo->channels.a > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4092 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4093 | 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] | 4094 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.a, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4095 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4096 | } |
| 4097 | if(pCreateInfo->subresourceRange.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 4098 | pCreateInfo->subresourceRange.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 4099 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4100 | 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] | 4101 | "vkCreateImageView parameter, VkImageAspect pCreateInfo->subresourceRange.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4102 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4103 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4104 | |
| 4105 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4106 | } |
| 4107 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4108 | bool PostCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4109 | VkDevice device, |
| 4110 | VkImageView* pView, |
| 4111 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4112 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4113 | |
| 4114 | if(pView == nullptr) |
| 4115 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4116 | 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] | 4117 | "vkCreateImageView parameter, VkImageView* pView, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4118 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4119 | } |
| 4120 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 4121 | if(result != VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4122 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4123 | std::string reason = "vkCreateImageView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4124 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4125 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4126 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4127 | |
| 4128 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4129 | } |
| 4130 | |
| 4131 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImageView( |
| 4132 | VkDevice device, |
| 4133 | const VkImageViewCreateInfo* pCreateInfo, |
| 4134 | VkImageView* pView) |
| 4135 | { |
| 4136 | PreCreateImageView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4137 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4138 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pView); |
| 4139 | |
| 4140 | PostCreateImageView(device, pView, result); |
| 4141 | |
| 4142 | return result; |
| 4143 | } |
| 4144 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4145 | bool PostDestroyImageView( |
| 4146 | VkDevice device, |
| 4147 | VkImageView imageView, |
| 4148 | VkResult result) |
| 4149 | { |
| 4150 | |
| 4151 | |
| 4152 | if(result != VK_SUCCESS) |
| 4153 | { |
| 4154 | std::string reason = "vkDestroyImageView parameter, VkResult result, is " + EnumeratorString(result); |
| 4155 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4156 | return false; |
| 4157 | } |
| 4158 | |
| 4159 | return true; |
| 4160 | } |
| 4161 | |
| 4162 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyImageView( |
| 4163 | VkDevice device, |
| 4164 | VkImageView imageView) |
| 4165 | { |
| 4166 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyImageView(device, imageView); |
| 4167 | |
| 4168 | PostDestroyImageView(device, imageView, result); |
| 4169 | |
| 4170 | return result; |
| 4171 | } |
| 4172 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4173 | void PreCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4174 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4175 | const VkAttachmentViewCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4176 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4177 | if(pCreateInfo == nullptr) |
| 4178 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4179 | 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] | 4180 | "vkCreateAttachmentView parameter, const VkAttachmentViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4181 | return; |
| 4182 | } |
| 4183 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4184 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4185 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4186 | 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] | 4187 | "vkCreateAttachmentView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4188 | return; |
| 4189 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4190 | if(pCreateInfo->image.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4191 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4192 | 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] | 4193 | "vkCreateAttachmentView parameter, VkImage pCreateInfo->image, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4194 | return; |
| 4195 | } |
| 4196 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4197 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4198 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4199 | 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] | 4200 | "vkCreateAttachmentView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4201 | return; |
| 4202 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4203 | if(!ValidateEnumerator((VkAttachmentViewCreateFlagBits)pCreateInfo->flags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4204 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4205 | 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] | 4206 | 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] | 4207 | return; |
| 4208 | } |
| 4209 | } |
| 4210 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4211 | bool PostDestroyAttachmentView( |
| 4212 | VkDevice device, |
| 4213 | VkAttachmentView attachmentView, |
| 4214 | VkResult result) |
| 4215 | { |
| 4216 | |
| 4217 | |
| 4218 | if(result != VK_SUCCESS) |
| 4219 | { |
| 4220 | std::string reason = "vkDestroyAttachmentView parameter, VkResult result, is " + EnumeratorString(result); |
| 4221 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4222 | return false; |
| 4223 | } |
| 4224 | |
| 4225 | return true; |
| 4226 | } |
| 4227 | |
| 4228 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyAttachmentView( |
| 4229 | VkDevice device, |
| 4230 | VkAttachmentView attachmentView) |
| 4231 | { |
| 4232 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyAttachmentView(device, attachmentView); |
| 4233 | |
| 4234 | PostDestroyAttachmentView(device, attachmentView, result); |
| 4235 | |
| 4236 | return result; |
| 4237 | } |
| 4238 | |
| 4239 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4240 | void PostCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4241 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4242 | VkAttachmentView* pView, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4243 | VkResult result) |
| 4244 | { |
| 4245 | if(device == nullptr) |
| 4246 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4247 | 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] | 4248 | "vkCreateAttachmentView parameter, VkDevice device, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4249 | return; |
| 4250 | } |
| 4251 | |
| 4252 | if(pView == nullptr) |
| 4253 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4254 | 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] | 4255 | "vkCreateAttachmentView parameter, VkAttachmentView* pView, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4256 | return; |
| 4257 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4258 | if((*pView).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4259 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4260 | 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] | 4261 | "vkCreateAttachmentView parameter, VkAttachmentView* pView, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4262 | return; |
| 4263 | } |
| 4264 | |
| 4265 | if(result != VK_SUCCESS) |
| 4266 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4267 | std::string reason = "vkCreateAttachmentView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4268 | 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] | 4269 | return; |
| 4270 | } |
| 4271 | } |
| 4272 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4273 | VK_LAYER_EXPORT VkResult VKAPI vkCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4274 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4275 | const VkAttachmentViewCreateInfo* pCreateInfo, |
| 4276 | VkAttachmentView* pView) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4277 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4278 | PreCreateAttachmentView(device, pCreateInfo); |
| 4279 | 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] | 4280 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4281 | PostCreateAttachmentView(device, pView, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4282 | |
| 4283 | return result; |
| 4284 | } |
| 4285 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4286 | bool PostDestroyShaderModule( |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4287 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4288 | VkShaderModule shaderModule, |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4289 | VkResult result) |
| 4290 | { |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4291 | |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4292 | |
| 4293 | if(result != VK_SUCCESS) |
| 4294 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4295 | std::string reason = "vkDestroyShaderModule parameter, VkResult result, is " + EnumeratorString(result); |
| 4296 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4297 | return false; |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4298 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4299 | |
| 4300 | return true; |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4301 | } |
| 4302 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4303 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyShaderModule( |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4304 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4305 | VkShaderModule shaderModule) |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4306 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4307 | 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] | 4308 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4309 | PostDestroyShaderModule(device, shaderModule, result); |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4310 | |
| 4311 | return result; |
| 4312 | } |
| 4313 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4314 | bool PreCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4315 | VkDevice device, |
| 4316 | const VkShaderCreateInfo* pCreateInfo) |
| 4317 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4318 | if(pCreateInfo == nullptr) |
| 4319 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4320 | 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] | 4321 | "vkCreateShader parameter, const VkShaderCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4322 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4323 | } |
| 4324 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4325 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4326 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4327 | 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] | 4328 | "vkCreateShader parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4329 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4330 | } |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4331 | if(pCreateInfo->pName == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4332 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4333 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4334 | "vkCreateShader parameter, const char* pCreateInfo->pName, is null pointer"); |
| 4335 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4336 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4337 | |
| 4338 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4339 | } |
| 4340 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4341 | bool PostCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4342 | VkDevice device, |
| 4343 | VkShader* pShader, |
| 4344 | VkResult result) |
| 4345 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4346 | |
| 4347 | if(pShader == nullptr) |
| 4348 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4349 | 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] | 4350 | "vkCreateShader parameter, VkShader* pShader, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4351 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4352 | } |
| 4353 | |
| 4354 | if(result != VK_SUCCESS) |
| 4355 | { |
| 4356 | std::string reason = "vkCreateShader parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4357 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4358 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4359 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4360 | |
| 4361 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4362 | } |
| 4363 | |
| 4364 | VK_LAYER_EXPORT VkResult VKAPI vkCreateShader( |
| 4365 | VkDevice device, |
| 4366 | const VkShaderCreateInfo* pCreateInfo, |
| 4367 | VkShader* pShader) |
| 4368 | { |
| 4369 | PreCreateShader(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4370 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4371 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateShader(device, pCreateInfo, pShader); |
| 4372 | |
| 4373 | PostCreateShader(device, pShader, result); |
| 4374 | |
| 4375 | return result; |
| 4376 | } |
| 4377 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4378 | bool PostDestroyShader( |
| 4379 | VkDevice device, |
| 4380 | VkShader shader, |
| 4381 | VkResult result) |
| 4382 | { |
| 4383 | if(result != VK_SUCCESS) |
| 4384 | { |
| 4385 | std::string reason = "vkDestroyShader parameter, VkResult result, is " + EnumeratorString(result); |
| 4386 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4387 | return false; |
| 4388 | } |
| 4389 | |
| 4390 | return true; |
| 4391 | } |
| 4392 | |
| 4393 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyShader( |
| 4394 | VkDevice device, |
| 4395 | VkShader shader) |
| 4396 | { |
| 4397 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyShader(device, shader); |
| 4398 | |
| 4399 | PostDestroyShader(device, shader, result); |
| 4400 | |
| 4401 | return result; |
| 4402 | } |
| 4403 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 4404 | //TODO handle count > 1 |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4405 | bool PreCreateGraphicsPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4406 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 4407 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4408 | const VkGraphicsPipelineCreateInfo* pCreateInfo) |
| 4409 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4410 | if(pCreateInfo == nullptr) |
| 4411 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4412 | 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] | 4413 | "vkCreateGraphicsPipeline parameter, const VkGraphicsPipelineCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4414 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4415 | } |
| 4416 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4417 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4418 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4419 | 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] | 4420 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4421 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4422 | } |
| 4423 | if(pCreateInfo->pStages == nullptr) |
| 4424 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4425 | 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] | 4426 | "vkCreateGraphicsPipeline parameter, const VkPipelineShaderStageCreateInfo* pCreateInfo->pStages, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4427 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4428 | } |
| 4429 | if(pCreateInfo->pStages->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4430 | pCreateInfo->pStages->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4431 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4432 | 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] | 4433 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pStages->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4434 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4435 | } |
| 4436 | if(pCreateInfo->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4437 | pCreateInfo->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4438 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4439 | 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] | 4440 | "vkCreateGraphicsPipeline parameter, VkShaderStage pCreateInfo->pStages->stage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4441 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4442 | } |
| 4443 | if(pCreateInfo->pStages->pSpecializationInfo == nullptr) |
| 4444 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4445 | 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] | 4446 | "vkCreateGraphicsPipeline parameter, const VkSpecializationInfo* pCreateInfo->pStages->pSpecializationInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4447 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4448 | } |
| 4449 | if(pCreateInfo->pStages->pSpecializationInfo->pMap == nullptr) |
| 4450 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4451 | 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] | 4452 | "vkCreateGraphicsPipeline parameter, const VkSpecializationMapEntry* pCreateInfo->pStages->pSpecializationInfo->pMap, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4453 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4454 | } |
| 4455 | if(pCreateInfo->pStages->pSpecializationInfo->pData == nullptr) |
| 4456 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4457 | 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] | 4458 | "vkCreateGraphicsPipeline parameter, const void* pCreateInfo->pStages->pSpecializationInfo->pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4459 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4460 | } |
| 4461 | if(pCreateInfo->pVertexInputState == nullptr) |
| 4462 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4463 | 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] | 4464 | "vkCreateGraphicsPipeline parameter, const VkPipelineVertexInputStateCreateInfo* pCreateInfo->pVertexInputState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4465 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4466 | } |
| 4467 | if(pCreateInfo->pVertexInputState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4468 | pCreateInfo->pVertexInputState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4469 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4470 | 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] | 4471 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pVertexInputState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4472 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4473 | } |
| 4474 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions == nullptr) |
| 4475 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4476 | 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] | 4477 | "vkCreateGraphicsPipeline parameter, const VkVertexInputBindingDescription* pCreateInfo->pVertexInputState->pVertexBindingDescriptions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4478 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4479 | } |
| 4480 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4481 | pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4482 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4483 | 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] | 4484 | "vkCreateGraphicsPipeline parameter, VkVertexInputStepRate pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4485 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4486 | } |
| 4487 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions == nullptr) |
| 4488 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4489 | 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] | 4490 | "vkCreateGraphicsPipeline parameter, const VkVertexInputAttributeDescription* pCreateInfo->pVertexInputState->pVertexAttributeDescriptions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4491 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4492 | } |
| 4493 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4494 | pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4495 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4496 | 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] | 4497 | "vkCreateGraphicsPipeline parameter, VkFormat pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4498 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4499 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4500 | if(pCreateInfo->pInputAssemblyState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4501 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4502 | 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] | 4503 | "vkCreateGraphicsPipeline parameter, const VkPipelineIaStateCreateInfo* pCreateInfo->pIaState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4504 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4505 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4506 | if(pCreateInfo->pInputAssemblyState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4507 | pCreateInfo->pInputAssemblyState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4508 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4509 | 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] | 4510 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pIaState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4511 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4512 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4513 | if(pCreateInfo->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4514 | pCreateInfo->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4515 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4516 | 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] | 4517 | "vkCreateGraphicsPipeline parameter, VkPrimitiveTopology pCreateInfo->pIaState->topology, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4518 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4519 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4520 | if(pCreateInfo->pTessellationState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4521 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4522 | 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] | 4523 | "vkCreateGraphicsPipeline parameter, const VkPipelineTessStateCreateInfo* pCreateInfo->pTessState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4524 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4525 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4526 | if(pCreateInfo->pTessellationState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4527 | pCreateInfo->pTessellationState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4528 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4529 | 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] | 4530 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pTessState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4531 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4532 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4533 | if(pCreateInfo->pViewportState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4534 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4535 | 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] | 4536 | "vkCreateGraphicsPipeline parameter, const VkPipelineVpStateCreateInfo* pCreateInfo->pVpState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4537 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4538 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4539 | if(pCreateInfo->pViewportState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4540 | pCreateInfo->pViewportState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4541 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4542 | 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] | 4543 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pVpState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4544 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4545 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4546 | if(pCreateInfo->pViewportState->clipOrigin < VK_COORDINATE_ORIGIN_BEGIN_RANGE || |
| 4547 | pCreateInfo->pViewportState->clipOrigin > VK_COORDINATE_ORIGIN_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4548 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4549 | 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] | 4550 | "vkCreateGraphicsPipeline parameter, VkCoordinateOrigin pCreateInfo->pVpState->clipOrigin, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4551 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4552 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4553 | if(pCreateInfo->pViewportState->depthMode < VK_DEPTH_MODE_BEGIN_RANGE || |
| 4554 | pCreateInfo->pViewportState->depthMode > VK_DEPTH_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4555 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4556 | 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] | 4557 | "vkCreateGraphicsPipeline parameter, VkDepthMode pCreateInfo->pVpState->depthMode, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4558 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4559 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4560 | if(pCreateInfo->pRasterState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4561 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4562 | 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] | 4563 | "vkCreateGraphicsPipeline parameter, const VkPipelineRsStateCreateInfo* pCreateInfo->pRsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4564 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4565 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4566 | if(pCreateInfo->pRasterState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4567 | pCreateInfo->pRasterState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4568 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4569 | 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] | 4570 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pRsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4571 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4572 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4573 | if(pCreateInfo->pRasterState->pointOrigin < VK_COORDINATE_ORIGIN_BEGIN_RANGE || |
| 4574 | pCreateInfo->pRasterState->pointOrigin > VK_COORDINATE_ORIGIN_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4575 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4576 | 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] | 4577 | "vkCreateGraphicsPipeline parameter, VkCoordinateOrigin pCreateInfo->pRsState->pointOrigin, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4578 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4579 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4580 | if(pCreateInfo->pRasterState->provokingVertex < VK_PROVOKING_VERTEX_BEGIN_RANGE || |
| 4581 | pCreateInfo->pRasterState->provokingVertex > VK_PROVOKING_VERTEX_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4582 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4583 | 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] | 4584 | "vkCreateGraphicsPipeline parameter, VkProvokingVertex pCreateInfo->pRsState->provokingVertex, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4585 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4586 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4587 | if(pCreateInfo->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 4588 | pCreateInfo->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
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, VkFillMode pCreateInfo->pRsState->fillMode, is unrecognized enumerator"); |
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->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 4595 | pCreateInfo->pRasterState->cullMode > VK_CULL_MODE_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, VkCullMode pCreateInfo->pRsState->cullMode, 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->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 4602 | pCreateInfo->pRasterState->frontFace > VK_FRONT_FACE_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, VkFrontFace pCreateInfo->pRsState->frontFace, 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->pMultisampleState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4609 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4610 | 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] | 4611 | "vkCreateGraphicsPipeline parameter, const VkPipelineMsStateCreateInfo* pCreateInfo->pMsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4612 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4613 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4614 | if(pCreateInfo->pMultisampleState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4615 | pCreateInfo->pMultisampleState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4616 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4617 | 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] | 4618 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pMsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4619 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4620 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4621 | if(pCreateInfo->pDepthStencilState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4622 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4623 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4624 | "vkCreateGraphicsPipeline parameter, const VkPipelineDsStateCreateInfo* pCreateInfo->pDsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4625 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4626 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4627 | if(pCreateInfo->pDepthStencilState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4628 | pCreateInfo->pDepthStencilState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4629 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4630 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4631 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pDsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4632 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4633 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4634 | if(pCreateInfo->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4635 | pCreateInfo->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4636 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4637 | 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] | 4638 | "vkCreateGraphicsPipeline parameter, VkCompareOp pCreateInfo->pDsState->depthCompareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4639 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4640 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4641 | if(pCreateInfo->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4642 | pCreateInfo->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4643 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4644 | 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] | 4645 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4646 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4647 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4648 | if(pCreateInfo->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4649 | pCreateInfo->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4650 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4651 | 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] | 4652 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilPassOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4653 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4654 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4655 | if(pCreateInfo->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4656 | pCreateInfo->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4657 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4658 | 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] | 4659 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilDepthFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4660 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4661 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4662 | if(pCreateInfo->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4663 | pCreateInfo->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4664 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4665 | 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] | 4666 | "vkCreateGraphicsPipeline parameter, VkCompareOp pCreateInfo->pDsState->front.stencilCompareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4667 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4668 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4669 | if(pCreateInfo->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4670 | pCreateInfo->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4671 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4672 | 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] | 4673 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->back.stencilFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4674 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4675 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4676 | if(pCreateInfo->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4677 | pCreateInfo->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4678 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4679 | 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] | 4680 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->back.stencilPassOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4681 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4682 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4683 | if(pCreateInfo->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4684 | pCreateInfo->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
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, VkStencilOp pCreateInfo->pDsState->back.stencilDepthFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4688 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4689 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4690 | if(pCreateInfo->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4691 | pCreateInfo->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_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, VkCompareOp pCreateInfo->pDsState->back.stencilCompareOp, 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 == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4698 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4699 | 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] | 4700 | "vkCreateGraphicsPipeline parameter, const VkPipelineCbStateCreateInfo* pCreateInfo->pCbState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4701 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4702 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4703 | if(pCreateInfo->pColorBlendState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4704 | pCreateInfo->pColorBlendState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4705 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4706 | 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] | 4707 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pCbState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4708 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4709 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4710 | if(pCreateInfo->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 4711 | pCreateInfo->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4712 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4713 | 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] | 4714 | "vkCreateGraphicsPipeline parameter, VkLogicOp pCreateInfo->pCbState->logicOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4715 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4716 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4717 | if(pCreateInfo->pColorBlendState->pAttachments == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4718 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4719 | 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] | 4720 | "vkCreateGraphicsPipeline parameter, const VkPipelineCbAttachmentState* pCreateInfo->pCbState->pAttachments, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4721 | return false; |
| 4722 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4723 | if(pCreateInfo->pColorBlendState->pAttachments->format < VK_FORMAT_BEGIN_RANGE || |
| 4724 | pCreateInfo->pColorBlendState->pAttachments->format > VK_FORMAT_END_RANGE) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4725 | { |
| 4726 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4727 | "vkCreateGraphicsPipeline parameter, VkFormat pCreateInfo->pCbState->pAttachments->format, is unrecognized enumerator"); |
| 4728 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4729 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4730 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4731 | pCreateInfo->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4732 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4733 | 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] | 4734 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4735 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4736 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4737 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4738 | pCreateInfo->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4739 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4740 | 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] | 4741 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4742 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4743 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4744 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 4745 | pCreateInfo->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4746 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4747 | 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] | 4748 | "vkCreateGraphicsPipeline parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4749 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4750 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4751 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4752 | pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4753 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4754 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4755 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4756 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4757 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4758 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4759 | pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4760 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4761 | 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] | 4762 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4763 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4764 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4765 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 4766 | pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4767 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4768 | 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] | 4769 | "vkCreateGraphicsPipeline parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4770 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4771 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4772 | if(!ValidateEnumerator((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4773 | { |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4774 | std::string reason = "vkCreateGraphicsPipeline parameter, VkChannelFlags pCreateInfo->pCbState->pAttachments->channelWriteMask, is " + EnumeratorString((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask); |
| 4775 | 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] | 4776 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4777 | } |
| 4778 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 4779 | { |
| 4780 | 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] | 4781 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4782 | return false; |
| 4783 | } |
| 4784 | |
| 4785 | return true; |
| 4786 | } |
| 4787 | |
| 4788 | bool PostCreateGraphicsPipeline( |
| 4789 | VkDevice device, |
| 4790 | VkPipeline* pPipeline, |
| 4791 | VkResult result) |
| 4792 | { |
| 4793 | |
| 4794 | if(pPipeline == nullptr) |
| 4795 | { |
| 4796 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4797 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 4798 | return false; |
| 4799 | } |
| 4800 | |
| 4801 | if(result != VK_SUCCESS) |
| 4802 | { |
| 4803 | std::string reason = "vkCreateGraphicsPipeline parameter, VkResult result, is " + EnumeratorString(result); |
| 4804 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4805 | return false; |
| 4806 | } |
| 4807 | |
| 4808 | return true; |
| 4809 | } |
| 4810 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4811 | bool PostDestroyPipeline( |
| 4812 | VkDevice device, |
| 4813 | VkPipeline pipeline, |
| 4814 | VkResult result) |
| 4815 | { |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4816 | if(result != VK_SUCCESS) |
| 4817 | { |
| 4818 | std::string reason = "vkDestroyPipeline parameter, VkResult result, is " + EnumeratorString(result); |
| 4819 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4820 | return false; |
| 4821 | } |
| 4822 | |
| 4823 | return true; |
| 4824 | } |
| 4825 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4826 | bool PreCreateGraphicsPipelineDerivative( |
| 4827 | VkDevice device, |
| 4828 | const VkGraphicsPipelineCreateInfo* pCreateInfo) |
| 4829 | { |
| 4830 | if(pCreateInfo == nullptr) |
| 4831 | { |
| 4832 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4833 | "vkCreateGraphicsPipelineDerivative parameter, const VkGraphicsPipelineCreateInfo* pCreateInfo, is null pointer"); |
| 4834 | return false; |
| 4835 | } |
| 4836 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4837 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4838 | { |
| 4839 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4840 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 4841 | return false; |
| 4842 | } |
| 4843 | if(pCreateInfo->pStages == nullptr) |
| 4844 | { |
| 4845 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4846 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineShaderStageCreateInfo* pCreateInfo->pStages, is null pointer"); |
| 4847 | return false; |
| 4848 | } |
| 4849 | if(pCreateInfo->pStages->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4850 | pCreateInfo->pStages->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4851 | { |
| 4852 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4853 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pStages->sType, is unrecognized enumerator"); |
| 4854 | return false; |
| 4855 | } |
| 4856 | if(pCreateInfo->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4857 | pCreateInfo->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4858 | { |
| 4859 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4860 | "vkCreateGraphicsPipelineDerivative parameter, VkShaderStage pCreateInfo->pStages->stage, is unrecognized enumerator"); |
| 4861 | return false; |
| 4862 | } |
| 4863 | if(pCreateInfo->pStages->pSpecializationInfo == nullptr) |
| 4864 | { |
| 4865 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4866 | "vkCreateGraphicsPipelineDerivative parameter, const VkSpecializationInfo* pCreateInfo->pStages->pSpecializationInfo, is null pointer"); |
| 4867 | return false; |
| 4868 | } |
| 4869 | if(pCreateInfo->pStages->pSpecializationInfo->pMap == nullptr) |
| 4870 | { |
| 4871 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4872 | "vkCreateGraphicsPipelineDerivative parameter, const VkSpecializationMapEntry* pCreateInfo->pStages->pSpecializationInfo->pMap, is null pointer"); |
| 4873 | return false; |
| 4874 | } |
| 4875 | if(pCreateInfo->pStages->pSpecializationInfo->pData == nullptr) |
| 4876 | { |
| 4877 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4878 | "vkCreateGraphicsPipelineDerivative parameter, const void* pCreateInfo->pStages->pSpecializationInfo->pData, is null pointer"); |
| 4879 | return false; |
| 4880 | } |
| 4881 | if(pCreateInfo->pVertexInputState == nullptr) |
| 4882 | { |
| 4883 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4884 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineVertexInputStateCreateInfo* pCreateInfo->pVertexInputState, is null pointer"); |
| 4885 | return false; |
| 4886 | } |
| 4887 | if(pCreateInfo->pVertexInputState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4888 | pCreateInfo->pVertexInputState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4889 | { |
| 4890 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4891 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pVertexInputState->sType, is unrecognized enumerator"); |
| 4892 | return false; |
| 4893 | } |
| 4894 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions == nullptr) |
| 4895 | { |
| 4896 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4897 | "vkCreateGraphicsPipelineDerivative parameter, const VkVertexInputBindingDescription* pCreateInfo->pVertexInputState->pVertexBindingDescriptions, is null pointer"); |
| 4898 | return false; |
| 4899 | } |
| 4900 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4901 | pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4902 | { |
| 4903 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4904 | "vkCreateGraphicsPipelineDerivative parameter, VkVertexInputStepRate pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate, is unrecognized enumerator"); |
| 4905 | return false; |
| 4906 | } |
| 4907 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions == nullptr) |
| 4908 | { |
| 4909 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4910 | "vkCreateGraphicsPipelineDerivative parameter, const VkVertexInputAttributeDescription* pCreateInfo->pVertexInputState->pVertexAttributeDescriptions, is null pointer"); |
| 4911 | return false; |
| 4912 | } |
| 4913 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4914 | pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4915 | { |
| 4916 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4917 | "vkCreateGraphicsPipelineDerivative parameter, VkFormat pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format, is unrecognized enumerator"); |
| 4918 | return false; |
| 4919 | } |
| 4920 | if(pCreateInfo->pInputAssemblyState == nullptr) |
| 4921 | { |
| 4922 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4923 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineIaStateCreateInfo* pCreateInfo->pIaState, is null pointer"); |
| 4924 | return false; |
| 4925 | } |
| 4926 | if(pCreateInfo->pInputAssemblyState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4927 | pCreateInfo->pInputAssemblyState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4928 | { |
| 4929 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4930 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pIaState->sType, is unrecognized enumerator"); |
| 4931 | return false; |
| 4932 | } |
| 4933 | if(pCreateInfo->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4934 | pCreateInfo->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
| 4935 | { |
| 4936 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4937 | "vkCreateGraphicsPipelineDerivative parameter, VkPrimitiveTopology pCreateInfo->pIaState->topology, is unrecognized enumerator"); |
| 4938 | return false; |
| 4939 | } |
| 4940 | if(pCreateInfo->pTessellationState == nullptr) |
| 4941 | { |
| 4942 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4943 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineTessStateCreateInfo* pCreateInfo->pTessState, is null pointer"); |
| 4944 | return false; |
| 4945 | } |
| 4946 | if(pCreateInfo->pTessellationState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4947 | pCreateInfo->pTessellationState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4948 | { |
| 4949 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4950 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pTessState->sType, is unrecognized enumerator"); |
| 4951 | return false; |
| 4952 | } |
| 4953 | if(pCreateInfo->pViewportState == nullptr) |
| 4954 | { |
| 4955 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4956 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineVpStateCreateInfo* pCreateInfo->pVpState, is null pointer"); |
| 4957 | return false; |
| 4958 | } |
| 4959 | if(pCreateInfo->pViewportState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4960 | pCreateInfo->pViewportState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4961 | { |
| 4962 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4963 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pVpState->sType, is unrecognized enumerator"); |
| 4964 | return false; |
| 4965 | } |
| 4966 | if(pCreateInfo->pViewportState->clipOrigin < VK_COORDINATE_ORIGIN_BEGIN_RANGE || |
| 4967 | pCreateInfo->pViewportState->clipOrigin > VK_COORDINATE_ORIGIN_END_RANGE) |
| 4968 | { |
| 4969 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4970 | "vkCreateGraphicsPipelineDerivative parameter, VkCoordinateOrigin pCreateInfo->pVpState->clipOrigin, is unrecognized enumerator"); |
| 4971 | return false; |
| 4972 | } |
| 4973 | if(pCreateInfo->pViewportState->depthMode < VK_DEPTH_MODE_BEGIN_RANGE || |
| 4974 | pCreateInfo->pViewportState->depthMode > VK_DEPTH_MODE_END_RANGE) |
| 4975 | { |
| 4976 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4977 | "vkCreateGraphicsPipelineDerivative parameter, VkDepthMode pCreateInfo->pVpState->depthMode, is unrecognized enumerator"); |
| 4978 | return false; |
| 4979 | } |
| 4980 | if(pCreateInfo->pRasterState == nullptr) |
| 4981 | { |
| 4982 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4983 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineRsStateCreateInfo* pCreateInfo->pRsState, is null pointer"); |
| 4984 | return false; |
| 4985 | } |
| 4986 | if(pCreateInfo->pRasterState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4987 | pCreateInfo->pRasterState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4988 | { |
| 4989 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4990 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pRsState->sType, is unrecognized enumerator"); |
| 4991 | return false; |
| 4992 | } |
| 4993 | if(pCreateInfo->pRasterState->pointOrigin < VK_COORDINATE_ORIGIN_BEGIN_RANGE || |
| 4994 | pCreateInfo->pRasterState->pointOrigin > VK_COORDINATE_ORIGIN_END_RANGE) |
| 4995 | { |
| 4996 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4997 | "vkCreateGraphicsPipelineDerivative parameter, VkCoordinateOrigin pCreateInfo->pRsState->pointOrigin, is unrecognized enumerator"); |
| 4998 | return false; |
| 4999 | } |
| 5000 | if(pCreateInfo->pRasterState->provokingVertex < VK_PROVOKING_VERTEX_BEGIN_RANGE || |
| 5001 | pCreateInfo->pRasterState->provokingVertex > VK_PROVOKING_VERTEX_END_RANGE) |
| 5002 | { |
| 5003 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5004 | "vkCreateGraphicsPipelineDerivative parameter, VkProvokingVertex pCreateInfo->pRsState->provokingVertex, is unrecognized enumerator"); |
| 5005 | return false; |
| 5006 | } |
| 5007 | if(pCreateInfo->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 5008 | pCreateInfo->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
| 5009 | { |
| 5010 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5011 | "vkCreateGraphicsPipelineDerivative parameter, VkFillMode pCreateInfo->pRsState->fillMode, is unrecognized enumerator"); |
| 5012 | return false; |
| 5013 | } |
| 5014 | if(pCreateInfo->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 5015 | pCreateInfo->pRasterState->cullMode > VK_CULL_MODE_END_RANGE) |
| 5016 | { |
| 5017 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5018 | "vkCreateGraphicsPipelineDerivative parameter, VkCullMode pCreateInfo->pRsState->cullMode, is unrecognized enumerator"); |
| 5019 | return false; |
| 5020 | } |
| 5021 | if(pCreateInfo->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 5022 | pCreateInfo->pRasterState->frontFace > VK_FRONT_FACE_END_RANGE) |
| 5023 | { |
| 5024 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5025 | "vkCreateGraphicsPipelineDerivative parameter, VkFrontFace pCreateInfo->pRsState->frontFace, is unrecognized enumerator"); |
| 5026 | return false; |
| 5027 | } |
| 5028 | if(pCreateInfo->pMultisampleState == nullptr) |
| 5029 | { |
| 5030 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5031 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineMsStateCreateInfo* pCreateInfo->pMsState, is null pointer"); |
| 5032 | return false; |
| 5033 | } |
| 5034 | if(pCreateInfo->pMultisampleState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5035 | pCreateInfo->pMultisampleState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5036 | { |
| 5037 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5038 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pMsState->sType, is unrecognized enumerator"); |
| 5039 | return false; |
| 5040 | } |
| 5041 | if(pCreateInfo->pDepthStencilState == nullptr) |
| 5042 | { |
| 5043 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5044 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineDsStateCreateInfo* pCreateInfo->pDsState, is null pointer"); |
| 5045 | return false; |
| 5046 | } |
| 5047 | if(pCreateInfo->pDepthStencilState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5048 | pCreateInfo->pDepthStencilState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5049 | { |
| 5050 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5051 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pDsState->sType, is unrecognized enumerator"); |
| 5052 | return false; |
| 5053 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 5054 | if(pCreateInfo->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5055 | pCreateInfo->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
| 5056 | { |
| 5057 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5058 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->depthCompareOp, is unrecognized enumerator"); |
| 5059 | return false; |
| 5060 | } |
| 5061 | if(pCreateInfo->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5062 | pCreateInfo->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 5063 | { |
| 5064 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5065 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilFailOp, is unrecognized enumerator"); |
| 5066 | return false; |
| 5067 | } |
| 5068 | if(pCreateInfo->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5069 | pCreateInfo->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 5070 | { |
| 5071 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5072 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilPassOp, is unrecognized enumerator"); |
| 5073 | return false; |
| 5074 | } |
| 5075 | if(pCreateInfo->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5076 | pCreateInfo->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 5077 | { |
| 5078 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5079 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilDepthFailOp, is unrecognized enumerator"); |
| 5080 | return false; |
| 5081 | } |
| 5082 | if(pCreateInfo->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5083 | pCreateInfo->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 5084 | { |
| 5085 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5086 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->front.stencilCompareOp, is unrecognized enumerator"); |
| 5087 | return false; |
| 5088 | } |
| 5089 | if(pCreateInfo->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5090 | pCreateInfo->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 5091 | { |
| 5092 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5093 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilFailOp, is unrecognized enumerator"); |
| 5094 | return false; |
| 5095 | } |
| 5096 | if(pCreateInfo->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5097 | pCreateInfo->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 5098 | { |
| 5099 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5100 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilPassOp, is unrecognized enumerator"); |
| 5101 | return false; |
| 5102 | } |
| 5103 | if(pCreateInfo->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5104 | pCreateInfo->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 5105 | { |
| 5106 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5107 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilDepthFailOp, is unrecognized enumerator"); |
| 5108 | return false; |
| 5109 | } |
| 5110 | if(pCreateInfo->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5111 | pCreateInfo->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 5112 | { |
| 5113 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5114 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->back.stencilCompareOp, is unrecognized enumerator"); |
| 5115 | return false; |
| 5116 | } |
| 5117 | if(pCreateInfo->pColorBlendState == nullptr) |
| 5118 | { |
| 5119 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5120 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineCbStateCreateInfo* pCreateInfo->pCbState, is null pointer"); |
| 5121 | return false; |
| 5122 | } |
| 5123 | if(pCreateInfo->pColorBlendState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5124 | pCreateInfo->pColorBlendState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5125 | { |
| 5126 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5127 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pCbState->sType, is unrecognized enumerator"); |
| 5128 | return false; |
| 5129 | } |
| 5130 | if(pCreateInfo->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 5131 | pCreateInfo->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
| 5132 | { |
| 5133 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5134 | "vkCreateGraphicsPipelineDerivative parameter, VkLogicOp pCreateInfo->pCbState->logicOp, is unrecognized enumerator"); |
| 5135 | return false; |
| 5136 | } |
| 5137 | if(pCreateInfo->pColorBlendState->pAttachments == nullptr) |
| 5138 | { |
| 5139 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5140 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineCbAttachmentState* pCreateInfo->pCbState->pAttachments, is null pointer"); |
| 5141 | return false; |
| 5142 | } |
| 5143 | if(pCreateInfo->pColorBlendState->pAttachments->format < VK_FORMAT_BEGIN_RANGE || |
| 5144 | pCreateInfo->pColorBlendState->pAttachments->format > VK_FORMAT_END_RANGE) |
| 5145 | { |
| 5146 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5147 | "vkCreateGraphicsPipelineDerivative parameter, VkFormat pCreateInfo->pCbState->pAttachments->format, is unrecognized enumerator"); |
| 5148 | return false; |
| 5149 | } |
| 5150 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 5151 | pCreateInfo->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
| 5152 | { |
| 5153 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5154 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendColor, is unrecognized enumerator"); |
| 5155 | return false; |
| 5156 | } |
| 5157 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 5158 | pCreateInfo->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
| 5159 | { |
| 5160 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5161 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendColor, is unrecognized enumerator"); |
| 5162 | return false; |
| 5163 | } |
| 5164 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 5165 | pCreateInfo->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
| 5166 | { |
| 5167 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5168 | "vkCreateGraphicsPipelineDerivative parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpColor, is unrecognized enumerator"); |
| 5169 | return false; |
| 5170 | } |
| 5171 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 5172 | pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
| 5173 | { |
| 5174 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5175 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendAlpha, is unrecognized enumerator"); |
| 5176 | return false; |
| 5177 | } |
| 5178 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 5179 | pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
| 5180 | { |
| 5181 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5182 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendAlpha, is unrecognized enumerator"); |
| 5183 | return false; |
| 5184 | } |
| 5185 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 5186 | pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
| 5187 | { |
| 5188 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5189 | "vkCreateGraphicsPipelineDerivative parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpAlpha, is unrecognized enumerator"); |
| 5190 | return false; |
| 5191 | } |
| 5192 | if(!ValidateEnumerator((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask)) |
| 5193 | { |
| 5194 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkChannelFlags pCreateInfo->pCbState->pAttachments->channelWriteMask, is " + EnumeratorString((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask); |
| 5195 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5196 | return false; |
| 5197 | } |
| 5198 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5199 | { |
| 5200 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkPipelineCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkPipelineCreateFlagBits)pCreateInfo->flags); |
| 5201 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5202 | return false; |
| 5203 | } |
| 5204 | |
| 5205 | return true; |
| 5206 | } |
| 5207 | |
| 5208 | bool PostCreateGraphicsPipelineDerivative( |
| 5209 | VkDevice device, |
| 5210 | VkPipeline basePipeline, |
| 5211 | VkPipeline* pPipeline, |
| 5212 | VkResult result) |
| 5213 | { |
| 5214 | |
| 5215 | |
| 5216 | if(pPipeline == nullptr) |
| 5217 | { |
| 5218 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5219 | "vkCreateGraphicsPipelineDerivative parameter, VkPipeline* pPipeline, is null pointer"); |
| 5220 | return false; |
| 5221 | } |
| 5222 | |
| 5223 | if(result != VK_SUCCESS) |
| 5224 | { |
| 5225 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkResult result, is " + EnumeratorString(result); |
| 5226 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5227 | return false; |
| 5228 | } |
| 5229 | |
| 5230 | return true; |
| 5231 | } |
| 5232 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 5233 | bool PreCreateComputePipeline( |
| 5234 | VkDevice device, |
| 5235 | const VkComputePipelineCreateInfo* pCreateInfo) |
| 5236 | { |
| 5237 | if(pCreateInfo == nullptr) |
| 5238 | { |
| 5239 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5240 | "vkCreateComputePipeline parameter, const VkComputePipelineCreateInfo* pCreateInfo, is null pointer"); |
| 5241 | return false; |
| 5242 | } |
| 5243 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5244 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5245 | { |
| 5246 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5247 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5248 | return false; |
| 5249 | } |
| 5250 | if(pCreateInfo->cs.sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5251 | pCreateInfo->cs.sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5252 | { |
| 5253 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5254 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->cs.sType, is unrecognized enumerator"); |
| 5255 | return false; |
| 5256 | } |
| 5257 | if(pCreateInfo->cs.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 5258 | pCreateInfo->cs.stage > VK_SHADER_STAGE_END_RANGE) |
| 5259 | { |
| 5260 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5261 | "vkCreateComputePipeline parameter, VkShaderStage pCreateInfo->cs.stage, is unrecognized enumerator"); |
| 5262 | return false; |
| 5263 | } |
| 5264 | if(pCreateInfo->cs.pSpecializationInfo == nullptr) |
| 5265 | { |
| 5266 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5267 | "vkCreateComputePipeline parameter, const VkSpecializationInfo* pCreateInfo->cs.pSpecializationInfo, is null pointer"); |
| 5268 | return false; |
| 5269 | } |
| 5270 | if(pCreateInfo->cs.pSpecializationInfo->pMap == nullptr) |
| 5271 | { |
| 5272 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5273 | "vkCreateComputePipeline parameter, const VkSpecializationMapEntry* pCreateInfo->cs.pSpecializationInfo->pMap, is null pointer"); |
| 5274 | return false; |
| 5275 | } |
| 5276 | if(pCreateInfo->cs.pSpecializationInfo->pData == nullptr) |
| 5277 | { |
| 5278 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5279 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pSpecializationInfo->pData, is null pointer"); |
| 5280 | return false; |
| 5281 | } |
| 5282 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5283 | { |
| 5284 | std::string reason = "vkCreateComputePipeline parameter, VkPipelineCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkPipelineCreateFlagBits)pCreateInfo->flags); |
| 5285 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5286 | return false; |
| 5287 | } |
| 5288 | |
| 5289 | return true; |
| 5290 | } |
| 5291 | |
| 5292 | bool PostCreateComputePipeline( |
| 5293 | VkDevice device, |
| 5294 | VkPipeline* pPipeline, |
| 5295 | VkResult result) |
| 5296 | { |
| 5297 | |
| 5298 | if(pPipeline == nullptr) |
| 5299 | { |
| 5300 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5301 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5302 | return false; |
| 5303 | } |
| 5304 | |
| 5305 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5306 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5307 | 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] | 5308 | "vkCreateGraphicsPipeline parameter, VkPipelineLayout pCreateInfo->layout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5309 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5310 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5311 | |
| 5312 | return true; |
| 5313 | } |
| 5314 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5315 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipeline( |
| 5316 | VkDevice device, |
| 5317 | VkPipeline pipeline) |
| 5318 | { |
| 5319 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipeline(device, pipeline); |
| 5320 | |
| 5321 | PostDestroyPipeline(device, pipeline, result); |
| 5322 | |
| 5323 | return result; |
| 5324 | } |
| 5325 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5326 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5327 | void PostCreateGraphicsPipeline( |
| 5328 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5329 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5330 | VkPipeline* pPipeline, |
| 5331 | VkResult result) |
| 5332 | { |
| 5333 | if(device == nullptr) |
| 5334 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5335 | 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] | 5336 | "vkCreateGraphicsPipeline parameter, VkDevice device, is null pointer"); |
| 5337 | return; |
| 5338 | } |
| 5339 | |
| 5340 | if(pPipeline == nullptr) |
| 5341 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5342 | 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] | 5343 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5344 | return; |
| 5345 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5346 | if((*pPipeline).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5347 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5348 | 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] | 5349 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5350 | return; |
| 5351 | } |
| 5352 | |
| 5353 | if(result != VK_SUCCESS) |
| 5354 | { |
| 5355 | std::string reason = "vkCreateGraphicsPipeline parameter, VkResult result, is " + EnumeratorString(result); |
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", reason.c_str()); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5357 | return; |
| 5358 | } |
| 5359 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5360 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5361 | //TODO add intercept of pipelineCache entrypoints |
| 5362 | VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5363 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5364 | VkPipelineCache pipelineCache, |
| 5365 | uint32_t count, |
| 5366 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 5367 | VkPipeline* pPipelines) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5368 | { |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5369 | PreCreateGraphicsPipeline(device, count, pCreateInfos); |
| 5370 | 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] | 5371 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5372 | PostCreateGraphicsPipeline(device, count, pPipelines, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5373 | |
| 5374 | return result; |
| 5375 | } |
| 5376 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5377 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5378 | void PreCreateComputePipeline( |
| 5379 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5380 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5381 | const VkComputePipelineCreateInfo* pCreateInfo) |
| 5382 | { |
| 5383 | if(device == nullptr) |
| 5384 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5385 | 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] | 5386 | "vkCreateComputePipeline parameter, VkDevice device, is null pointer"); |
| 5387 | return; |
| 5388 | } |
| 5389 | |
| 5390 | if(pCreateInfo == nullptr) |
| 5391 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5392 | 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] | 5393 | "vkCreateComputePipeline parameter, const VkComputePipelineCreateInfo* pCreateInfo, is null pointer"); |
| 5394 | return; |
| 5395 | } |
| 5396 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5397 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5398 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5399 | 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] | 5400 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5401 | return; |
| 5402 | } |
| 5403 | if(pCreateInfo->cs.sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5404 | pCreateInfo->cs.sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5405 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5406 | 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] | 5407 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->cs.sType, is unrecognized enumerator"); |
| 5408 | return; |
| 5409 | } |
| 5410 | if(pCreateInfo->cs.pNext == nullptr) |
| 5411 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5412 | 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] | 5413 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pNext, is null pointer"); |
| 5414 | return; |
| 5415 | } |
| 5416 | if(pCreateInfo->cs.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 5417 | pCreateInfo->cs.stage > VK_SHADER_STAGE_END_RANGE) |
| 5418 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5419 | 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] | 5420 | "vkCreateComputePipeline parameter, VkShaderStage pCreateInfo->cs.stage, is unrecognized enumerator"); |
| 5421 | return; |
| 5422 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5423 | if(pCreateInfo->cs.shader.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5424 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5425 | 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] | 5426 | "vkCreateComputePipeline parameter, VkShader pCreateInfo->cs.shader, is null pointer"); |
| 5427 | return; |
| 5428 | } |
| 5429 | if(pCreateInfo->cs.pLinkConstBufferInfo == nullptr) |
| 5430 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5431 | 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] | 5432 | "vkCreateComputePipeline parameter, const VkLinkConstBuffer* pCreateInfo->cs.pLinkConstBufferInfo, is null pointer"); |
| 5433 | return; |
| 5434 | } |
| 5435 | if(pCreateInfo->cs.pLinkConstBufferInfo->pBufferData == nullptr) |
| 5436 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5437 | 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] | 5438 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pLinkConstBufferInfo->pBufferData, is null pointer"); |
| 5439 | return; |
| 5440 | } |
| 5441 | if(pCreateInfo->cs.pSpecializationInfo == nullptr) |
| 5442 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5443 | 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] | 5444 | "vkCreateComputePipeline parameter, const VkSpecializationInfo* pCreateInfo->cs.pSpecializationInfo, is null pointer"); |
| 5445 | return; |
| 5446 | } |
| 5447 | if(pCreateInfo->cs.pSpecializationInfo->pMap == nullptr) |
| 5448 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5449 | 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] | 5450 | "vkCreateComputePipeline parameter, const VkSpecializationMapEntry* pCreateInfo->cs.pSpecializationInfo->pMap, is null pointer"); |
| 5451 | return; |
| 5452 | } |
| 5453 | if(pCreateInfo->cs.pSpecializationInfo->pData == nullptr) |
| 5454 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5455 | 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] | 5456 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pSpecializationInfo->pData, is null pointer"); |
| 5457 | return; |
| 5458 | } |
| 5459 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5460 | { |
| 5461 | 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] | 5462 | 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] | 5463 | return; |
| 5464 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5465 | if(pCreateInfo->layout.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5466 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5467 | 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] | 5468 | "vkCreateComputePipeline parameter, VkPipelineLayout pCreateInfo->layout, is null pointer"); |
| 5469 | return; |
| 5470 | } |
| 5471 | } |
| 5472 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5473 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5474 | void PostCreateComputePipeline( |
| 5475 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5476 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5477 | VkPipeline* pPipeline, |
| 5478 | VkResult result) |
| 5479 | { |
| 5480 | if(device == nullptr) |
| 5481 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5482 | 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] | 5483 | "vkCreateComputePipeline parameter, VkDevice device, is null pointer"); |
| 5484 | return; |
| 5485 | } |
| 5486 | |
| 5487 | if(pPipeline == nullptr) |
| 5488 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5489 | 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] | 5490 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5491 | return; |
| 5492 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5493 | if((*pPipeline).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5494 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5495 | 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] | 5496 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5497 | return; |
| 5498 | } |
| 5499 | |
| 5500 | if(result != VK_SUCCESS) |
| 5501 | { |
| 5502 | std::string reason = "vkCreateComputePipeline parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5503 | 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] | 5504 | return; |
| 5505 | } |
| 5506 | } |
| 5507 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5508 | VK_LAYER_EXPORT VkResult VKAPI vkCreateComputePipelines( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5509 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5510 | VkPipelineCache pipelineCache, |
| 5511 | uint32_t count, |
| 5512 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 5513 | VkPipeline* pPipelines) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5514 | { |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5515 | PreCreateComputePipeline(device, count, pCreateInfos); |
| 5516 | 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] | 5517 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5518 | PostCreateComputePipeline(device, count, pPipelines, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5519 | |
| 5520 | return result; |
| 5521 | } |
| 5522 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5523 | void PreCreatePipelineLayout( |
| 5524 | VkDevice device, |
| 5525 | const VkPipelineLayoutCreateInfo* pCreateInfo) |
| 5526 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5527 | if(pCreateInfo == nullptr) |
| 5528 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5529 | 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] | 5530 | "vkCreatePipelineLayout parameter, const VkPipelineLayoutCreateInfo* pCreateInfo, is null pointer"); |
| 5531 | return; |
| 5532 | } |
| 5533 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5534 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5535 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5536 | 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] | 5537 | "vkCreatePipelineLayout parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5538 | return; |
| 5539 | } |
| 5540 | if(pCreateInfo->pSetLayouts == nullptr) |
| 5541 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5542 | 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] | 5543 | "vkCreatePipelineLayout parameter, const VkDescriptorSetLayout* pCreateInfo->pSetLayouts, is null pointer"); |
| 5544 | return; |
| 5545 | } |
| 5546 | } |
| 5547 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5548 | bool PostCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5549 | VkDevice device, |
| 5550 | VkPipelineLayout* pPipelineLayout, |
| 5551 | VkResult result) |
| 5552 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5553 | |
| 5554 | if(pPipelineLayout == nullptr) |
| 5555 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5556 | 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] | 5557 | "vkCreatePipelineLayout parameter, VkPipelineLayout* pPipelineLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5558 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5559 | } |
| 5560 | |
| 5561 | if(result != VK_SUCCESS) |
| 5562 | { |
| 5563 | std::string reason = "vkCreatePipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5564 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5565 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5566 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5567 | |
| 5568 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5569 | } |
| 5570 | |
| 5571 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineLayout( |
| 5572 | VkDevice device, |
| 5573 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 5574 | VkPipelineLayout* pPipelineLayout) |
| 5575 | { |
| 5576 | PreCreatePipelineLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5577 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5578 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); |
| 5579 | |
| 5580 | PostCreatePipelineLayout(device, pPipelineLayout, result); |
| 5581 | |
| 5582 | return result; |
| 5583 | } |
| 5584 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5585 | bool PostDestroyPipelineLayout( |
| 5586 | VkDevice device, |
| 5587 | VkPipelineLayout pipelineLayout, |
| 5588 | VkResult result) |
| 5589 | { |
| 5590 | |
| 5591 | |
| 5592 | if(result != VK_SUCCESS) |
| 5593 | { |
| 5594 | std::string reason = "vkDestroyPipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
| 5595 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5596 | return false; |
| 5597 | } |
| 5598 | |
| 5599 | return true; |
| 5600 | } |
| 5601 | |
| 5602 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipelineLayout( |
| 5603 | VkDevice device, |
| 5604 | VkPipelineLayout pipelineLayout) |
| 5605 | { |
| 5606 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipelineLayout(device, pipelineLayout); |
| 5607 | |
| 5608 | PostDestroyPipelineLayout(device, pipelineLayout, result); |
| 5609 | |
| 5610 | return result; |
| 5611 | } |
| 5612 | |
| 5613 | bool PreCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5614 | VkDevice device, |
| 5615 | const VkSamplerCreateInfo* pCreateInfo) |
| 5616 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5617 | if(pCreateInfo == nullptr) |
| 5618 | { |
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", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5620 | "vkCreateSampler parameter, const VkSamplerCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5621 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5622 | } |
| 5623 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5624 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5625 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5626 | 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] | 5627 | "vkCreateSampler parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5628 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5629 | } |
| 5630 | if(pCreateInfo->magFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5631 | pCreateInfo->magFilter > VK_TEX_FILTER_END_RANGE) |
| 5632 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5633 | 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] | 5634 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->magFilter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5635 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5636 | } |
| 5637 | if(pCreateInfo->minFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5638 | pCreateInfo->minFilter > VK_TEX_FILTER_END_RANGE) |
| 5639 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5640 | 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] | 5641 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->minFilter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5642 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5643 | } |
| 5644 | if(pCreateInfo->mipMode < VK_TEX_MIPMAP_MODE_BEGIN_RANGE || |
| 5645 | pCreateInfo->mipMode > VK_TEX_MIPMAP_MODE_END_RANGE) |
| 5646 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5647 | 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] | 5648 | "vkCreateSampler parameter, VkTexMipmapMode pCreateInfo->mipMode, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5649 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5650 | } |
| 5651 | if(pCreateInfo->addressU < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5652 | pCreateInfo->addressU > VK_TEX_ADDRESS_END_RANGE) |
| 5653 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5654 | 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] | 5655 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressU, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5656 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5657 | } |
| 5658 | if(pCreateInfo->addressV < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5659 | pCreateInfo->addressV > VK_TEX_ADDRESS_END_RANGE) |
| 5660 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5661 | 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] | 5662 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressV, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5663 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5664 | } |
| 5665 | if(pCreateInfo->addressW < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5666 | pCreateInfo->addressW > VK_TEX_ADDRESS_END_RANGE) |
| 5667 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5668 | 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] | 5669 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressW, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5670 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5671 | } |
| 5672 | if(pCreateInfo->compareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5673 | pCreateInfo->compareOp > VK_COMPARE_OP_END_RANGE) |
| 5674 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5675 | 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] | 5676 | "vkCreateSampler parameter, VkCompareOp pCreateInfo->compareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5677 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5678 | } |
| 5679 | if(pCreateInfo->borderColor < VK_BORDER_COLOR_BEGIN_RANGE || |
| 5680 | pCreateInfo->borderColor > VK_BORDER_COLOR_END_RANGE) |
| 5681 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5682 | 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] | 5683 | "vkCreateSampler parameter, VkBorderColor pCreateInfo->borderColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5684 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5685 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5686 | |
| 5687 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5688 | } |
| 5689 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5690 | bool PostCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5691 | VkDevice device, |
| 5692 | VkSampler* pSampler, |
| 5693 | VkResult result) |
| 5694 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5695 | |
| 5696 | if(pSampler == nullptr) |
| 5697 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5698 | 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] | 5699 | "vkCreateSampler parameter, VkSampler* pSampler, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5700 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5701 | } |
| 5702 | |
| 5703 | if(result != VK_SUCCESS) |
| 5704 | { |
| 5705 | std::string reason = "vkCreateSampler parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5706 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5707 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5708 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5709 | |
| 5710 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5711 | } |
| 5712 | |
| 5713 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSampler( |
| 5714 | VkDevice device, |
| 5715 | const VkSamplerCreateInfo* pCreateInfo, |
| 5716 | VkSampler* pSampler) |
| 5717 | { |
| 5718 | PreCreateSampler(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5719 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5720 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pSampler); |
| 5721 | |
| 5722 | PostCreateSampler(device, pSampler, result); |
| 5723 | |
| 5724 | return result; |
| 5725 | } |
| 5726 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5727 | bool PostDestroySampler( |
| 5728 | VkDevice device, |
| 5729 | VkSampler sampler, |
| 5730 | VkResult result) |
| 5731 | { |
| 5732 | |
| 5733 | |
| 5734 | if(result != VK_SUCCESS) |
| 5735 | { |
| 5736 | std::string reason = "vkDestroySampler parameter, VkResult result, is " + EnumeratorString(result); |
| 5737 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5738 | return false; |
| 5739 | } |
| 5740 | |
| 5741 | return true; |
| 5742 | } |
| 5743 | |
| 5744 | VK_LAYER_EXPORT VkResult VKAPI vkDestroySampler( |
| 5745 | VkDevice device, |
| 5746 | VkSampler sampler) |
| 5747 | { |
| 5748 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroySampler(device, sampler); |
| 5749 | |
| 5750 | PostDestroySampler(device, sampler, result); |
| 5751 | |
| 5752 | return result; |
| 5753 | } |
| 5754 | |
| 5755 | bool PreCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5756 | VkDevice device, |
| 5757 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo) |
| 5758 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5759 | if(pCreateInfo == nullptr) |
| 5760 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5761 | 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] | 5762 | "vkCreateDescriptorSetLayout parameter, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5763 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5764 | } |
| 5765 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5766 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5767 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5768 | 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] | 5769 | "vkCreateDescriptorSetLayout parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5770 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5771 | } |
| 5772 | if(pCreateInfo->pBinding == nullptr) |
| 5773 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5774 | 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] | 5775 | "vkCreateDescriptorSetLayout parameter, const VkDescriptorSetLayoutBinding* pCreateInfo->pBinding, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5776 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5777 | } |
| 5778 | if(pCreateInfo->pBinding->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5779 | pCreateInfo->pBinding->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5780 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5781 | 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] | 5782 | "vkCreateDescriptorSetLayout parameter, VkDescriptorType pCreateInfo->pBinding->descriptorType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5783 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5784 | } |
| 5785 | if(!ValidateEnumerator((VkShaderStageFlagBits)pCreateInfo->pBinding->stageFlags)) |
| 5786 | { |
| 5787 | 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] | 5788 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5789 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5790 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5791 | |
| 5792 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5793 | } |
| 5794 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5795 | bool PostCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5796 | VkDevice device, |
| 5797 | VkDescriptorSetLayout* pSetLayout, |
| 5798 | VkResult result) |
| 5799 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5800 | |
| 5801 | if(pSetLayout == nullptr) |
| 5802 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5803 | 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] | 5804 | "vkCreateDescriptorSetLayout parameter, VkDescriptorSetLayout* pSetLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5805 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5806 | } |
| 5807 | |
| 5808 | if(result != VK_SUCCESS) |
| 5809 | { |
| 5810 | std::string reason = "vkCreateDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5811 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5812 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5813 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5814 | |
| 5815 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5816 | } |
| 5817 | |
| 5818 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout( |
| 5819 | VkDevice device, |
| 5820 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5821 | VkDescriptorSetLayout* pSetLayout) |
| 5822 | { |
| 5823 | PreCreateDescriptorSetLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5824 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5825 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout); |
| 5826 | |
| 5827 | PostCreateDescriptorSetLayout(device, pSetLayout, result); |
| 5828 | |
| 5829 | return result; |
| 5830 | } |
| 5831 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5832 | bool PostDestroyDescriptorSetLayout( |
| 5833 | VkDevice device, |
| 5834 | VkDescriptorSetLayout descriptorSetLayout, |
| 5835 | VkResult result) |
| 5836 | { |
| 5837 | |
| 5838 | |
| 5839 | if(result != VK_SUCCESS) |
| 5840 | { |
| 5841 | std::string reason = "vkDestroyDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
| 5842 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5843 | return false; |
| 5844 | } |
| 5845 | |
| 5846 | return true; |
| 5847 | } |
| 5848 | |
| 5849 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDescriptorSetLayout( |
| 5850 | VkDevice device, |
| 5851 | VkDescriptorSetLayout descriptorSetLayout) |
| 5852 | { |
| 5853 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorSetLayout(device, descriptorSetLayout); |
| 5854 | |
| 5855 | PostDestroyDescriptorSetLayout(device, descriptorSetLayout, result); |
| 5856 | |
| 5857 | return result; |
| 5858 | } |
| 5859 | |
| 5860 | bool PreCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5861 | VkDevice device, |
| 5862 | const VkDescriptorPoolCreateInfo* pCreateInfo) |
| 5863 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5864 | if(pCreateInfo == nullptr) |
| 5865 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5866 | 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] | 5867 | "vkCreateDescriptorPool parameter, const VkDescriptorPoolCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5868 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5869 | } |
| 5870 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5871 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5872 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5873 | 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] | 5874 | "vkCreateDescriptorPool parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5875 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5876 | } |
| 5877 | if(pCreateInfo->pTypeCount == nullptr) |
| 5878 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5879 | 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] | 5880 | "vkCreateDescriptorPool parameter, const VkDescriptorTypeCount* pCreateInfo->pTypeCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5881 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5882 | } |
| 5883 | if(pCreateInfo->pTypeCount->type < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5884 | pCreateInfo->pTypeCount->type > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5885 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5886 | 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] | 5887 | "vkCreateDescriptorPool parameter, VkDescriptorType pCreateInfo->pTypeCount->type, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5888 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5889 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5890 | |
| 5891 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5892 | } |
| 5893 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5894 | bool PostCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5895 | VkDevice device, |
| 5896 | VkDescriptorPoolUsage poolUsage, |
| 5897 | uint32_t maxSets, |
| 5898 | VkDescriptorPool* pDescriptorPool, |
| 5899 | VkResult result) |
| 5900 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5901 | |
| 5902 | if(poolUsage < VK_DESCRIPTOR_POOL_USAGE_BEGIN_RANGE || |
| 5903 | poolUsage > VK_DESCRIPTOR_POOL_USAGE_END_RANGE) |
| 5904 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5905 | 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] | 5906 | "vkCreateDescriptorPool parameter, VkDescriptorPoolUsage poolUsage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5907 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5908 | } |
| 5909 | |
| 5910 | |
| 5911 | if(pDescriptorPool == nullptr) |
| 5912 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5913 | 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] | 5914 | "vkCreateDescriptorPool parameter, VkDescriptorPool* pDescriptorPool, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5915 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5916 | } |
| 5917 | |
| 5918 | if(result != VK_SUCCESS) |
| 5919 | { |
| 5920 | std::string reason = "vkCreateDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5921 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5922 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5923 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5924 | |
| 5925 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5926 | } |
| 5927 | |
| 5928 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool( |
| 5929 | VkDevice device, |
| 5930 | VkDescriptorPoolUsage poolUsage, |
| 5931 | uint32_t maxSets, |
| 5932 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 5933 | VkDescriptorPool* pDescriptorPool) |
| 5934 | { |
| 5935 | PreCreateDescriptorPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5936 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5937 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool); |
| 5938 | |
| 5939 | PostCreateDescriptorPool(device, poolUsage, maxSets, pDescriptorPool, result); |
| 5940 | |
| 5941 | return result; |
| 5942 | } |
| 5943 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5944 | bool PostDestroyDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5945 | VkDevice device, |
| 5946 | VkDescriptorPool descriptorPool, |
| 5947 | VkResult result) |
| 5948 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5949 | |
| 5950 | |
| 5951 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5952 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5953 | std::string reason = "vkDestroyDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
| 5954 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5955 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5956 | } |
| 5957 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5958 | return true; |
| 5959 | } |
| 5960 | |
| 5961 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDescriptorPool( |
| 5962 | VkDevice device, |
| 5963 | VkDescriptorPool descriptorPool) |
| 5964 | { |
| 5965 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorPool(device, descriptorPool); |
| 5966 | |
| 5967 | PostDestroyDescriptorPool(device, descriptorPool, result); |
| 5968 | |
| 5969 | return result; |
| 5970 | } |
| 5971 | |
| 5972 | bool PostResetDescriptorPool( |
| 5973 | VkDevice device, |
| 5974 | VkDescriptorPool descriptorPool, |
| 5975 | VkResult result) |
| 5976 | { |
| 5977 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5978 | |
| 5979 | if(result != VK_SUCCESS) |
| 5980 | { |
| 5981 | std::string reason = "vkResetDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5982 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5983 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5984 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5985 | |
| 5986 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5987 | } |
| 5988 | |
| 5989 | VK_LAYER_EXPORT VkResult VKAPI vkResetDescriptorPool( |
| 5990 | VkDevice device, |
| 5991 | VkDescriptorPool descriptorPool) |
| 5992 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5993 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool); |
| 5994 | |
| 5995 | PostResetDescriptorPool(device, descriptorPool, result); |
| 5996 | |
| 5997 | return result; |
| 5998 | } |
| 5999 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6000 | bool PreAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6001 | VkDevice device, |
| 6002 | const VkDescriptorSetLayout* pSetLayouts) |
| 6003 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6004 | if(pSetLayouts == nullptr) |
| 6005 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6006 | 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] | 6007 | "vkAllocDescriptorSets parameter, const VkDescriptorSetLayout* pSetLayouts, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6008 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6009 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6010 | |
| 6011 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6012 | } |
| 6013 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6014 | bool PostAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6015 | VkDevice device, |
| 6016 | VkDescriptorPool descriptorPool, |
| 6017 | VkDescriptorSetUsage setUsage, |
| 6018 | uint32_t count, |
| 6019 | VkDescriptorSet* pDescriptorSets, |
| 6020 | uint32_t* pCount, |
| 6021 | VkResult result) |
| 6022 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6023 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6024 | |
| 6025 | if(setUsage < VK_DESCRIPTOR_SET_USAGE_BEGIN_RANGE || |
| 6026 | setUsage > VK_DESCRIPTOR_SET_USAGE_END_RANGE) |
| 6027 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6028 | 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] | 6029 | "vkAllocDescriptorSets parameter, VkDescriptorSetUsage setUsage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6030 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6031 | } |
| 6032 | |
| 6033 | |
| 6034 | if(pDescriptorSets == nullptr) |
| 6035 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6036 | 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] | 6037 | "vkAllocDescriptorSets parameter, VkDescriptorSet* pDescriptorSets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6038 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6039 | } |
| 6040 | |
| 6041 | if(pCount == nullptr) |
| 6042 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6043 | 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] | 6044 | "vkAllocDescriptorSets parameter, uint32_t* pCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6045 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6046 | } |
| 6047 | |
| 6048 | if(result != VK_SUCCESS) |
| 6049 | { |
| 6050 | std::string reason = "vkAllocDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6051 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6052 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6053 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6054 | |
| 6055 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6056 | } |
| 6057 | |
| 6058 | VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets( |
| 6059 | VkDevice device, |
| 6060 | VkDescriptorPool descriptorPool, |
| 6061 | VkDescriptorSetUsage setUsage, |
| 6062 | uint32_t count, |
| 6063 | const VkDescriptorSetLayout* pSetLayouts, |
| 6064 | VkDescriptorSet* pDescriptorSets, |
| 6065 | uint32_t* pCount) |
| 6066 | { |
| 6067 | PreAllocDescriptorSets(device, pSetLayouts); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6068 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6069 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets, pCount); |
| 6070 | |
| 6071 | PostAllocDescriptorSets(device, descriptorPool, setUsage, count, pDescriptorSets, pCount, result); |
| 6072 | |
| 6073 | return result; |
| 6074 | } |
| 6075 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6076 | bool PreUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6077 | VkDevice device, |
| 6078 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 6079 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 6080 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6081 | if(pDescriptorWrites == nullptr) |
| 6082 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6083 | 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] | 6084 | "vkUpdateDescriptorSets parameter, const VkWriteDescriptorSet* pDescriptorWrites, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6085 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6086 | } |
| 6087 | if(pDescriptorWrites->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6088 | pDescriptorWrites->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6089 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6090 | 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] | 6091 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorWrites->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6092 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6093 | } |
| 6094 | if(pDescriptorWrites->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 6095 | pDescriptorWrites->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 6096 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6097 | 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] | 6098 | "vkUpdateDescriptorSets parameter, VkDescriptorType pDescriptorWrites->descriptorType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6099 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6100 | } |
| 6101 | if(pDescriptorWrites->pDescriptors == nullptr) |
| 6102 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6103 | 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] | 6104 | "vkUpdateDescriptorSets parameter, const VkDescriptorInfo* pDescriptorWrites->pDescriptors, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6105 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6106 | } |
| 6107 | if(pDescriptorWrites->pDescriptors->imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6108 | pDescriptorWrites->pDescriptors->imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6109 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6110 | 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] | 6111 | "vkUpdateDescriptorSets parameter, VkImageLayout pDescriptorWrites->pDescriptors->imageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6112 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6113 | } |
| 6114 | |
| 6115 | if(pDescriptorCopies == nullptr) |
| 6116 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6117 | 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] | 6118 | "vkUpdateDescriptorSets parameter, const VkCopyDescriptorSet* pDescriptorCopies, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6119 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6120 | } |
| 6121 | if(pDescriptorCopies->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6122 | pDescriptorCopies->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6123 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6124 | 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] | 6125 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorCopies->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6126 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6127 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6128 | |
| 6129 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6130 | } |
| 6131 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6132 | bool PostUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6133 | VkDevice device, |
| 6134 | uint32_t writeCount, |
| 6135 | uint32_t copyCount, |
| 6136 | VkResult result) |
| 6137 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6138 | |
| 6139 | |
| 6140 | |
| 6141 | if(result != VK_SUCCESS) |
| 6142 | { |
| 6143 | std::string reason = "vkUpdateDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6144 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6145 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6146 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6147 | |
| 6148 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6149 | } |
| 6150 | |
| 6151 | VK_LAYER_EXPORT VkResult VKAPI vkUpdateDescriptorSets( |
| 6152 | VkDevice device, |
| 6153 | uint32_t writeCount, |
| 6154 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 6155 | uint32_t copyCount, |
| 6156 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 6157 | { |
| 6158 | PreUpdateDescriptorSets(device, pDescriptorWrites, pDescriptorCopies); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6159 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6160 | VkResult result = get_dispatch_table(pc_device_table_map, device)->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies); |
| 6161 | |
| 6162 | PostUpdateDescriptorSets(device, writeCount, copyCount, result); |
| 6163 | |
| 6164 | return result; |
| 6165 | } |
| 6166 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6167 | bool PreCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6168 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6169 | const VkDynamicViewportStateCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6170 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6171 | if(pCreateInfo == nullptr) |
| 6172 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6173 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6174 | "vkCreateDynamicViewportState parameter, const VkDynamicViewportStateCreateInfo* pCreateInfo, is null pointer"); |
| 6175 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6176 | } |
| 6177 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6178 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6179 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6180 | 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] | 6181 | "vkCreateDynamicViewportState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6182 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6183 | } |
| 6184 | if(pCreateInfo->pViewports == nullptr) |
| 6185 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6186 | 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] | 6187 | "vkCreateDynamicViewportState parameter, const VkViewport* pCreateInfo->pViewports, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6188 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6189 | } |
| 6190 | if(pCreateInfo->pScissors == nullptr) |
| 6191 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6192 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6193 | "vkCreateDynamicViewportState parameter, const VkRect2D* pCreateInfo->pScissors, is null pointer"); |
| 6194 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6195 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6196 | |
| 6197 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6198 | } |
| 6199 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6200 | bool PostCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6201 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6202 | VkDynamicViewportState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6203 | VkResult result) |
| 6204 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6205 | |
| 6206 | if(pState == nullptr) |
| 6207 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6208 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6209 | "vkCreateDynamicViewportState parameter, VkDynamicViewportState* pState, is null pointer"); |
| 6210 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6211 | } |
| 6212 | |
| 6213 | if(result != VK_SUCCESS) |
| 6214 | { |
| 6215 | std::string reason = "vkCreateDynamicViewportState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6216 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6217 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6218 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6219 | |
| 6220 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6221 | } |
| 6222 | |
| 6223 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicViewportState( |
| 6224 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6225 | const VkDynamicViewportStateCreateInfo* pCreateInfo, |
| 6226 | VkDynamicViewportState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6227 | { |
| 6228 | PreCreateDynamicViewportState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6229 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6230 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicViewportState(device, pCreateInfo, pState); |
| 6231 | |
| 6232 | PostCreateDynamicViewportState(device, pState, result); |
| 6233 | |
| 6234 | return result; |
| 6235 | } |
| 6236 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6237 | bool PostDestroyDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6238 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6239 | VkDynamicViewportState dynamicViewportState, |
| 6240 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6241 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6242 | |
| 6243 | |
| 6244 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6245 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6246 | std::string reason = "vkDestroyDynamicViewportState parameter, VkResult result, is " + EnumeratorString(result); |
| 6247 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6248 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6249 | } |
| 6250 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6251 | return true; |
| 6252 | } |
| 6253 | |
| 6254 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicViewportState( |
| 6255 | VkDevice device, |
| 6256 | VkDynamicViewportState dynamicViewportState) |
| 6257 | { |
| 6258 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicViewportState(device, dynamicViewportState); |
| 6259 | |
| 6260 | PostDestroyDynamicViewportState(device, dynamicViewportState, result); |
| 6261 | |
| 6262 | return result; |
| 6263 | } |
| 6264 | |
| 6265 | bool PreCreateDynamicRasterState( |
| 6266 | VkDevice device, |
| 6267 | const VkDynamicRasterStateCreateInfo* pCreateInfo) |
| 6268 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6269 | if(pCreateInfo == nullptr) |
| 6270 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6271 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6272 | "vkCreateDynamicRasterState parameter, const VkDynamicRasterStateCreateInfo* pCreateInfo, is null pointer"); |
| 6273 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6274 | } |
| 6275 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6276 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6277 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6278 | 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] | 6279 | "vkCreateDynamicRasterState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6280 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6281 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6282 | |
| 6283 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6284 | } |
| 6285 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6286 | bool PostCreateDynamicRasterState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6287 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6288 | VkDynamicRasterState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6289 | VkResult result) |
| 6290 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6291 | |
| 6292 | if(pState == nullptr) |
| 6293 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6294 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6295 | "vkCreateDynamicRasterState parameter, VkDynamicRasterState* pState, is null pointer"); |
| 6296 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6297 | } |
| 6298 | |
| 6299 | if(result != VK_SUCCESS) |
| 6300 | { |
| 6301 | std::string reason = "vkCreateDynamicRasterState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6302 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6303 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6304 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6305 | |
| 6306 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6307 | } |
| 6308 | |
| 6309 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicRasterState( |
| 6310 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6311 | const VkDynamicRasterStateCreateInfo* pCreateInfo, |
| 6312 | VkDynamicRasterState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6313 | { |
| 6314 | PreCreateDynamicRasterState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6315 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6316 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicRasterState(device, pCreateInfo, pState); |
| 6317 | |
| 6318 | PostCreateDynamicRasterState(device, pState, result); |
| 6319 | |
| 6320 | return result; |
| 6321 | } |
| 6322 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6323 | bool PostDestroyDynamicRasterState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6324 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6325 | VkDynamicRasterState dynamicRasterState, |
| 6326 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6327 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6328 | |
| 6329 | |
| 6330 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6331 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6332 | std::string reason = "vkDestroyDynamicRasterState parameter, VkResult result, is " + EnumeratorString(result); |
| 6333 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6334 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6335 | } |
| 6336 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6337 | return true; |
| 6338 | } |
| 6339 | |
| 6340 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicRasterState( |
| 6341 | VkDevice device, |
| 6342 | VkDynamicRasterState dynamicRasterState) |
| 6343 | { |
| 6344 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicRasterState(device, dynamicRasterState); |
| 6345 | |
| 6346 | PostDestroyDynamicRasterState(device, dynamicRasterState, result); |
| 6347 | |
| 6348 | return result; |
| 6349 | } |
| 6350 | |
| 6351 | bool PreCreateDynamicColorBlendState( |
| 6352 | VkDevice device, |
| 6353 | const VkDynamicColorBlendStateCreateInfo* pCreateInfo) |
| 6354 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6355 | if(pCreateInfo == nullptr) |
| 6356 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6357 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6358 | "vkCreateDynamicColorBlendState parameter, const VkDynamicColorBlendStateCreateInfo* pCreateInfo, is null pointer"); |
| 6359 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6360 | } |
| 6361 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6362 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6363 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6364 | 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] | 6365 | "vkCreateDynamicColorBlendState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6366 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6367 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6368 | |
| 6369 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6370 | } |
| 6371 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6372 | bool PostCreateDynamicColorBlendState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6373 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6374 | VkDynamicColorBlendState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6375 | VkResult result) |
| 6376 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6377 | |
| 6378 | if(pState == nullptr) |
| 6379 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6380 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6381 | "vkCreateDynamicColorBlendState parameter, VkDynamicColorBlendState* pState, is null pointer"); |
| 6382 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6383 | } |
| 6384 | |
| 6385 | if(result != VK_SUCCESS) |
| 6386 | { |
| 6387 | std::string reason = "vkCreateDynamicColorBlendState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6388 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6389 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6390 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6391 | |
| 6392 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6393 | } |
| 6394 | |
| 6395 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState( |
| 6396 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6397 | const VkDynamicColorBlendStateCreateInfo* pCreateInfo, |
| 6398 | VkDynamicColorBlendState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6399 | { |
| 6400 | PreCreateDynamicColorBlendState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6401 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6402 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicColorBlendState(device, pCreateInfo, pState); |
| 6403 | |
| 6404 | PostCreateDynamicColorBlendState(device, pState, result); |
| 6405 | |
| 6406 | return result; |
| 6407 | } |
| 6408 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6409 | bool PostDestroyDynamicColorBlendState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6410 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6411 | VkDynamicColorBlendState dynamicColorBlendState, |
| 6412 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6413 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6414 | |
| 6415 | |
| 6416 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6417 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6418 | std::string reason = "vkDestroyDynamicColorBlendState parameter, VkResult result, is " + EnumeratorString(result); |
| 6419 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6420 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6421 | } |
| 6422 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6423 | return true; |
| 6424 | } |
| 6425 | |
| 6426 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicColorBlendState( |
| 6427 | VkDevice device, |
| 6428 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6429 | { |
| 6430 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicColorBlendState(device, dynamicColorBlendState); |
| 6431 | |
| 6432 | PostDestroyDynamicColorBlendState(device, dynamicColorBlendState, result); |
| 6433 | |
| 6434 | return result; |
| 6435 | } |
| 6436 | |
| 6437 | bool PreCreateDynamicDepthStencilState( |
| 6438 | VkDevice device, |
| 6439 | const VkDynamicDepthStencilStateCreateInfo* pCreateInfo) |
| 6440 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6441 | if(pCreateInfo == nullptr) |
| 6442 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6443 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6444 | "vkCreateDynamicDepthStencilState parameter, const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, is null pointer"); |
| 6445 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6446 | } |
| 6447 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6448 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6449 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6450 | 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] | 6451 | "vkCreateDynamicDepthStencilState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6452 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6453 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6454 | |
| 6455 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6456 | } |
| 6457 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6458 | bool PostCreateDynamicDepthStencilState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6459 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6460 | VkDynamicDepthStencilState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6461 | VkResult result) |
| 6462 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6463 | |
| 6464 | if(pState == nullptr) |
| 6465 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6466 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6467 | "vkCreateDynamicDepthStencilState parameter, VkDynamicDepthStencilState* pState, is null pointer"); |
| 6468 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6469 | } |
| 6470 | |
| 6471 | if(result != VK_SUCCESS) |
| 6472 | { |
| 6473 | std::string reason = "vkCreateDynamicDepthStencilState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6474 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6475 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6476 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6477 | |
| 6478 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6479 | } |
| 6480 | |
| 6481 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState( |
| 6482 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6483 | const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, |
| 6484 | VkDynamicDepthStencilState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6485 | { |
| 6486 | PreCreateDynamicDepthStencilState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6487 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6488 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicDepthStencilState(device, pCreateInfo, pState); |
| 6489 | |
| 6490 | PostCreateDynamicDepthStencilState(device, pState, result); |
| 6491 | |
| 6492 | return result; |
| 6493 | } |
| 6494 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6495 | bool PostDestroyDynamicDepthStencilState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6496 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6497 | VkDynamicDepthStencilState dynamicDepthStencilState, |
| 6498 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6499 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6500 | |
| 6501 | |
| 6502 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6503 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6504 | std::string reason = "vkDestroyDynamicDepthStencilState parameter, VkResult result, is " + EnumeratorString(result); |
| 6505 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6506 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6507 | } |
| 6508 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6509 | return true; |
| 6510 | } |
| 6511 | |
| 6512 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicDepthStencilState( |
| 6513 | VkDevice device, |
| 6514 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6515 | { |
| 6516 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicDepthStencilState(device, dynamicDepthStencilState); |
| 6517 | |
| 6518 | PostDestroyDynamicDepthStencilState(device, dynamicDepthStencilState, result); |
| 6519 | |
| 6520 | return result; |
| 6521 | } |
| 6522 | |
| 6523 | bool PreCreateCommandBuffer( |
| 6524 | VkDevice device, |
| 6525 | const VkCmdBufferCreateInfo* pCreateInfo) |
| 6526 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6527 | if(pCreateInfo == nullptr) |
| 6528 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6529 | 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] | 6530 | "vkCreateCommandBuffer parameter, const VkCmdBufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6531 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6532 | } |
| 6533 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6534 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6535 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6536 | 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] | 6537 | "vkCreateCommandBuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6538 | return false; |
| 6539 | } |
| 6540 | if(pCreateInfo->level < VK_CMD_BUFFER_LEVEL_BEGIN_RANGE || |
| 6541 | pCreateInfo->level > VK_CMD_BUFFER_LEVEL_END_RANGE) |
| 6542 | { |
| 6543 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6544 | "vkCreateCommandBuffer parameter, VkCmdBufferLevel pCreateInfo->level, is unrecognized enumerator"); |
| 6545 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6546 | } |
| 6547 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6548 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6549 | } |
| 6550 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6551 | bool PostCreateCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6552 | VkDevice device, |
| 6553 | VkCmdBuffer* pCmdBuffer, |
| 6554 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6555 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6556 | |
| 6557 | if(pCmdBuffer == nullptr) |
| 6558 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6559 | 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] | 6560 | "vkCreateCommandBuffer parameter, VkCmdBuffer* pCmdBuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6561 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6562 | } |
| 6563 | |
| 6564 | if(result != VK_SUCCESS) |
| 6565 | { |
| 6566 | std::string reason = "vkCreateCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6567 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6568 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6569 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6570 | |
| 6571 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6572 | } |
| 6573 | |
| 6574 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandBuffer( |
| 6575 | VkDevice device, |
| 6576 | const VkCmdBufferCreateInfo* pCreateInfo, |
| 6577 | VkCmdBuffer* pCmdBuffer) |
| 6578 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6579 | PreCreateCommandBuffer(device, pCreateInfo); |
| 6580 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6581 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 6582 | |
| 6583 | PostCreateCommandBuffer(device, pCmdBuffer, result); |
| 6584 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6585 | return result; |
| 6586 | } |
| 6587 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6588 | bool PostDestroyCommandBuffer( |
| 6589 | VkDevice device, |
| 6590 | VkCmdBuffer commandBuffer, |
| 6591 | VkResult result) |
| 6592 | { |
| 6593 | |
| 6594 | |
| 6595 | if(result != VK_SUCCESS) |
| 6596 | { |
| 6597 | std::string reason = "vkDestroyCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 6598 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6599 | return false; |
| 6600 | } |
| 6601 | |
| 6602 | return true; |
| 6603 | } |
| 6604 | |
| 6605 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyCommandBuffer( |
| 6606 | VkDevice device, |
| 6607 | VkCmdBuffer commandBuffer) |
| 6608 | { |
| 6609 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyCommandBuffer(device, commandBuffer); |
| 6610 | |
| 6611 | PostDestroyCommandBuffer(device, commandBuffer, result); |
| 6612 | |
| 6613 | return result; |
| 6614 | } |
| 6615 | |
| 6616 | bool PreBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6617 | VkCmdBuffer cmdBuffer, |
| 6618 | const VkCmdBufferBeginInfo* pBeginInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6619 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6620 | if(pBeginInfo == nullptr) |
| 6621 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6622 | 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] | 6623 | "vkBeginCommandBuffer parameter, const VkCmdBufferBeginInfo* pBeginInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6624 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6625 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6626 | if(pBeginInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6627 | pBeginInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6628 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6629 | 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] | 6630 | "vkBeginCommandBuffer parameter, VkStructureType pBeginInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6631 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6632 | } |
| 6633 | if(!ValidateEnumerator((VkCmdBufferOptimizeFlagBits)pBeginInfo->flags)) |
| 6634 | { |
| 6635 | 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] | 6636 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6637 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6638 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6639 | |
| 6640 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6641 | } |
| 6642 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6643 | bool PostBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6644 | VkCmdBuffer cmdBuffer, |
| 6645 | VkResult result) |
| 6646 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6647 | |
| 6648 | if(result != VK_SUCCESS) |
| 6649 | { |
| 6650 | std::string reason = "vkBeginCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6651 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6652 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6653 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6654 | |
| 6655 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6656 | } |
| 6657 | |
| 6658 | VK_LAYER_EXPORT VkResult VKAPI vkBeginCommandBuffer( |
| 6659 | VkCmdBuffer cmdBuffer, |
| 6660 | const VkCmdBufferBeginInfo* pBeginInfo) |
| 6661 | { |
| 6662 | PreBeginCommandBuffer(cmdBuffer, pBeginInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6663 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6664 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->BeginCommandBuffer(cmdBuffer, pBeginInfo); |
| 6665 | |
| 6666 | PostBeginCommandBuffer(cmdBuffer, result); |
| 6667 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6668 | return result; |
| 6669 | } |
| 6670 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6671 | bool PostEndCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6672 | VkCmdBuffer cmdBuffer, |
| 6673 | VkResult result) |
| 6674 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6675 | |
| 6676 | if(result != VK_SUCCESS) |
| 6677 | { |
| 6678 | std::string reason = "vkEndCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6679 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6680 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6681 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6682 | |
| 6683 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6684 | } |
| 6685 | |
| 6686 | VK_LAYER_EXPORT VkResult VKAPI vkEndCommandBuffer( |
| 6687 | VkCmdBuffer cmdBuffer) |
| 6688 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6689 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->EndCommandBuffer(cmdBuffer); |
| 6690 | |
| 6691 | PostEndCommandBuffer(cmdBuffer, result); |
| 6692 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6693 | return result; |
| 6694 | } |
| 6695 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6696 | bool PostResetCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6697 | VkCmdBuffer cmdBuffer, |
| 6698 | VkResult result) |
| 6699 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6700 | |
| 6701 | if(result != VK_SUCCESS) |
| 6702 | { |
| 6703 | std::string reason = "vkResetCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6704 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6705 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6706 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6707 | |
| 6708 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6709 | } |
| 6710 | |
| 6711 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandBuffer( |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 6712 | VkCmdBuffer cmdBuffer, |
| 6713 | VkCmdBufferResetFlags flags) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6714 | { |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 6715 | 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] | 6716 | |
| 6717 | PostResetCommandBuffer(cmdBuffer, result); |
| 6718 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6719 | return result; |
| 6720 | } |
| 6721 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6722 | bool PostCmdBindPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6723 | VkCmdBuffer cmdBuffer, |
| 6724 | VkPipelineBindPoint pipelineBindPoint, |
| 6725 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6726 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6727 | |
| 6728 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6729 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6730 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6731 | 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] | 6732 | "vkCmdBindPipeline parameter, VkPipelineBindPoint pipelineBindPoint, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6733 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6734 | } |
| 6735 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6736 | |
| 6737 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6738 | } |
| 6739 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6740 | VK_LAYER_EXPORT void VKAPI vkCmdBindPipeline( |
| 6741 | VkCmdBuffer cmdBuffer, |
| 6742 | VkPipelineBindPoint pipelineBindPoint, |
| 6743 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6744 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6745 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 6746 | |
| 6747 | PostCmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 6748 | } |
| 6749 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6750 | bool PostCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6751 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6752 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6753 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6754 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6755 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6756 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6757 | } |
| 6758 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6759 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6760 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6761 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6762 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6763 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6764 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6765 | PostCmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6766 | } |
| 6767 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6768 | bool PostCmdBindDynamicRasterState( |
| 6769 | VkCmdBuffer cmdBuffer, |
| 6770 | VkDynamicRasterState dynamicRasterState) |
| 6771 | { |
| 6772 | |
| 6773 | |
| 6774 | return true; |
| 6775 | } |
| 6776 | |
| 6777 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicRasterState( |
| 6778 | VkCmdBuffer cmdBuffer, |
| 6779 | VkDynamicRasterState dynamicRasterState) |
| 6780 | { |
| 6781 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicRasterState(cmdBuffer, dynamicRasterState); |
| 6782 | |
| 6783 | PostCmdBindDynamicRasterState(cmdBuffer, dynamicRasterState); |
| 6784 | } |
| 6785 | |
| 6786 | bool PostCmdBindDynamicColorBlendState( |
| 6787 | VkCmdBuffer cmdBuffer, |
| 6788 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6789 | { |
| 6790 | |
| 6791 | |
| 6792 | return true; |
| 6793 | } |
| 6794 | |
| 6795 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicColorBlendState( |
| 6796 | VkCmdBuffer cmdBuffer, |
| 6797 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6798 | { |
| 6799 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState); |
| 6800 | |
| 6801 | PostCmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState); |
| 6802 | } |
| 6803 | |
| 6804 | bool PostCmdBindDynamicDepthStencilState( |
| 6805 | VkCmdBuffer cmdBuffer, |
| 6806 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6807 | { |
| 6808 | |
| 6809 | |
| 6810 | return true; |
| 6811 | } |
| 6812 | |
| 6813 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicDepthStencilState( |
| 6814 | VkCmdBuffer cmdBuffer, |
| 6815 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6816 | { |
| 6817 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState); |
| 6818 | |
| 6819 | PostCmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState); |
| 6820 | } |
| 6821 | |
| 6822 | bool PreCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6823 | VkCmdBuffer cmdBuffer, |
| 6824 | const VkDescriptorSet* pDescriptorSets, |
| 6825 | const uint32_t* pDynamicOffsets) |
| 6826 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6827 | if(pDescriptorSets == nullptr) |
| 6828 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6829 | 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] | 6830 | "vkCmdBindDescriptorSets parameter, const VkDescriptorSet* pDescriptorSets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6831 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6832 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6833 | |
| 6834 | |
| 6835 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6836 | } |
| 6837 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6838 | bool PostCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6839 | VkCmdBuffer cmdBuffer, |
| 6840 | VkPipelineBindPoint pipelineBindPoint, |
| 6841 | VkPipelineLayout layout, |
| 6842 | uint32_t firstSet, |
| 6843 | uint32_t setCount, |
| 6844 | uint32_t dynamicOffsetCount) |
| 6845 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6846 | |
| 6847 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6848 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6849 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6850 | 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] | 6851 | "vkCmdBindDescriptorSets parameter, VkPipelineBindPoint pipelineBindPoint, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6852 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6853 | } |
| 6854 | |
| 6855 | |
| 6856 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6857 | |
| 6858 | |
| 6859 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6860 | } |
| 6861 | |
| 6862 | VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets( |
| 6863 | VkCmdBuffer cmdBuffer, |
| 6864 | VkPipelineBindPoint pipelineBindPoint, |
| 6865 | VkPipelineLayout layout, |
| 6866 | uint32_t firstSet, |
| 6867 | uint32_t setCount, |
| 6868 | const VkDescriptorSet* pDescriptorSets, |
| 6869 | uint32_t dynamicOffsetCount, |
| 6870 | const uint32_t* pDynamicOffsets) |
| 6871 | { |
| 6872 | PreCmdBindDescriptorSets(cmdBuffer, pDescriptorSets, pDynamicOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6873 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6874 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 6875 | |
| 6876 | PostCmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, dynamicOffsetCount); |
| 6877 | } |
| 6878 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6879 | bool PostCmdBindIndexBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6880 | VkCmdBuffer cmdBuffer, |
| 6881 | VkBuffer buffer, |
| 6882 | VkDeviceSize offset, |
| 6883 | VkIndexType indexType) |
| 6884 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6885 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6886 | |
| 6887 | |
| 6888 | if(indexType < VK_INDEX_TYPE_BEGIN_RANGE || |
| 6889 | indexType > VK_INDEX_TYPE_END_RANGE) |
| 6890 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6891 | 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] | 6892 | "vkCmdBindIndexBuffer parameter, VkIndexType indexType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6893 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6894 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6895 | |
| 6896 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6897 | } |
| 6898 | |
| 6899 | VK_LAYER_EXPORT void VKAPI vkCmdBindIndexBuffer( |
| 6900 | VkCmdBuffer cmdBuffer, |
| 6901 | VkBuffer buffer, |
| 6902 | VkDeviceSize offset, |
| 6903 | VkIndexType indexType) |
| 6904 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6905 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6906 | |
| 6907 | PostCmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6908 | } |
| 6909 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6910 | bool PreCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6911 | VkCmdBuffer cmdBuffer, |
| 6912 | const VkBuffer* pBuffers, |
| 6913 | const VkDeviceSize* pOffsets) |
| 6914 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6915 | if(pBuffers == nullptr) |
| 6916 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6917 | 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] | 6918 | "vkCmdBindVertexBuffers parameter, const VkBuffer* pBuffers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6919 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6920 | } |
| 6921 | |
| 6922 | if(pOffsets == nullptr) |
| 6923 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6924 | 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] | 6925 | "vkCmdBindVertexBuffers parameter, const VkDeviceSize* pOffsets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6926 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6927 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6928 | |
| 6929 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6930 | } |
| 6931 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6932 | bool PostCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6933 | VkCmdBuffer cmdBuffer, |
| 6934 | uint32_t startBinding, |
| 6935 | uint32_t bindingCount) |
| 6936 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6937 | |
| 6938 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6939 | |
| 6940 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6941 | } |
| 6942 | |
Courtney Goeltzenleuchter | f68ad72 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 6943 | VK_LAYER_EXPORT void VKAPI vkCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6944 | VkCmdBuffer cmdBuffer, |
| 6945 | uint32_t startBinding, |
| 6946 | uint32_t bindingCount, |
| 6947 | const VkBuffer* pBuffers, |
| 6948 | const VkDeviceSize* pOffsets) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6949 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6950 | PreCmdBindVertexBuffers(cmdBuffer, pBuffers, pOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6951 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6952 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets); |
| 6953 | |
| 6954 | PostCmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6955 | } |
| 6956 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6957 | bool PostCmdDraw( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6958 | VkCmdBuffer cmdBuffer, |
| 6959 | uint32_t firstVertex, |
| 6960 | uint32_t vertexCount, |
| 6961 | uint32_t firstInstance, |
| 6962 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6963 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6964 | |
| 6965 | |
| 6966 | |
| 6967 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6968 | |
| 6969 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6970 | } |
| 6971 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6972 | VK_LAYER_EXPORT void VKAPI vkCmdDraw( |
| 6973 | VkCmdBuffer cmdBuffer, |
| 6974 | uint32_t firstVertex, |
| 6975 | uint32_t vertexCount, |
| 6976 | uint32_t firstInstance, |
| 6977 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6978 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6979 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 6980 | |
| 6981 | PostCmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6982 | } |
| 6983 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6984 | bool PostCmdDrawIndexed( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6985 | VkCmdBuffer cmdBuffer, |
| 6986 | uint32_t firstIndex, |
| 6987 | uint32_t indexCount, |
| 6988 | int32_t vertexOffset, |
| 6989 | uint32_t firstInstance, |
| 6990 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6991 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6992 | |
| 6993 | |
| 6994 | |
| 6995 | |
| 6996 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6997 | |
| 6998 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6999 | } |
| 7000 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7001 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed( |
| 7002 | VkCmdBuffer cmdBuffer, |
| 7003 | uint32_t firstIndex, |
| 7004 | uint32_t indexCount, |
| 7005 | int32_t vertexOffset, |
| 7006 | uint32_t firstInstance, |
| 7007 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7008 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7009 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 7010 | |
| 7011 | PostCmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 7012 | } |
| 7013 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7014 | bool PostCmdDrawIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7015 | VkCmdBuffer cmdBuffer, |
| 7016 | VkBuffer buffer, |
| 7017 | VkDeviceSize offset, |
| 7018 | uint32_t count, |
| 7019 | uint32_t stride) |
| 7020 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7021 | |
| 7022 | |
| 7023 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7024 | |
| 7025 | |
| 7026 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7027 | } |
| 7028 | |
| 7029 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndirect( |
| 7030 | VkCmdBuffer cmdBuffer, |
| 7031 | VkBuffer buffer, |
| 7032 | VkDeviceSize offset, |
| 7033 | uint32_t count, |
| 7034 | uint32_t stride) |
| 7035 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7036 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 7037 | |
| 7038 | PostCmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 7039 | } |
| 7040 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7041 | bool PostCmdDrawIndexedIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7042 | VkCmdBuffer cmdBuffer, |
| 7043 | VkBuffer buffer, |
| 7044 | VkDeviceSize offset, |
| 7045 | uint32_t count, |
| 7046 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7047 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7048 | |
| 7049 | |
| 7050 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7051 | |
| 7052 | |
| 7053 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7054 | } |
| 7055 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7056 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexedIndirect( |
| 7057 | VkCmdBuffer cmdBuffer, |
| 7058 | VkBuffer buffer, |
| 7059 | VkDeviceSize offset, |
| 7060 | uint32_t count, |
| 7061 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7062 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7063 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 7064 | |
| 7065 | PostCmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 7066 | } |
| 7067 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7068 | bool PostCmdDispatch( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7069 | VkCmdBuffer cmdBuffer, |
| 7070 | uint32_t x, |
| 7071 | uint32_t y, |
| 7072 | uint32_t z) |
| 7073 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7074 | |
| 7075 | |
| 7076 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7077 | |
| 7078 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7079 | } |
| 7080 | |
| 7081 | VK_LAYER_EXPORT void VKAPI vkCmdDispatch( |
| 7082 | VkCmdBuffer cmdBuffer, |
| 7083 | uint32_t x, |
| 7084 | uint32_t y, |
| 7085 | uint32_t z) |
| 7086 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7087 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatch(cmdBuffer, x, y, z); |
| 7088 | |
| 7089 | PostCmdDispatch(cmdBuffer, x, y, z); |
| 7090 | } |
| 7091 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7092 | bool PostCmdDispatchIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7093 | VkCmdBuffer cmdBuffer, |
| 7094 | VkBuffer buffer, |
| 7095 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7096 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7097 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7098 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7099 | |
| 7100 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7101 | } |
| 7102 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7103 | VK_LAYER_EXPORT void VKAPI vkCmdDispatchIndirect( |
| 7104 | VkCmdBuffer cmdBuffer, |
| 7105 | VkBuffer buffer, |
| 7106 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7107 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7108 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatchIndirect(cmdBuffer, buffer, offset); |
| 7109 | |
| 7110 | PostCmdDispatchIndirect(cmdBuffer, buffer, offset); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7111 | } |
| 7112 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7113 | bool PreCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7114 | VkCmdBuffer cmdBuffer, |
| 7115 | const VkBufferCopy* pRegions) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7116 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7117 | if(pRegions == nullptr) |
| 7118 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7119 | 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] | 7120 | "vkCmdCopyBuffer parameter, const VkBufferCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7121 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7122 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7123 | |
| 7124 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7125 | } |
| 7126 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7127 | bool PostCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7128 | VkCmdBuffer cmdBuffer, |
| 7129 | VkBuffer srcBuffer, |
| 7130 | VkBuffer destBuffer, |
| 7131 | uint32_t regionCount) |
| 7132 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7133 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7134 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7135 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7136 | |
| 7137 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7138 | } |
| 7139 | |
| 7140 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBuffer( |
| 7141 | VkCmdBuffer cmdBuffer, |
| 7142 | VkBuffer srcBuffer, |
| 7143 | VkBuffer destBuffer, |
| 7144 | uint32_t regionCount, |
| 7145 | const VkBufferCopy* pRegions) |
| 7146 | { |
| 7147 | PreCmdCopyBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7148 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7149 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); |
| 7150 | |
| 7151 | PostCmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount); |
| 7152 | } |
| 7153 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7154 | bool PreCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7155 | VkCmdBuffer cmdBuffer, |
| 7156 | const VkImageCopy* pRegions) |
| 7157 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7158 | if(pRegions == nullptr) |
| 7159 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7160 | 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] | 7161 | "vkCmdCopyImage parameter, const VkImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7162 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7163 | } |
| 7164 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7165 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7166 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7167 | 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] | 7168 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7169 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7170 | } |
| 7171 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7172 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7173 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7174 | 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] | 7175 | "vkCmdCopyImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7176 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7177 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7178 | |
| 7179 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7180 | } |
| 7181 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7182 | bool PostCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7183 | VkCmdBuffer cmdBuffer, |
| 7184 | VkImage srcImage, |
| 7185 | VkImageLayout srcImageLayout, |
| 7186 | VkImage destImage, |
| 7187 | VkImageLayout destImageLayout, |
| 7188 | uint32_t regionCount) |
| 7189 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7190 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7191 | |
| 7192 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7193 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7194 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7195 | 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] | 7196 | "vkCmdCopyImage parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7197 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7198 | } |
| 7199 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7200 | |
| 7201 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7202 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7203 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7204 | 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] | 7205 | "vkCmdCopyImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7206 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7207 | } |
| 7208 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7209 | |
| 7210 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7211 | } |
| 7212 | |
| 7213 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImage( |
| 7214 | VkCmdBuffer cmdBuffer, |
| 7215 | VkImage srcImage, |
| 7216 | VkImageLayout srcImageLayout, |
| 7217 | VkImage destImage, |
| 7218 | VkImageLayout destImageLayout, |
| 7219 | uint32_t regionCount, |
| 7220 | const VkImageCopy* pRegions) |
| 7221 | { |
| 7222 | PreCmdCopyImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7223 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7224 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 7225 | |
| 7226 | PostCmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 7227 | } |
| 7228 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7229 | bool PreCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7230 | VkCmdBuffer cmdBuffer, |
| 7231 | const VkImageBlit* pRegions) |
| 7232 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7233 | if(pRegions == nullptr) |
| 7234 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7235 | 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] | 7236 | "vkCmdBlitImage parameter, const VkImageBlit* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7237 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7238 | } |
| 7239 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7240 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7241 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7242 | 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] | 7243 | "vkCmdBlitImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7244 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7245 | } |
| 7246 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7247 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7248 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7249 | 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] | 7250 | "vkCmdBlitImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7251 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7252 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7253 | |
| 7254 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7255 | } |
| 7256 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7257 | bool PostCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7258 | VkCmdBuffer cmdBuffer, |
| 7259 | VkImage srcImage, |
| 7260 | VkImageLayout srcImageLayout, |
| 7261 | VkImage destImage, |
| 7262 | VkImageLayout destImageLayout, |
| 7263 | uint32_t regionCount, |
| 7264 | VkTexFilter filter) |
| 7265 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7266 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7267 | |
| 7268 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7269 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7270 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7271 | 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] | 7272 | "vkCmdBlitImage parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7273 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7274 | } |
| 7275 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7276 | |
| 7277 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7278 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7279 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7280 | 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] | 7281 | "vkCmdBlitImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7282 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7283 | } |
| 7284 | |
| 7285 | |
| 7286 | if(filter < VK_TEX_FILTER_BEGIN_RANGE || |
| 7287 | filter > VK_TEX_FILTER_END_RANGE) |
| 7288 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7289 | 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] | 7290 | "vkCmdBlitImage parameter, VkTexFilter filter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7291 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7292 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7293 | |
| 7294 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7295 | } |
| 7296 | |
| 7297 | VK_LAYER_EXPORT void VKAPI vkCmdBlitImage( |
| 7298 | VkCmdBuffer cmdBuffer, |
| 7299 | VkImage srcImage, |
| 7300 | VkImageLayout srcImageLayout, |
| 7301 | VkImage destImage, |
| 7302 | VkImageLayout destImageLayout, |
| 7303 | uint32_t regionCount, |
| 7304 | const VkImageBlit* pRegions, |
| 7305 | VkTexFilter filter) |
| 7306 | { |
| 7307 | PreCmdBlitImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7308 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7309 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); |
| 7310 | |
| 7311 | PostCmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, filter); |
| 7312 | } |
| 7313 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7314 | bool PreCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7315 | VkCmdBuffer cmdBuffer, |
| 7316 | const VkBufferImageCopy* pRegions) |
| 7317 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7318 | if(pRegions == nullptr) |
| 7319 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7320 | 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] | 7321 | "vkCmdCopyBufferToImage parameter, const VkBufferImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7322 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7323 | } |
| 7324 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7325 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7326 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7327 | 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] | 7328 | "vkCmdCopyBufferToImage parameter, VkImageAspect pRegions->imageSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7329 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7330 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7331 | |
| 7332 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7333 | } |
| 7334 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7335 | bool PostCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7336 | VkCmdBuffer cmdBuffer, |
| 7337 | VkBuffer srcBuffer, |
| 7338 | VkImage destImage, |
| 7339 | VkImageLayout destImageLayout, |
| 7340 | uint32_t regionCount) |
| 7341 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7342 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7343 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7344 | |
| 7345 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7346 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7347 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7348 | 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] | 7349 | "vkCmdCopyBufferToImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7350 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7351 | } |
| 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 | |
| 7357 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBufferToImage( |
| 7358 | VkCmdBuffer cmdBuffer, |
| 7359 | VkBuffer srcBuffer, |
| 7360 | VkImage destImage, |
| 7361 | VkImageLayout destImageLayout, |
| 7362 | uint32_t regionCount, |
| 7363 | const VkBufferImageCopy* pRegions) |
| 7364 | { |
| 7365 | PreCmdCopyBufferToImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7366 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7367 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); |
| 7368 | |
| 7369 | PostCmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount); |
| 7370 | } |
| 7371 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7372 | bool PreCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7373 | VkCmdBuffer cmdBuffer, |
| 7374 | const VkBufferImageCopy* pRegions) |
| 7375 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7376 | if(pRegions == nullptr) |
| 7377 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7378 | 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] | 7379 | "vkCmdCopyImageToBuffer parameter, const VkBufferImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7380 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7381 | } |
| 7382 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7383 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7384 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7385 | 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] | 7386 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7387 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7388 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7389 | |
| 7390 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7391 | } |
| 7392 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7393 | bool PostCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7394 | VkCmdBuffer cmdBuffer, |
| 7395 | VkImage srcImage, |
| 7396 | VkImageLayout srcImageLayout, |
| 7397 | VkBuffer destBuffer, |
| 7398 | uint32_t regionCount) |
| 7399 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7400 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7401 | |
| 7402 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7403 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7404 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7405 | 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] | 7406 | "vkCmdCopyImageToBuffer parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7407 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7408 | } |
| 7409 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7410 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7411 | |
| 7412 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7413 | } |
| 7414 | |
| 7415 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImageToBuffer( |
| 7416 | VkCmdBuffer cmdBuffer, |
| 7417 | VkImage srcImage, |
| 7418 | VkImageLayout srcImageLayout, |
| 7419 | VkBuffer destBuffer, |
| 7420 | uint32_t regionCount, |
| 7421 | const VkBufferImageCopy* pRegions) |
| 7422 | { |
| 7423 | PreCmdCopyImageToBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7424 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7425 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); |
| 7426 | |
| 7427 | PostCmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount); |
| 7428 | } |
| 7429 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7430 | bool PreCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7431 | VkCmdBuffer cmdBuffer, |
| 7432 | const uint32_t* pData) |
| 7433 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7434 | if(pData == nullptr) |
| 7435 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7436 | 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] | 7437 | "vkCmdUpdateBuffer parameter, const uint32_t* pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7438 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7439 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7440 | |
| 7441 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7442 | } |
| 7443 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7444 | bool PostCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7445 | VkCmdBuffer cmdBuffer, |
| 7446 | VkBuffer destBuffer, |
| 7447 | VkDeviceSize destOffset, |
| 7448 | VkDeviceSize dataSize) |
| 7449 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7450 | |
| 7451 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7452 | |
| 7453 | |
| 7454 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7455 | } |
| 7456 | |
| 7457 | VK_LAYER_EXPORT void VKAPI vkCmdUpdateBuffer( |
| 7458 | VkCmdBuffer cmdBuffer, |
| 7459 | VkBuffer destBuffer, |
| 7460 | VkDeviceSize destOffset, |
| 7461 | VkDeviceSize dataSize, |
| 7462 | const uint32_t* pData) |
| 7463 | { |
| 7464 | PreCmdUpdateBuffer(cmdBuffer, pData); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7465 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7466 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData); |
| 7467 | |
| 7468 | PostCmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize); |
| 7469 | } |
| 7470 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7471 | bool PostCmdFillBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7472 | VkCmdBuffer cmdBuffer, |
| 7473 | VkBuffer destBuffer, |
| 7474 | VkDeviceSize destOffset, |
| 7475 | VkDeviceSize fillSize, |
| 7476 | uint32_t data) |
| 7477 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7478 | |
| 7479 | |
| 7480 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7481 | |
| 7482 | |
| 7483 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7484 | } |
| 7485 | |
| 7486 | VK_LAYER_EXPORT void VKAPI vkCmdFillBuffer( |
| 7487 | VkCmdBuffer cmdBuffer, |
| 7488 | VkBuffer destBuffer, |
| 7489 | VkDeviceSize destOffset, |
| 7490 | VkDeviceSize fillSize, |
| 7491 | uint32_t data) |
| 7492 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7493 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 7494 | |
| 7495 | PostCmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 7496 | } |
| 7497 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7498 | bool PreCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7499 | VkCmdBuffer cmdBuffer, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 7500 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7501 | const VkImageSubresourceRange* pRanges) |
| 7502 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7503 | if(pColor == nullptr) |
| 7504 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7505 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7506 | "vkCmdClearColorImage parameter, const VkClearColorValue* pColor, is null pointer"); |
| 7507 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7508 | } |
| 7509 | |
| 7510 | if(pRanges == nullptr) |
| 7511 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7512 | 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] | 7513 | "vkCmdClearColorImage parameter, const VkImageSubresourceRange* pRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7514 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7515 | } |
| 7516 | if(pRanges->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7517 | pRanges->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7518 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7519 | 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] | 7520 | "vkCmdClearColorImage parameter, VkImageAspect pRanges->aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7521 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7522 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7523 | |
| 7524 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7525 | } |
| 7526 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7527 | bool PostCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7528 | VkCmdBuffer cmdBuffer, |
| 7529 | VkImage image, |
| 7530 | VkImageLayout imageLayout, |
| 7531 | uint32_t rangeCount) |
| 7532 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7533 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7534 | |
| 7535 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7536 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7537 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7538 | 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] | 7539 | "vkCmdClearColorImage parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7540 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7541 | } |
| 7542 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7543 | |
| 7544 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7545 | } |
| 7546 | |
| 7547 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage( |
| 7548 | VkCmdBuffer cmdBuffer, |
| 7549 | VkImage image, |
| 7550 | VkImageLayout imageLayout, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 7551 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7552 | uint32_t rangeCount, |
| 7553 | const VkImageSubresourceRange* pRanges) |
| 7554 | { |
| 7555 | PreCmdClearColorImage(cmdBuffer, pColor, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7556 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7557 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 7558 | |
| 7559 | PostCmdClearColorImage(cmdBuffer, image, imageLayout, rangeCount); |
| 7560 | } |
| 7561 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7562 | bool PreCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7563 | VkCmdBuffer cmdBuffer, |
| 7564 | const VkImageSubresourceRange* pRanges) |
| 7565 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7566 | if(pRanges == nullptr) |
| 7567 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7568 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7569 | "vkCmdClearDepthStencilImage parameter, const VkImageSubresourceRange* pRanges, is null pointer"); |
| 7570 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7571 | } |
| 7572 | if(pRanges->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7573 | pRanges->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7574 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7575 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7576 | "vkCmdClearDepthStencilImage parameter, VkImageAspect pRanges->aspect, is unrecognized enumerator"); |
| 7577 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7578 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7579 | |
| 7580 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7581 | } |
| 7582 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7583 | bool PostCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7584 | VkCmdBuffer cmdBuffer, |
| 7585 | VkImage image, |
| 7586 | VkImageLayout imageLayout, |
| 7587 | float depth, |
| 7588 | uint32_t stencil, |
| 7589 | uint32_t rangeCount) |
| 7590 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7591 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7592 | |
| 7593 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7594 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7595 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7596 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7597 | "vkCmdClearDepthStencilImage parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7598 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7599 | } |
| 7600 | |
| 7601 | |
| 7602 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7603 | |
| 7604 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7605 | } |
| 7606 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7607 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7608 | VkCmdBuffer cmdBuffer, |
| 7609 | VkImage image, |
| 7610 | VkImageLayout imageLayout, |
| 7611 | float depth, |
| 7612 | uint32_t stencil, |
| 7613 | uint32_t rangeCount, |
| 7614 | const VkImageSubresourceRange* pRanges) |
| 7615 | { |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7616 | PreCmdClearDepthStencilImage(cmdBuffer, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7617 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7618 | 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] | 7619 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7620 | PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7621 | } |
| 7622 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7623 | bool PreCmdClearColorAttachment( |
| 7624 | VkCmdBuffer cmdBuffer, |
| 7625 | const VkClearColorValue* pColor, |
| 7626 | const VkRect3D* pRects) |
| 7627 | { |
| 7628 | if(pColor == nullptr) |
| 7629 | { |
| 7630 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7631 | "vkCmdClearColorAttachment parameter, const VkClearColorValue* pColor, is null pointer"); |
| 7632 | return false; |
| 7633 | } |
| 7634 | |
| 7635 | if(pRects == nullptr) |
| 7636 | { |
| 7637 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7638 | "vkCmdClearColorAttachment parameter, const VkRect3D* pRects, is null pointer"); |
| 7639 | return false; |
| 7640 | } |
| 7641 | |
| 7642 | return true; |
| 7643 | } |
| 7644 | |
| 7645 | bool PostCmdClearColorAttachment( |
| 7646 | VkCmdBuffer cmdBuffer, |
| 7647 | uint32_t colorAttachment, |
| 7648 | VkImageLayout imageLayout, |
| 7649 | uint32_t rectCount) |
| 7650 | { |
| 7651 | |
| 7652 | |
| 7653 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7654 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7655 | { |
| 7656 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7657 | "vkCmdClearColorAttachment parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7658 | return false; |
| 7659 | } |
| 7660 | |
| 7661 | |
| 7662 | return true; |
| 7663 | } |
| 7664 | |
| 7665 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorAttachment( |
| 7666 | VkCmdBuffer cmdBuffer, |
| 7667 | uint32_t colorAttachment, |
| 7668 | VkImageLayout imageLayout, |
| 7669 | const VkClearColorValue* pColor, |
| 7670 | uint32_t rectCount, |
| 7671 | const VkRect3D* pRects) |
| 7672 | { |
| 7673 | PreCmdClearColorAttachment(cmdBuffer, pColor, pRects); |
| 7674 | |
| 7675 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects); |
| 7676 | |
| 7677 | PostCmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, rectCount); |
| 7678 | } |
| 7679 | |
| 7680 | bool PreCmdClearDepthStencilAttachment( |
| 7681 | VkCmdBuffer cmdBuffer, |
| 7682 | const VkRect3D* pRects) |
| 7683 | { |
| 7684 | if(pRects == nullptr) |
| 7685 | { |
| 7686 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7687 | "vkCmdClearDepthStencilAttachment parameter, const VkRect3D* pRects, is null pointer"); |
| 7688 | return false; |
| 7689 | } |
| 7690 | |
| 7691 | return true; |
| 7692 | } |
| 7693 | |
| 7694 | bool PostCmdClearDepthStencilAttachment( |
| 7695 | VkCmdBuffer cmdBuffer, |
| 7696 | VkImageAspectFlags imageAspectMask, |
| 7697 | VkImageLayout imageLayout, |
| 7698 | float depth, |
| 7699 | uint32_t stencil, |
| 7700 | uint32_t rectCount) |
| 7701 | { |
| 7702 | |
| 7703 | if(!ValidateEnumerator((VkImageAspectFlagBits)imageAspectMask)) |
| 7704 | { |
| 7705 | std::string reason = "vkCmdClearDepthStencilAttachment parameter, VkImageAspectFlags imageAspectMask, is " + EnumeratorString((VkImageAspectFlagBits)imageAspectMask); |
| 7706 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 7707 | return false; |
| 7708 | } |
| 7709 | |
| 7710 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7711 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7712 | { |
| 7713 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7714 | "vkCmdClearDepthStencilAttachment parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7715 | return false; |
| 7716 | } |
| 7717 | |
| 7718 | |
| 7719 | |
| 7720 | |
| 7721 | return true; |
| 7722 | } |
| 7723 | |
| 7724 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment( |
| 7725 | VkCmdBuffer cmdBuffer, |
| 7726 | VkImageAspectFlags imageAspectMask, |
| 7727 | VkImageLayout imageLayout, |
| 7728 | float depth, |
| 7729 | uint32_t stencil, |
| 7730 | uint32_t rectCount, |
| 7731 | const VkRect3D* pRects) |
| 7732 | { |
| 7733 | PreCmdClearDepthStencilAttachment(cmdBuffer, pRects); |
| 7734 | |
| 7735 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects); |
| 7736 | |
| 7737 | PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount); |
| 7738 | } |
| 7739 | |
| 7740 | bool PreCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7741 | VkCmdBuffer cmdBuffer, |
| 7742 | const VkImageResolve* pRegions) |
| 7743 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7744 | if(pRegions == nullptr) |
| 7745 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7746 | 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] | 7747 | "vkCmdResolveImage parameter, const VkImageResolve* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7748 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7749 | } |
| 7750 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7751 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7752 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7753 | 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] | 7754 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7755 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7756 | } |
| 7757 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7758 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7759 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7760 | 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] | 7761 | "vkCmdResolveImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7762 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7763 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7764 | |
| 7765 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7766 | } |
| 7767 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7768 | bool PostCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7769 | VkCmdBuffer cmdBuffer, |
| 7770 | VkImage srcImage, |
| 7771 | VkImageLayout srcImageLayout, |
| 7772 | VkImage destImage, |
| 7773 | VkImageLayout destImageLayout, |
| 7774 | uint32_t regionCount) |
| 7775 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7776 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7777 | |
| 7778 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7779 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7780 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7781 | 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] | 7782 | "vkCmdResolveImage parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7783 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7784 | } |
| 7785 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7786 | |
| 7787 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7788 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7789 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7790 | 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] | 7791 | "vkCmdResolveImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7792 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7793 | } |
| 7794 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7795 | |
| 7796 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7797 | } |
| 7798 | |
| 7799 | VK_LAYER_EXPORT void VKAPI vkCmdResolveImage( |
| 7800 | VkCmdBuffer cmdBuffer, |
| 7801 | VkImage srcImage, |
| 7802 | VkImageLayout srcImageLayout, |
| 7803 | VkImage destImage, |
| 7804 | VkImageLayout destImageLayout, |
| 7805 | uint32_t regionCount, |
| 7806 | const VkImageResolve* pRegions) |
| 7807 | { |
| 7808 | PreCmdResolveImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7809 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7810 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 7811 | |
| 7812 | PostCmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 7813 | } |
| 7814 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7815 | bool PostCmdSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7816 | VkCmdBuffer cmdBuffer, |
| 7817 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7818 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7819 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7820 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7821 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7822 | |
| 7823 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7824 | } |
| 7825 | |
| 7826 | VK_LAYER_EXPORT void VKAPI vkCmdSetEvent( |
| 7827 | VkCmdBuffer cmdBuffer, |
| 7828 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7829 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7830 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7831 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7832 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7833 | PostCmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7834 | } |
| 7835 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7836 | bool PostCmdResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7837 | VkCmdBuffer cmdBuffer, |
| 7838 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7839 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7840 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7841 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7842 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7843 | |
| 7844 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7845 | } |
| 7846 | |
| 7847 | VK_LAYER_EXPORT void VKAPI vkCmdResetEvent( |
| 7848 | VkCmdBuffer cmdBuffer, |
| 7849 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7850 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7851 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7852 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7853 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7854 | PostCmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7855 | } |
| 7856 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7857 | bool PreCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7858 | VkCmdBuffer cmdBuffer, |
| 7859 | const VkEvent* pEvents, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 7860 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7861 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7862 | if(pEvents == nullptr) |
| 7863 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7864 | 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] | 7865 | "vkCmdWaitEvents parameter, const VkEvent* pEvents, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7866 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7867 | } |
| 7868 | |
| 7869 | if(ppMemBarriers == nullptr) |
| 7870 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7871 | 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] | 7872 | "vkCmdWaitEvents parameter, const void** ppMemBarriers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7873 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7874 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7875 | |
| 7876 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7877 | } |
| 7878 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7879 | bool PostCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7880 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7881 | uint32_t eventCount, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7882 | VkPipelineStageFlags sourceStageMask, |
| 7883 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7884 | uint32_t memBarrierCount) |
| 7885 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7886 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7887 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7888 | |
| 7889 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7890 | |
| 7891 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7892 | } |
| 7893 | |
| 7894 | VK_LAYER_EXPORT void VKAPI vkCmdWaitEvents( |
| 7895 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7896 | uint32_t eventCount, |
| 7897 | const VkEvent* pEvents, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7898 | VkPipelineStageFlags sourceStageMask, |
| 7899 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7900 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 7901 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7902 | { |
| 7903 | PreCmdWaitEvents(cmdBuffer, pEvents, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7904 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7905 | 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] | 7906 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7907 | PostCmdWaitEvents(cmdBuffer, eventCount, sourceStageMask, destStageMask, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7908 | } |
| 7909 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7910 | bool PreCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7911 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame^] | 7912 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7913 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7914 | if(ppMemBarriers == nullptr) |
| 7915 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7916 | 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] | 7917 | "vkCmdPipelineBarrier parameter, const void** ppMemBarriers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7918 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7919 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7920 | |
| 7921 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7922 | } |
| 7923 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7924 | bool PostCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7925 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame^] | 7926 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7927 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7928 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7929 | uint32_t memBarrierCount) |
| 7930 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7931 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7932 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7933 | |
| 7934 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7935 | |
| 7936 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7937 | } |
| 7938 | |
| 7939 | VK_LAYER_EXPORT void VKAPI vkCmdPipelineBarrier( |
| 7940 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame^] | 7941 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7942 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7943 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7944 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame^] | 7945 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7946 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7947 | PreCmdPipelineBarrier(cmdBuffer, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7948 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame^] | 7949 | 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] | 7950 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame^] | 7951 | PostCmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7952 | } |
| 7953 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7954 | bool PostCmdBeginQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7955 | VkCmdBuffer cmdBuffer, |
| 7956 | VkQueryPool queryPool, |
| 7957 | uint32_t slot, |
| 7958 | VkQueryControlFlags flags) |
| 7959 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7960 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7961 | |
| 7962 | |
| 7963 | if(!ValidateEnumerator((VkQueryControlFlagBits)flags)) |
| 7964 | { |
| 7965 | std::string reason = "vkCmdBeginQuery parameter, VkQueryControlFlags flags, is " + EnumeratorString((VkQueryControlFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7966 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 7967 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7968 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7969 | |
| 7970 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7971 | } |
| 7972 | |
| 7973 | VK_LAYER_EXPORT void VKAPI vkCmdBeginQuery( |
| 7974 | VkCmdBuffer cmdBuffer, |
| 7975 | VkQueryPool queryPool, |
| 7976 | uint32_t slot, |
| 7977 | VkQueryControlFlags flags) |
| 7978 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7979 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7980 | |
| 7981 | PostCmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7982 | } |
| 7983 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7984 | bool PostCmdEndQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7985 | VkCmdBuffer cmdBuffer, |
| 7986 | VkQueryPool queryPool, |
| 7987 | uint32_t slot) |
| 7988 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7989 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7990 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7991 | |
| 7992 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7993 | } |
| 7994 | |
| 7995 | VK_LAYER_EXPORT void VKAPI vkCmdEndQuery( |
| 7996 | VkCmdBuffer cmdBuffer, |
| 7997 | VkQueryPool queryPool, |
| 7998 | uint32_t slot) |
| 7999 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8000 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndQuery(cmdBuffer, queryPool, slot); |
| 8001 | |
| 8002 | PostCmdEndQuery(cmdBuffer, queryPool, slot); |
| 8003 | } |
| 8004 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8005 | bool PostCmdResetQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8006 | VkCmdBuffer cmdBuffer, |
| 8007 | VkQueryPool queryPool, |
| 8008 | uint32_t startQuery, |
| 8009 | uint32_t queryCount) |
| 8010 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8011 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8012 | |
| 8013 | |
| 8014 | |
| 8015 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8016 | } |
| 8017 | |
| 8018 | VK_LAYER_EXPORT void VKAPI vkCmdResetQueryPool( |
| 8019 | VkCmdBuffer cmdBuffer, |
| 8020 | VkQueryPool queryPool, |
| 8021 | uint32_t startQuery, |
| 8022 | uint32_t queryCount) |
| 8023 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8024 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 8025 | |
| 8026 | PostCmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 8027 | } |
| 8028 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8029 | bool PostCmdWriteTimestamp( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8030 | VkCmdBuffer cmdBuffer, |
| 8031 | VkTimestampType timestampType, |
| 8032 | VkBuffer destBuffer, |
| 8033 | VkDeviceSize destOffset) |
| 8034 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8035 | |
| 8036 | if(timestampType < VK_TIMESTAMP_TYPE_BEGIN_RANGE || |
| 8037 | timestampType > VK_TIMESTAMP_TYPE_END_RANGE) |
| 8038 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8039 | 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] | 8040 | "vkCmdWriteTimestamp parameter, VkTimestampType timestampType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8041 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8042 | } |
| 8043 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8044 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8045 | |
| 8046 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8047 | } |
| 8048 | |
| 8049 | VK_LAYER_EXPORT void VKAPI vkCmdWriteTimestamp( |
| 8050 | VkCmdBuffer cmdBuffer, |
| 8051 | VkTimestampType timestampType, |
| 8052 | VkBuffer destBuffer, |
| 8053 | VkDeviceSize destOffset) |
| 8054 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8055 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 8056 | |
| 8057 | PostCmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 8058 | } |
| 8059 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8060 | bool PostCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8061 | VkCmdBuffer cmdBuffer, |
| 8062 | VkQueryPool queryPool, |
| 8063 | uint32_t startQuery, |
| 8064 | uint32_t queryCount, |
| 8065 | VkBuffer destBuffer, |
| 8066 | VkDeviceSize destOffset, |
| 8067 | VkDeviceSize destStride, |
| 8068 | VkQueryResultFlags flags) |
| 8069 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8070 | |
| 8071 | |
| 8072 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8073 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8074 | |
| 8075 | |
| 8076 | |
| 8077 | if(!ValidateEnumerator((VkQueryResultFlagBits)flags)) |
| 8078 | { |
| 8079 | std::string reason = "vkCmdCopyQueryPoolResults parameter, VkQueryResultFlags flags, is " + EnumeratorString((VkQueryResultFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8080 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8081 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8082 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8083 | |
| 8084 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8085 | } |
| 8086 | |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8087 | VK_LAYER_EXPORT void VKAPI vkCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8088 | VkCmdBuffer cmdBuffer, |
| 8089 | VkQueryPool queryPool, |
| 8090 | uint32_t startQuery, |
| 8091 | uint32_t queryCount, |
| 8092 | VkBuffer destBuffer, |
| 8093 | VkDeviceSize destOffset, |
| 8094 | VkDeviceSize destStride, |
| 8095 | VkQueryResultFlags flags) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8096 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8097 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
| 8098 | |
| 8099 | PostCmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8100 | } |
| 8101 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8102 | bool PreCreateFramebuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8103 | VkDevice device, |
| 8104 | const VkFramebufferCreateInfo* pCreateInfo) |
| 8105 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8106 | if(pCreateInfo == nullptr) |
| 8107 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8108 | 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] | 8109 | "vkCreateFramebuffer parameter, const VkFramebufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8110 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8111 | } |
| 8112 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 8113 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 8114 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8115 | 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] | 8116 | "vkCreateFramebuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8117 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8118 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8119 | if(pCreateInfo->pAttachments == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8120 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8121 | 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] | 8122 | "vkCreateFramebuffer parameter, const VkAttachmentBindInfo* pCreateInfo->pAttachments, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8123 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8124 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8125 | if(pCreateInfo->pAttachments->view.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8126 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8127 | 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] | 8128 | "vkCreateFramebuffer parameter, VkAttachmentView pCreateInfo->pAttachments->view, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8129 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8130 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8131 | if(pCreateInfo->pAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 8132 | pCreateInfo->pAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8133 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8134 | 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] | 8135 | "vkCreateFramebuffer parameter, VkImageLayout pCreateInfo->pAttachments->layout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8136 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8137 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8138 | |
| 8139 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8140 | } |
| 8141 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8142 | bool PostCreateFramebuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8143 | VkDevice device, |
| 8144 | VkFramebuffer* pFramebuffer, |
| 8145 | VkResult result) |
| 8146 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8147 | |
| 8148 | if(pFramebuffer == nullptr) |
| 8149 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8150 | 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] | 8151 | "vkCreateFramebuffer parameter, VkFramebuffer* pFramebuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8152 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8153 | } |
| 8154 | |
| 8155 | if(result != VK_SUCCESS) |
| 8156 | { |
| 8157 | std::string reason = "vkCreateFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8158 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8159 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8160 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8161 | |
| 8162 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8163 | } |
| 8164 | |
| 8165 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFramebuffer( |
| 8166 | VkDevice device, |
| 8167 | const VkFramebufferCreateInfo* pCreateInfo, |
| 8168 | VkFramebuffer* pFramebuffer) |
| 8169 | { |
| 8170 | PreCreateFramebuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8171 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8172 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pFramebuffer); |
| 8173 | |
| 8174 | PostCreateFramebuffer(device, pFramebuffer, result); |
| 8175 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8176 | return result; |
| 8177 | } |
| 8178 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8179 | bool PostDestroyFramebuffer( |
| 8180 | VkDevice device, |
| 8181 | VkFramebuffer framebuffer, |
| 8182 | VkResult result) |
| 8183 | { |
| 8184 | |
| 8185 | if(result != VK_SUCCESS) |
| 8186 | { |
| 8187 | std::string reason = "vkDestroyFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 8188 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8189 | return false; |
| 8190 | } |
| 8191 | |
| 8192 | return true; |
| 8193 | } |
| 8194 | |
| 8195 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyFramebuffer( |
| 8196 | VkDevice device, |
| 8197 | VkFramebuffer framebuffer) |
| 8198 | { |
| 8199 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyFramebuffer(device, framebuffer); |
| 8200 | |
| 8201 | PostDestroyFramebuffer(device, framebuffer, result); |
| 8202 | |
| 8203 | return result; |
| 8204 | } |
| 8205 | |
| 8206 | bool PreCreateRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8207 | VkDevice device, |
| 8208 | const VkRenderPassCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8209 | { |
| 8210 | if(pCreateInfo == nullptr) |
| 8211 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8212 | 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] | 8213 | "vkCreateRenderPass parameter, const VkRenderPassCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8214 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8215 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8216 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 8217 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8218 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8219 | 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] | 8220 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8221 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8222 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8223 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8224 | for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8225 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8226 | const VkAttachmentDescription *att = &pCreateInfo->pAttachments[i]; |
| 8227 | |
| 8228 | if(att->format < VK_FORMAT_BEGIN_RANGE || att->format > VK_FORMAT_END_RANGE) |
| 8229 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8230 | 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] | 8231 | "vkCreateRenderPass parameter, VkFormat in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8232 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8233 | } |
| 8234 | if(att->initialLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || att->initialLayout > VK_IMAGE_LAYOUT_END_RANGE || |
| 8235 | att->finalLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || att->finalLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 8236 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8237 | 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] | 8238 | "vkCreateRenderPass parameter, VkImageLayout in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8239 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8240 | } |
| 8241 | if(att->loadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || att->loadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 8242 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8243 | 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] | 8244 | "vkCreateRenderPass parameter, VkAttachmentLoadOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8245 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8246 | } |
| 8247 | if(att->storeOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || att->storeOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 8248 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8249 | 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] | 8250 | "vkCreateRenderPass parameter, VkAttachmentStoreOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8251 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8252 | } |
| 8253 | if(att->stencilLoadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || att->stencilLoadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 8254 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8255 | 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] | 8256 | "vkCreateRenderPass parameter, VkAttachmentLoadOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8257 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8258 | } |
| 8259 | if(att->stencilStoreOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || att->stencilStoreOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 8260 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8261 | 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] | 8262 | "vkCreateRenderPass parameter, VkAttachmentStoreOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8263 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8264 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8265 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8266 | |
| 8267 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8268 | } |
| 8269 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8270 | bool PostCreateRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8271 | VkDevice device, |
| 8272 | VkRenderPass* pRenderPass, |
| 8273 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8274 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8275 | |
| 8276 | if(pRenderPass == nullptr) |
| 8277 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8278 | 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] | 8279 | "vkCreateRenderPass parameter, VkRenderPass* pRenderPass, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8280 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8281 | } |
| 8282 | |
| 8283 | if(result != VK_SUCCESS) |
| 8284 | { |
| 8285 | std::string reason = "vkCreateRenderPass parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8286 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8287 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8288 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8289 | |
| 8290 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8291 | } |
| 8292 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8293 | VK_LAYER_EXPORT VkResult VKAPI vkCreateRenderPass( |
| 8294 | VkDevice device, |
| 8295 | const VkRenderPassCreateInfo* pCreateInfo, |
| 8296 | VkRenderPass* pRenderPass) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8297 | { |
| 8298 | PreCreateRenderPass(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8299 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8300 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pRenderPass); |
| 8301 | |
| 8302 | PostCreateRenderPass(device, pRenderPass, result); |
| 8303 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8304 | return result; |
| 8305 | } |
| 8306 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8307 | bool PreCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8308 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8309 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8310 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8311 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8312 | if(pRenderPassBegin == nullptr) |
| 8313 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8314 | 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] | 8315 | "vkCmdBeginRenderPass parameter, const VkRenderPassBegin* pRenderPassBegin, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8316 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 8317 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8318 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 8319 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8320 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8321 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 8322 | "vkCmdBeginRenderPass parameter, VkRenderPassContents pRenderPassBegin->contents, is unrecognized enumerator"); |
| 8323 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 8324 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8325 | |
| 8326 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8327 | } |
| 8328 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8329 | bool PostCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8330 | VkCmdBuffer cmdBuffer) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8331 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8332 | |
| 8333 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8334 | } |
| 8335 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8336 | VK_LAYER_EXPORT void VKAPI vkCmdBeginRenderPass( |
| 8337 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8338 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8339 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8340 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8341 | PreCmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
| 8342 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8343 | |
| 8344 | PostCmdBeginRenderPass(cmdBuffer); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8345 | } |
| 8346 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8347 | void PreCmdNextSubpass( |
| 8348 | VkCmdBuffer cmdBuffer, |
| 8349 | VkRenderPassContents contents) |
| 8350 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8351 | |
| 8352 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 8353 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8354 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8355 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 8356 | "vkCmdBeginRenderPass parameter, VkRenderPassContents pRenderPassBegin->contents, is unrecognized enumerator"); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8357 | return; |
| 8358 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8359 | |
| 8360 | return; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8361 | } |
| 8362 | |
| 8363 | void PostCmdNextSubpass( |
| 8364 | VkCmdBuffer cmdBuffer) |
| 8365 | { |
| 8366 | if(cmdBuffer == nullptr) |
| 8367 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8368 | 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] | 8369 | "vkCmdNextSubpass parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
| 8370 | return; |
| 8371 | } |
| 8372 | } |
| 8373 | |
| 8374 | VK_LAYER_EXPORT void VKAPI vkCmdNextSubpass( |
| 8375 | VkCmdBuffer cmdBuffer, |
| 8376 | VkRenderPassContents contents) |
| 8377 | { |
| 8378 | PreCmdNextSubpass(cmdBuffer, contents); |
| 8379 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdNextSubpass(cmdBuffer, contents); |
| 8380 | |
| 8381 | PostCmdNextSubpass(cmdBuffer); |
| 8382 | } |
| 8383 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8384 | void PreCmdEndRenderPass( |
| 8385 | VkCmdBuffer cmdBuffer) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8386 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8387 | if(cmdBuffer == nullptr) |
| 8388 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8389 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8390 | "vkCmdEndRenderPass parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
| 8391 | return; |
| 8392 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8393 | } |
| 8394 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8395 | void PostCmdEndRenderPass( |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8396 | VkCmdBuffer cmdBuffer) |
Chia-I Wu | f869338 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 8397 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8398 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndRenderPass(cmdBuffer); |
| 8399 | |
| 8400 | PostCmdEndRenderPass(cmdBuffer); |
| 8401 | } |
| 8402 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8403 | bool PreCmdExecuteCommands( |
| 8404 | VkCmdBuffer cmdBuffer, |
| 8405 | const VkCmdBuffer* pCmdBuffers) |
| 8406 | { |
| 8407 | if(pCmdBuffers == nullptr) |
| 8408 | { |
| 8409 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 8410 | "vkCmdEndRenderPass parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
| 8411 | return false; |
| 8412 | } |
| 8413 | |
| 8414 | return true; |
| 8415 | } |
| 8416 | |
| 8417 | bool PostCmdExecuteCommands( |
| 8418 | VkCmdBuffer cmdBuffer, |
| 8419 | uint32_t cmdBuffersCount) |
| 8420 | { |
| 8421 | |
| 8422 | |
| 8423 | return true; |
| 8424 | } |
| 8425 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8426 | void PreCmdExecuteCommands( |
| 8427 | VkCmdBuffer cmdBuffer) |
| 8428 | { |
| 8429 | if(cmdBuffer == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8430 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8431 | 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] | 8432 | "vkCmdExecuteCommands parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
| 8433 | return; |
| 8434 | } |
| 8435 | } |
| 8436 | |
| 8437 | void PostCmdExecuteCommands( |
| 8438 | VkCmdBuffer cmdBuffer) |
| 8439 | { |
| 8440 | if(cmdBuffer == nullptr) |
| 8441 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8442 | 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] | 8443 | "vkCmdExecuteCommands parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8444 | return; |
| 8445 | } |
Chia-I Wu | f869338 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 8446 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8447 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8448 | VK_LAYER_EXPORT void VKAPI vkCmdExecuteCommands( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8449 | VkCmdBuffer cmdBuffer, |
| 8450 | uint32_t cmdBuffersCount, |
| 8451 | const VkCmdBuffer* pCmdBuffers) |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8452 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8453 | PreCmdExecuteCommands(cmdBuffer, pCmdBuffers); |
| 8454 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8455 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers); |
| 8456 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8457 | PostCmdExecuteCommands(cmdBuffer, cmdBuffersCount); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8458 | } |
| 8459 | |
Jon Ashburn | 8d1b0b5 | 2015-05-18 13:20:15 -0600 | [diff] [blame] | 8460 | VK_LAYER_EXPORT void* VKAPI vkGetDeviceProcAddr(VkDevice device, const char* funcName) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8461 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8462 | if (device == NULL) { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8463 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8464 | } |
| 8465 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8466 | /* loader uses this to force layer initialization; device object is wrapped */ |
| 8467 | if (!strcmp(funcName, "vkGetDeviceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8468 | initDeviceTable(pc_device_table_map, (const VkBaseLayerObject *) device); |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8469 | return (void*) vkGetDeviceProcAddr; |
| 8470 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8471 | |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 8472 | if (!strcmp(funcName, "vkCreateDevice")) |
| 8473 | return (void*) vkCreateDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8474 | if (!strcmp(funcName, "vkDestroyDevice")) |
| 8475 | return (void*) vkDestroyDevice; |
| 8476 | if (!strcmp(funcName, "vkGetDeviceQueue")) |
| 8477 | return (void*) vkGetDeviceQueue; |
| 8478 | if (!strcmp(funcName, "vkQueueSubmit")) |
| 8479 | return (void*) vkQueueSubmit; |
| 8480 | if (!strcmp(funcName, "vkQueueWaitIdle")) |
| 8481 | return (void*) vkQueueWaitIdle; |
| 8482 | if (!strcmp(funcName, "vkDeviceWaitIdle")) |
| 8483 | return (void*) vkDeviceWaitIdle; |
| 8484 | if (!strcmp(funcName, "vkAllocMemory")) |
| 8485 | return (void*) vkAllocMemory; |
| 8486 | if (!strcmp(funcName, "vkFreeMemory")) |
| 8487 | return (void*) vkFreeMemory; |
| 8488 | if (!strcmp(funcName, "vkMapMemory")) |
| 8489 | return (void*) vkMapMemory; |
| 8490 | if (!strcmp(funcName, "vkUnmapMemory")) |
| 8491 | return (void*) vkUnmapMemory; |
| 8492 | if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) |
| 8493 | return (void*) vkFlushMappedMemoryRanges; |
| 8494 | if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) |
| 8495 | return (void*) vkInvalidateMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8496 | if (!strcmp(funcName, "vkCreateFence")) |
| 8497 | return (void*) vkCreateFence; |
| 8498 | if (!strcmp(funcName, "vkResetFences")) |
| 8499 | return (void*) vkResetFences; |
| 8500 | if (!strcmp(funcName, "vkGetFenceStatus")) |
| 8501 | return (void*) vkGetFenceStatus; |
| 8502 | if (!strcmp(funcName, "vkWaitForFences")) |
| 8503 | return (void*) vkWaitForFences; |
| 8504 | if (!strcmp(funcName, "vkCreateSemaphore")) |
| 8505 | return (void*) vkCreateSemaphore; |
| 8506 | if (!strcmp(funcName, "vkQueueSignalSemaphore")) |
| 8507 | return (void*) vkQueueSignalSemaphore; |
| 8508 | if (!strcmp(funcName, "vkQueueWaitSemaphore")) |
| 8509 | return (void*) vkQueueWaitSemaphore; |
| 8510 | if (!strcmp(funcName, "vkCreateEvent")) |
| 8511 | return (void*) vkCreateEvent; |
| 8512 | if (!strcmp(funcName, "vkGetEventStatus")) |
| 8513 | return (void*) vkGetEventStatus; |
| 8514 | if (!strcmp(funcName, "vkSetEvent")) |
| 8515 | return (void*) vkSetEvent; |
| 8516 | if (!strcmp(funcName, "vkResetEvent")) |
| 8517 | return (void*) vkResetEvent; |
| 8518 | if (!strcmp(funcName, "vkCreateQueryPool")) |
| 8519 | return (void*) vkCreateQueryPool; |
| 8520 | if (!strcmp(funcName, "vkGetQueryPoolResults")) |
| 8521 | return (void*) vkGetQueryPoolResults; |
| 8522 | if (!strcmp(funcName, "vkCreateBuffer")) |
| 8523 | return (void*) vkCreateBuffer; |
| 8524 | if (!strcmp(funcName, "vkCreateBufferView")) |
| 8525 | return (void*) vkCreateBufferView; |
| 8526 | if (!strcmp(funcName, "vkCreateImage")) |
| 8527 | return (void*) vkCreateImage; |
| 8528 | if (!strcmp(funcName, "vkGetImageSubresourceLayout")) |
| 8529 | return (void*) vkGetImageSubresourceLayout; |
| 8530 | if (!strcmp(funcName, "vkCreateImageView")) |
| 8531 | return (void*) vkCreateImageView; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8532 | if (!strcmp(funcName, "vkCreateAttachmentView")) |
| 8533 | return (void*) vkCreateAttachmentView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8534 | if (!strcmp(funcName, "vkCreateShader")) |
| 8535 | return (void*) vkCreateShader; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 8536 | if (!strcmp(funcName, "vkCreateGraphicsPipelines")) |
| 8537 | return (void*) vkCreateGraphicsPipelines; |
| 8538 | if (!strcmp(funcName, "vkCreateComputePipelines")) |
| 8539 | return (void*) vkCreateComputePipelines; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8540 | if (!strcmp(funcName, "vkCreatePipelineLayout")) |
| 8541 | return (void*) vkCreatePipelineLayout; |
| 8542 | if (!strcmp(funcName, "vkCreateSampler")) |
| 8543 | return (void*) vkCreateSampler; |
| 8544 | if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) |
| 8545 | return (void*) vkCreateDescriptorSetLayout; |
| 8546 | if (!strcmp(funcName, "vkCreateDescriptorPool")) |
| 8547 | return (void*) vkCreateDescriptorPool; |
| 8548 | if (!strcmp(funcName, "vkResetDescriptorPool")) |
| 8549 | return (void*) vkResetDescriptorPool; |
| 8550 | if (!strcmp(funcName, "vkAllocDescriptorSets")) |
| 8551 | return (void*) vkAllocDescriptorSets; |
| 8552 | if (!strcmp(funcName, "vkCreateDynamicViewportState")) |
| 8553 | return (void*) vkCreateDynamicViewportState; |
| 8554 | if (!strcmp(funcName, "vkCreateDynamicRasterState")) |
| 8555 | return (void*) vkCreateDynamicRasterState; |
| 8556 | if (!strcmp(funcName, "vkCreateDynamicColorBlendState")) |
| 8557 | return (void*) vkCreateDynamicColorBlendState; |
| 8558 | if (!strcmp(funcName, "vkCreateDynamicDepthStencilState")) |
| 8559 | return (void*) vkCreateDynamicDepthStencilState; |
| 8560 | if (!strcmp(funcName, "vkCreateCommandBuffer")) |
| 8561 | return (void*) vkCreateCommandBuffer; |
| 8562 | if (!strcmp(funcName, "vkBeginCommandBuffer")) |
| 8563 | return (void*) vkBeginCommandBuffer; |
| 8564 | if (!strcmp(funcName, "vkEndCommandBuffer")) |
| 8565 | return (void*) vkEndCommandBuffer; |
| 8566 | if (!strcmp(funcName, "vkResetCommandBuffer")) |
| 8567 | return (void*) vkResetCommandBuffer; |
| 8568 | if (!strcmp(funcName, "vkCmdBindPipeline")) |
| 8569 | return (void*) vkCmdBindPipeline; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8570 | if (!strcmp(funcName, "vkCmdBindDescriptorSets")) |
| 8571 | return (void*) vkCmdBindDescriptorSets; |
| 8572 | if (!strcmp(funcName, "vkCmdBindVertexBuffers")) |
| 8573 | return (void*) vkCmdBindVertexBuffers; |
| 8574 | if (!strcmp(funcName, "vkCmdBindIndexBuffer")) |
| 8575 | return (void*) vkCmdBindIndexBuffer; |
| 8576 | if (!strcmp(funcName, "vkCmdDraw")) |
| 8577 | return (void*) vkCmdDraw; |
| 8578 | if (!strcmp(funcName, "vkCmdDrawIndexed")) |
| 8579 | return (void*) vkCmdDrawIndexed; |
| 8580 | if (!strcmp(funcName, "vkCmdDrawIndirect")) |
| 8581 | return (void*) vkCmdDrawIndirect; |
| 8582 | if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) |
| 8583 | return (void*) vkCmdDrawIndexedIndirect; |
| 8584 | if (!strcmp(funcName, "vkCmdDispatch")) |
| 8585 | return (void*) vkCmdDispatch; |
| 8586 | if (!strcmp(funcName, "vkCmdDispatchIndirect")) |
| 8587 | return (void*) vkCmdDispatchIndirect; |
| 8588 | if (!strcmp(funcName, "vkCmdCopyBuffer")) |
| 8589 | return (void*) vkCmdCopyBuffer; |
| 8590 | if (!strcmp(funcName, "vkCmdCopyImage")) |
| 8591 | return (void*) vkCmdCopyImage; |
| 8592 | if (!strcmp(funcName, "vkCmdBlitImage")) |
| 8593 | return (void*) vkCmdBlitImage; |
| 8594 | if (!strcmp(funcName, "vkCmdCopyBufferToImage")) |
| 8595 | return (void*) vkCmdCopyBufferToImage; |
| 8596 | if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) |
| 8597 | return (void*) vkCmdCopyImageToBuffer; |
| 8598 | if (!strcmp(funcName, "vkCmdUpdateBuffer")) |
| 8599 | return (void*) vkCmdUpdateBuffer; |
| 8600 | if (!strcmp(funcName, "vkCmdFillBuffer")) |
| 8601 | return (void*) vkCmdFillBuffer; |
| 8602 | if (!strcmp(funcName, "vkCmdClearColorImage")) |
| 8603 | return (void*) vkCmdClearColorImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8604 | if (!strcmp(funcName, "vkCmdResolveImage")) |
| 8605 | return (void*) vkCmdResolveImage; |
| 8606 | if (!strcmp(funcName, "vkCmdSetEvent")) |
| 8607 | return (void*) vkCmdSetEvent; |
| 8608 | if (!strcmp(funcName, "vkCmdResetEvent")) |
| 8609 | return (void*) vkCmdResetEvent; |
| 8610 | if (!strcmp(funcName, "vkCmdWaitEvents")) |
| 8611 | return (void*) vkCmdWaitEvents; |
| 8612 | if (!strcmp(funcName, "vkCmdPipelineBarrier")) |
| 8613 | return (void*) vkCmdPipelineBarrier; |
| 8614 | if (!strcmp(funcName, "vkCmdBeginQuery")) |
| 8615 | return (void*) vkCmdBeginQuery; |
| 8616 | if (!strcmp(funcName, "vkCmdEndQuery")) |
| 8617 | return (void*) vkCmdEndQuery; |
| 8618 | if (!strcmp(funcName, "vkCmdResetQueryPool")) |
| 8619 | return (void*) vkCmdResetQueryPool; |
| 8620 | if (!strcmp(funcName, "vkCmdWriteTimestamp")) |
| 8621 | return (void*) vkCmdWriteTimestamp; |
| 8622 | if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) |
| 8623 | return (void*) vkCmdCopyQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8624 | if (!strcmp(funcName, "vkCreateFramebuffer")) |
| 8625 | return (void*) vkCreateFramebuffer; |
| 8626 | if (!strcmp(funcName, "vkCreateRenderPass")) |
| 8627 | return (void*) vkCreateRenderPass; |
| 8628 | if (!strcmp(funcName, "vkCmdBeginRenderPass")) |
| 8629 | return (void*) vkCmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8630 | if (!strcmp(funcName, "vkCmdNextSubpass")) |
| 8631 | return (void*) vkCmdNextSubpass; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8632 | if (!strcmp(funcName, "vkCmdEndRenderPass")) |
| 8633 | return (void*) vkCmdEndRenderPass; |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 8634 | |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 8635 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8636 | if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8637 | return NULL; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8638 | return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8639 | } |
| 8640 | } |
| 8641 | |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8642 | VK_LAYER_EXPORT void* VKAPI vkGetInstanceProcAddr(VkInstance instance, const char* funcName) |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8643 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8644 | if (instance == NULL) { |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8645 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8646 | } |
| 8647 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8648 | /* loader uses this to force layer initialization; instance object is wrapped */ |
| 8649 | if (!strcmp(funcName, "vkGetInstanceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8650 | initInstanceTable(pc_instance_table_map, (const VkBaseLayerObject *) instance); |
| 8651 | return (void *) vkGetInstanceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8652 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8653 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8654 | if (!strcmp(funcName, "vkCreateInstance")) |
| 8655 | return (void*) vkCreateInstance; |
| 8656 | if (!strcmp(funcName, "vkDestroyInstance")) |
| 8657 | return (void*) vkDestroyInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8658 | if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) |
| 8659 | return (void*) vkEnumeratePhysicalDevices; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8660 | if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) |
| 8661 | return (void*) vkGetPhysicalDeviceProperties; |
| 8662 | if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) |
| 8663 | return (void*) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 8664 | if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) |
| 8665 | return (void*) vkGetPhysicalDeviceFormatProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8666 | if (!strcmp(funcName, "vkGetPhysicalDeviceLimits")) |
| 8667 | return (void*) vkGetPhysicalDeviceLimits; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8668 | if (!strcmp(funcName, "vkGetGlobalLayerProperties")) |
| 8669 | return (void*) vkGetGlobalLayerProperties; |
| 8670 | if (!strcmp(funcName, "vkGetGlobalExtensionProperties")) |
| 8671 | return (void*) vkGetGlobalExtensionProperties; |
| 8672 | if (!strcmp(funcName, "vkGetPhysicalDeviceLayerProperties")) |
| 8673 | return (void*) vkGetPhysicalDeviceLayerProperties; |
| 8674 | if (!strcmp(funcName, "vkGetPhysicalDeviceExtensionProperties")) |
| 8675 | return (void*) vkGetPhysicalDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 8676 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8677 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 8678 | void* fptr = debug_report_get_instance_proc_addr(data->report_data, funcName); |
| 8679 | if(fptr) |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 8680 | return fptr; |
| 8681 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8682 | { |
| 8683 | if (get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr == NULL) |
| 8684 | return NULL; |
| 8685 | return get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr(instance, funcName); |
| 8686 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8687 | } |