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 |
Courtney Goeltzenleuchter | 876a4f5 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 65 | assert(data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 66 | |
| 67 | return data->report_data; |
| 68 | } |
| 69 | |
| 70 | // "my device data" |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 71 | debug_report_data *mdd(void* object) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 72 | { |
| 73 | dispatch_key key = get_dispatch_key(object); |
| 74 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 75 | #if DISPATCH_MAP_DEBUG |
| 76 | fprintf(stderr, "MDD: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, data); |
| 77 | #endif |
Courtney Goeltzenleuchter | 876a4f5 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 78 | assert(data != NULL); |
| 79 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 80 | return data->report_data; |
| 81 | } |
| 82 | |
| 83 | static void InitParamChecker(layer_data *data) |
| 84 | { |
| 85 | uint32_t report_flags = getLayerOptionFlags("ParamCheckerReportFlags", 0); |
| 86 | |
| 87 | uint32_t debug_action = 0; |
| 88 | getLayerOptionEnum("ParamCheckerDebugAction", (uint32_t *) &debug_action); |
| 89 | if(debug_action & VK_DBG_LAYER_ACTION_LOG_MSG) |
| 90 | { |
| 91 | FILE *log_output = NULL; |
| 92 | const char* option_str = getLayerOption("ParamCheckerLogFilename"); |
| 93 | if(option_str) |
| 94 | { |
| 95 | log_output = fopen(option_str, "w"); |
| 96 | } |
| 97 | if(log_output == NULL) |
| 98 | { |
| 99 | log_output = stdout; |
| 100 | } |
| 101 | |
| 102 | layer_create_msg_callback(data->report_data, report_flags, log_callback, (void*)log_output, &data->logging_callback); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | VK_LAYER_EXPORT VkResult VKAPI vkDbgCreateMsgCallback( |
| 107 | VkInstance instance, |
| 108 | VkFlags msgFlags, |
| 109 | const PFN_vkDbgMsgCallback pfnMsgCallback, |
| 110 | void* pUserData, |
| 111 | VkDbgMsgCallback* pMsgCallback) |
| 112 | { |
| 113 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 114 | VkResult result = pTable->DbgCreateMsgCallback(instance, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 115 | |
| 116 | if (result == VK_SUCCESS) |
| 117 | { |
| 118 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 119 | result = layer_create_msg_callback(data->report_data, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 120 | } |
| 121 | |
| 122 | return result; |
| 123 | } |
| 124 | |
| 125 | VK_LAYER_EXPORT VkResult VKAPI vkDbgDestroyMsgCallback( |
| 126 | VkInstance instance, |
| 127 | VkDbgMsgCallback msgCallback) |
| 128 | { |
| 129 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 130 | VkResult result = pTable->DbgDestroyMsgCallback(instance, msgCallback); |
| 131 | |
| 132 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 133 | layer_destroy_msg_callback(data->report_data, msgCallback); |
| 134 | |
| 135 | return result; |
| 136 | } |
| 137 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 138 | static const VkLayerProperties pc_global_layers[] = { |
| 139 | { |
| 140 | "ParamChecker", |
| 141 | VK_API_VERSION, |
| 142 | VK_MAKE_VERSION(0, 1, 0), |
| 143 | "Validation layer: ParamChecker", |
| 144 | } |
| 145 | }; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 146 | |
| 147 | VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 148 | const char *pLayerName, |
| 149 | uint32_t *pCount, |
| 150 | VkExtensionProperties* pProperties) |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 151 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 152 | /* ParamChecker does not have any global extensions */ |
| 153 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 154 | } |
| 155 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 156 | VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalLayerProperties( |
| 157 | uint32_t *pCount, |
| 158 | VkLayerProperties* pProperties) |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 159 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 160 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), |
| 161 | pc_global_layers, |
| 162 | pCount, pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 166 | VkPhysicalDevice physicalDevice, |
| 167 | const char* pLayerName, |
| 168 | uint32_t* pCount, |
| 169 | VkExtensionProperties* pProperties) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 170 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 171 | /* ParamChecker does not have any physical device extensions */ |
| 172 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 173 | } |
| 174 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 175 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLayerProperties( |
| 176 | VkPhysicalDevice physicalDevice, |
| 177 | uint32_t* pCount, |
| 178 | VkLayerProperties* pProperties) |
| 179 | { |
| 180 | /* ParamChecker's physical device layers are the same as global */ |
| 181 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, |
| 182 | pCount, pProperties); |
| 183 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 184 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 185 | // Version: 0.136.0 |
| 186 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 187 | static |
| 188 | std::string EnumeratorString(VkResult const& enumerator) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 189 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 190 | switch(enumerator) |
| 191 | { |
| 192 | case VK_ERROR_MEMORY_NOT_BOUND: |
| 193 | { |
| 194 | return "VK_ERROR_MEMORY_NOT_BOUND"; |
| 195 | break; |
| 196 | } |
| 197 | case VK_ERROR_BUILDING_COMMAND_BUFFER: |
| 198 | { |
| 199 | return "VK_ERROR_BUILDING_COMMAND_BUFFER"; |
| 200 | break; |
| 201 | } |
| 202 | case VK_ERROR_INCOMPATIBLE_DRIVER: |
| 203 | { |
| 204 | return "VK_ERROR_INCOMPATIBLE_DRIVER"; |
| 205 | break; |
| 206 | } |
| 207 | case VK_ERROR_MEMORY_UNMAP_FAILED: |
| 208 | { |
| 209 | return "VK_ERROR_MEMORY_UNMAP_FAILED"; |
| 210 | break; |
| 211 | } |
| 212 | case VK_ERROR_MEMORY_MAP_FAILED: |
| 213 | { |
| 214 | return "VK_ERROR_MEMORY_MAP_FAILED"; |
| 215 | break; |
| 216 | } |
| 217 | case VK_ERROR_BAD_PIPELINE_DATA: |
| 218 | { |
| 219 | return "VK_ERROR_BAD_PIPELINE_DATA"; |
| 220 | break; |
| 221 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 222 | case VK_ERROR_INVALID_QUEUE_TYPE: |
| 223 | { |
| 224 | return "VK_ERROR_INVALID_QUEUE_TYPE"; |
| 225 | break; |
| 226 | } |
| 227 | case VK_ERROR_BAD_SHADER_CODE: |
| 228 | { |
| 229 | return "VK_ERROR_BAD_SHADER_CODE"; |
| 230 | break; |
| 231 | } |
| 232 | case VK_ERROR_INVALID_IMAGE: |
| 233 | { |
| 234 | return "VK_ERROR_INVALID_IMAGE"; |
| 235 | break; |
| 236 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 237 | case VK_ERROR_INVALID_FORMAT: |
| 238 | { |
| 239 | return "VK_ERROR_INVALID_FORMAT"; |
| 240 | break; |
| 241 | } |
| 242 | case VK_ERROR_INCOMPLETE_COMMAND_BUFFER: |
| 243 | { |
| 244 | return "VK_ERROR_INCOMPLETE_COMMAND_BUFFER"; |
| 245 | break; |
| 246 | } |
| 247 | case VK_ERROR_INVALID_ALIGNMENT: |
| 248 | { |
| 249 | return "VK_ERROR_INVALID_ALIGNMENT"; |
| 250 | break; |
| 251 | } |
| 252 | case VK_ERROR_UNAVAILABLE: |
| 253 | { |
| 254 | return "VK_ERROR_UNAVAILABLE"; |
| 255 | break; |
| 256 | } |
| 257 | case VK_INCOMPLETE: |
| 258 | { |
| 259 | return "VK_INCOMPLETE"; |
| 260 | break; |
| 261 | } |
| 262 | case VK_ERROR_OUT_OF_HOST_MEMORY: |
| 263 | { |
| 264 | return "VK_ERROR_OUT_OF_HOST_MEMORY"; |
| 265 | break; |
| 266 | } |
| 267 | case VK_ERROR_UNKNOWN: |
| 268 | { |
| 269 | return "VK_ERROR_UNKNOWN"; |
| 270 | break; |
| 271 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 272 | case VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION: |
| 273 | { |
| 274 | return "VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION"; |
| 275 | break; |
| 276 | } |
| 277 | case VK_ERROR_INITIALIZATION_FAILED: |
| 278 | { |
| 279 | return "VK_ERROR_INITIALIZATION_FAILED"; |
| 280 | break; |
| 281 | } |
| 282 | case VK_NOT_READY: |
| 283 | { |
| 284 | return "VK_NOT_READY"; |
| 285 | break; |
| 286 | } |
| 287 | case VK_ERROR_INVALID_POINTER: |
| 288 | { |
| 289 | return "VK_ERROR_INVALID_POINTER"; |
| 290 | break; |
| 291 | } |
| 292 | case VK_ERROR_INVALID_VALUE: |
| 293 | { |
| 294 | return "VK_ERROR_INVALID_VALUE"; |
| 295 | break; |
| 296 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 297 | case VK_ERROR_NOT_MAPPABLE: |
| 298 | { |
| 299 | return "VK_ERROR_NOT_MAPPABLE"; |
| 300 | break; |
| 301 | } |
| 302 | case VK_ERROR_OUT_OF_DEVICE_MEMORY: |
| 303 | { |
| 304 | return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; |
| 305 | break; |
| 306 | } |
| 307 | case VK_EVENT_SET: |
| 308 | { |
| 309 | return "VK_EVENT_SET"; |
| 310 | break; |
| 311 | } |
| 312 | case VK_TIMEOUT: |
| 313 | { |
| 314 | return "VK_TIMEOUT"; |
| 315 | break; |
| 316 | } |
| 317 | case VK_ERROR_INVALID_FLAGS: |
| 318 | { |
| 319 | return "VK_ERROR_INVALID_FLAGS"; |
| 320 | break; |
| 321 | } |
| 322 | case VK_EVENT_RESET: |
| 323 | { |
| 324 | return "VK_EVENT_RESET"; |
| 325 | break; |
| 326 | } |
| 327 | case VK_ERROR_INVALID_DESCRIPTOR_SET_DATA: |
| 328 | { |
| 329 | return "VK_ERROR_INVALID_DESCRIPTOR_SET_DATA"; |
| 330 | break; |
| 331 | } |
| 332 | case VK_UNSUPPORTED: |
| 333 | { |
| 334 | return "VK_UNSUPPORTED"; |
| 335 | break; |
| 336 | } |
| 337 | case VK_ERROR_INVALID_HANDLE: |
| 338 | { |
| 339 | return "VK_ERROR_INVALID_HANDLE"; |
| 340 | break; |
| 341 | } |
| 342 | case VK_ERROR_INCOMPATIBLE_DEVICE: |
| 343 | { |
| 344 | return "VK_ERROR_INCOMPATIBLE_DEVICE"; |
| 345 | break; |
| 346 | } |
| 347 | case VK_SUCCESS: |
| 348 | { |
| 349 | return "VK_SUCCESS"; |
| 350 | break; |
| 351 | } |
| 352 | case VK_ERROR_INCOMPATIBLE_QUEUE: |
| 353 | { |
| 354 | return "VK_ERROR_INCOMPATIBLE_QUEUE"; |
| 355 | break; |
| 356 | } |
| 357 | case VK_ERROR_INVALID_EXTENSION: |
| 358 | { |
| 359 | return "VK_ERROR_INVALID_EXTENSION"; |
| 360 | break; |
| 361 | } |
| 362 | case VK_ERROR_DEVICE_ALREADY_CREATED: |
| 363 | { |
| 364 | return "VK_ERROR_DEVICE_ALREADY_CREATED"; |
| 365 | break; |
| 366 | } |
| 367 | case VK_ERROR_DEVICE_LOST: |
| 368 | { |
| 369 | return "VK_ERROR_DEVICE_LOST"; |
| 370 | break; |
| 371 | } |
| 372 | case VK_ERROR_INVALID_ORDINAL: |
| 373 | { |
| 374 | return "VK_ERROR_INVALID_ORDINAL"; |
| 375 | break; |
| 376 | } |
| 377 | case VK_ERROR_INVALID_MEMORY_SIZE: |
| 378 | { |
| 379 | return "VK_ERROR_INVALID_MEMORY_SIZE"; |
| 380 | break; |
| 381 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 382 | case VK_ERROR_INVALID_LAYER: |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 383 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 384 | return "VK_ERROR_INVALID_LAYER"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 385 | break; |
| 386 | } |
| 387 | default: |
| 388 | { |
| 389 | return "unrecognized enumerator"; |
| 390 | break; |
| 391 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 392 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 393 | } |
| 394 | |
| 395 | static |
| 396 | bool ValidateEnumerator(VkQueueFlagBits const& enumerator) |
| 397 | { |
| 398 | VkQueueFlagBits allFlags = (VkQueueFlagBits)(VK_QUEUE_EXTENDED_BIT | |
| 399 | VK_QUEUE_DMA_BIT | |
| 400 | VK_QUEUE_COMPUTE_BIT | |
| 401 | VK_QUEUE_SPARSE_MEMMGR_BIT | |
| 402 | VK_QUEUE_GRAPHICS_BIT); |
| 403 | if(enumerator & (~allFlags)) |
| 404 | { |
| 405 | return false; |
| 406 | } |
| 407 | |
| 408 | return true; |
| 409 | } |
| 410 | |
| 411 | static |
| 412 | std::string EnumeratorString(VkQueueFlagBits const& enumerator) |
| 413 | { |
| 414 | if(!ValidateEnumerator(enumerator)) |
| 415 | { |
| 416 | return "unrecognized enumerator"; |
| 417 | } |
| 418 | |
| 419 | std::vector<std::string> strings; |
| 420 | if(enumerator & VK_QUEUE_EXTENDED_BIT) |
| 421 | { |
| 422 | strings.push_back("VK_QUEUE_EXTENDED_BIT"); |
| 423 | } |
| 424 | if(enumerator & VK_QUEUE_DMA_BIT) |
| 425 | { |
| 426 | strings.push_back("VK_QUEUE_DMA_BIT"); |
| 427 | } |
| 428 | if(enumerator & VK_QUEUE_COMPUTE_BIT) |
| 429 | { |
| 430 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 431 | } |
| 432 | if(enumerator & VK_QUEUE_SPARSE_MEMMGR_BIT) |
| 433 | { |
| 434 | strings.push_back("VK_QUEUE_SPARSE_MEMMGR_BIT"); |
| 435 | } |
| 436 | if(enumerator & VK_QUEUE_GRAPHICS_BIT) |
| 437 | { |
| 438 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 439 | } |
| 440 | |
| 441 | std::string enumeratorString; |
| 442 | for(auto const& string : strings) |
| 443 | { |
| 444 | enumeratorString += string; |
| 445 | |
| 446 | if(string != strings.back()) |
| 447 | { |
| 448 | enumeratorString += '|'; |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | return enumeratorString; |
| 453 | } |
| 454 | |
| 455 | static |
| 456 | bool ValidateEnumerator(VkMemoryPropertyFlagBits const& enumerator) |
| 457 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 458 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)(VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 459 | VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT | |
| 460 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 461 | VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT | |
| 462 | VK_MEMORY_PROPERTY_DEVICE_ONLY); |
| 463 | if(enumerator & (~allFlags)) |
| 464 | { |
| 465 | return false; |
| 466 | } |
| 467 | |
| 468 | return true; |
| 469 | } |
| 470 | |
| 471 | static |
| 472 | std::string EnumeratorString(VkMemoryPropertyFlagBits const& enumerator) |
| 473 | { |
| 474 | if(!ValidateEnumerator(enumerator)) |
| 475 | { |
| 476 | return "unrecognized enumerator"; |
| 477 | } |
| 478 | |
| 479 | std::vector<std::string> strings; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 480 | if(enumerator & VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT) |
| 481 | { |
| 482 | strings.push_back("VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT"); |
| 483 | } |
| 484 | if(enumerator & VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT) |
| 485 | { |
| 486 | strings.push_back("VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT"); |
| 487 | } |
| 488 | if(enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) |
| 489 | { |
| 490 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 491 | } |
| 492 | if(enumerator & VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT) |
| 493 | { |
| 494 | strings.push_back("VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT"); |
| 495 | } |
| 496 | if(enumerator & VK_MEMORY_PROPERTY_DEVICE_ONLY) |
| 497 | { |
| 498 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_ONLY"); |
| 499 | } |
| 500 | |
| 501 | std::string enumeratorString; |
| 502 | for(auto const& string : strings) |
| 503 | { |
| 504 | enumeratorString += string; |
| 505 | |
| 506 | if(string != strings.back()) |
| 507 | { |
| 508 | enumeratorString += '|'; |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | return enumeratorString; |
| 513 | } |
| 514 | |
| 515 | static |
| 516 | bool ValidateEnumerator(VkMemoryOutputFlagBits const& enumerator) |
| 517 | { |
| 518 | VkMemoryOutputFlagBits allFlags = (VkMemoryOutputFlagBits)(VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 519 | VK_MEMORY_OUTPUT_TRANSFER_BIT | |
| 520 | VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT | |
| 521 | VK_MEMORY_OUTPUT_SHADER_WRITE_BIT | |
| 522 | VK_MEMORY_OUTPUT_HOST_WRITE_BIT); |
| 523 | if(enumerator & (~allFlags)) |
| 524 | { |
| 525 | return false; |
| 526 | } |
| 527 | |
| 528 | return true; |
| 529 | } |
| 530 | |
| 531 | static |
| 532 | std::string EnumeratorString(VkMemoryOutputFlagBits const& enumerator) |
| 533 | { |
| 534 | if(!ValidateEnumerator(enumerator)) |
| 535 | { |
| 536 | return "unrecognized enumerator"; |
| 537 | } |
| 538 | |
| 539 | std::vector<std::string> strings; |
| 540 | if(enumerator & VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 541 | { |
| 542 | strings.push_back("VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 543 | } |
| 544 | if(enumerator & VK_MEMORY_OUTPUT_TRANSFER_BIT) |
| 545 | { |
| 546 | strings.push_back("VK_MEMORY_OUTPUT_TRANSFER_BIT"); |
| 547 | } |
| 548 | if(enumerator & VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT) |
| 549 | { |
| 550 | strings.push_back("VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT"); |
| 551 | } |
| 552 | if(enumerator & VK_MEMORY_OUTPUT_SHADER_WRITE_BIT) |
| 553 | { |
| 554 | strings.push_back("VK_MEMORY_OUTPUT_SHADER_WRITE_BIT"); |
| 555 | } |
| 556 | if(enumerator & VK_MEMORY_OUTPUT_HOST_WRITE_BIT) |
| 557 | { |
| 558 | strings.push_back("VK_MEMORY_OUTPUT_HOST_WRITE_BIT"); |
| 559 | } |
| 560 | |
| 561 | std::string enumeratorString; |
| 562 | for(auto const& string : strings) |
| 563 | { |
| 564 | enumeratorString += string; |
| 565 | |
| 566 | if(string != strings.back()) |
| 567 | { |
| 568 | enumeratorString += '|'; |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | return enumeratorString; |
| 573 | } |
| 574 | |
| 575 | static |
| 576 | bool ValidateEnumerator(VkMemoryInputFlagBits const& enumerator) |
| 577 | { |
| 578 | VkMemoryInputFlagBits allFlags = (VkMemoryInputFlagBits)(VK_MEMORY_INPUT_TRANSFER_BIT | |
| 579 | VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 580 | VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT | |
| 581 | VK_MEMORY_INPUT_SHADER_READ_BIT | |
| 582 | VK_MEMORY_INPUT_UNIFORM_READ_BIT | |
| 583 | VK_MEMORY_INPUT_INDEX_FETCH_BIT | |
| 584 | VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT | |
| 585 | VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT | |
| 586 | VK_MEMORY_INPUT_HOST_READ_BIT); |
| 587 | if(enumerator & (~allFlags)) |
| 588 | { |
| 589 | return false; |
| 590 | } |
| 591 | |
| 592 | return true; |
| 593 | } |
| 594 | |
| 595 | static |
| 596 | std::string EnumeratorString(VkMemoryInputFlagBits const& enumerator) |
| 597 | { |
| 598 | if(!ValidateEnumerator(enumerator)) |
| 599 | { |
| 600 | return "unrecognized enumerator"; |
| 601 | } |
| 602 | |
| 603 | std::vector<std::string> strings; |
| 604 | if(enumerator & VK_MEMORY_INPUT_TRANSFER_BIT) |
| 605 | { |
| 606 | strings.push_back("VK_MEMORY_INPUT_TRANSFER_BIT"); |
| 607 | } |
| 608 | if(enumerator & VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 609 | { |
| 610 | strings.push_back("VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 611 | } |
| 612 | if(enumerator & VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT) |
| 613 | { |
| 614 | strings.push_back("VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT"); |
| 615 | } |
| 616 | if(enumerator & VK_MEMORY_INPUT_SHADER_READ_BIT) |
| 617 | { |
| 618 | strings.push_back("VK_MEMORY_INPUT_SHADER_READ_BIT"); |
| 619 | } |
| 620 | if(enumerator & VK_MEMORY_INPUT_UNIFORM_READ_BIT) |
| 621 | { |
| 622 | strings.push_back("VK_MEMORY_INPUT_UNIFORM_READ_BIT"); |
| 623 | } |
| 624 | if(enumerator & VK_MEMORY_INPUT_INDEX_FETCH_BIT) |
| 625 | { |
| 626 | strings.push_back("VK_MEMORY_INPUT_INDEX_FETCH_BIT"); |
| 627 | } |
| 628 | if(enumerator & VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT) |
| 629 | { |
| 630 | strings.push_back("VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT"); |
| 631 | } |
| 632 | if(enumerator & VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT) |
| 633 | { |
| 634 | strings.push_back("VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT"); |
| 635 | } |
| 636 | if(enumerator & VK_MEMORY_INPUT_HOST_READ_BIT) |
| 637 | { |
| 638 | strings.push_back("VK_MEMORY_INPUT_HOST_READ_BIT"); |
| 639 | } |
| 640 | |
| 641 | std::string enumeratorString; |
| 642 | for(auto const& string : strings) |
| 643 | { |
| 644 | enumeratorString += string; |
| 645 | |
| 646 | if(string != strings.back()) |
| 647 | { |
| 648 | enumeratorString += '|'; |
| 649 | } |
| 650 | } |
| 651 | |
| 652 | return enumeratorString; |
| 653 | } |
| 654 | |
| 655 | static |
| 656 | bool ValidateEnumerator(VkBufferUsageFlagBits const& enumerator) |
| 657 | { |
| 658 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | |
| 659 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | |
| 660 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 661 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | |
| 662 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | |
| 663 | VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT | |
| 664 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | |
| 665 | VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT | |
| 666 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | |
| 667 | VK_BUFFER_USAGE_GENERAL); |
| 668 | if(enumerator & (~allFlags)) |
| 669 | { |
| 670 | return false; |
| 671 | } |
| 672 | |
| 673 | return true; |
| 674 | } |
| 675 | |
| 676 | static |
| 677 | std::string EnumeratorString(VkBufferUsageFlagBits const& enumerator) |
| 678 | { |
| 679 | if(!ValidateEnumerator(enumerator)) |
| 680 | { |
| 681 | return "unrecognized enumerator"; |
| 682 | } |
| 683 | |
| 684 | std::vector<std::string> strings; |
| 685 | if(enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) |
| 686 | { |
| 687 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 688 | } |
| 689 | if(enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) |
| 690 | { |
| 691 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 692 | } |
| 693 | if(enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) |
| 694 | { |
| 695 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 696 | } |
| 697 | if(enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) |
| 698 | { |
| 699 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 700 | } |
| 701 | if(enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) |
| 702 | { |
| 703 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 704 | } |
| 705 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT) |
| 706 | { |
| 707 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT"); |
| 708 | } |
| 709 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) |
| 710 | { |
| 711 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 712 | } |
| 713 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT) |
| 714 | { |
| 715 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT"); |
| 716 | } |
| 717 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) |
| 718 | { |
| 719 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 720 | } |
| 721 | if(enumerator & VK_BUFFER_USAGE_GENERAL) |
| 722 | { |
| 723 | strings.push_back("VK_BUFFER_USAGE_GENERAL"); |
| 724 | } |
| 725 | |
| 726 | std::string enumeratorString; |
| 727 | for(auto const& string : strings) |
| 728 | { |
| 729 | enumeratorString += string; |
| 730 | |
| 731 | if(string != strings.back()) |
| 732 | { |
| 733 | enumeratorString += '|'; |
| 734 | } |
| 735 | } |
| 736 | |
| 737 | return enumeratorString; |
| 738 | } |
| 739 | |
| 740 | static |
| 741 | bool ValidateEnumerator(VkBufferCreateFlagBits const& enumerator) |
| 742 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 743 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)(VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | |
| 744 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | |
| 745 | VK_BUFFER_CREATE_SPARSE_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 746 | if(enumerator & (~allFlags)) |
| 747 | { |
| 748 | return false; |
| 749 | } |
| 750 | |
| 751 | return true; |
| 752 | } |
| 753 | |
| 754 | static |
| 755 | std::string EnumeratorString(VkBufferCreateFlagBits const& enumerator) |
| 756 | { |
| 757 | if(!ValidateEnumerator(enumerator)) |
| 758 | { |
| 759 | return "unrecognized enumerator"; |
| 760 | } |
| 761 | |
| 762 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 763 | if(enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) |
| 764 | { |
| 765 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 766 | } |
| 767 | if(enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) |
| 768 | { |
| 769 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 770 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 771 | if(enumerator & VK_BUFFER_CREATE_SPARSE_BIT) |
| 772 | { |
| 773 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BIT"); |
| 774 | } |
| 775 | |
| 776 | std::string enumeratorString; |
| 777 | for(auto const& string : strings) |
| 778 | { |
| 779 | enumeratorString += string; |
| 780 | |
| 781 | if(string != strings.back()) |
| 782 | { |
| 783 | enumeratorString += '|'; |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | return enumeratorString; |
| 788 | } |
| 789 | |
| 790 | static |
| 791 | bool ValidateEnumerator(VkShaderStageFlagBits const& enumerator) |
| 792 | { |
| 793 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)(VK_SHADER_STAGE_ALL | |
| 794 | VK_SHADER_STAGE_FRAGMENT_BIT | |
| 795 | VK_SHADER_STAGE_GEOMETRY_BIT | |
| 796 | VK_SHADER_STAGE_COMPUTE_BIT | |
| 797 | VK_SHADER_STAGE_TESS_EVALUATION_BIT | |
| 798 | VK_SHADER_STAGE_TESS_CONTROL_BIT | |
| 799 | VK_SHADER_STAGE_VERTEX_BIT); |
| 800 | if(enumerator & (~allFlags)) |
| 801 | { |
| 802 | return false; |
| 803 | } |
| 804 | |
| 805 | return true; |
| 806 | } |
| 807 | |
| 808 | static |
| 809 | std::string EnumeratorString(VkShaderStageFlagBits const& enumerator) |
| 810 | { |
| 811 | if(!ValidateEnumerator(enumerator)) |
| 812 | { |
| 813 | return "unrecognized enumerator"; |
| 814 | } |
| 815 | |
| 816 | std::vector<std::string> strings; |
| 817 | if(enumerator & VK_SHADER_STAGE_ALL) |
| 818 | { |
| 819 | strings.push_back("VK_SHADER_STAGE_ALL"); |
| 820 | } |
| 821 | if(enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) |
| 822 | { |
| 823 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
| 824 | } |
| 825 | if(enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) |
| 826 | { |
| 827 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 828 | } |
| 829 | if(enumerator & VK_SHADER_STAGE_COMPUTE_BIT) |
| 830 | { |
| 831 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 832 | } |
| 833 | if(enumerator & VK_SHADER_STAGE_TESS_EVALUATION_BIT) |
| 834 | { |
| 835 | strings.push_back("VK_SHADER_STAGE_TESS_EVALUATION_BIT"); |
| 836 | } |
| 837 | if(enumerator & VK_SHADER_STAGE_TESS_CONTROL_BIT) |
| 838 | { |
| 839 | strings.push_back("VK_SHADER_STAGE_TESS_CONTROL_BIT"); |
| 840 | } |
| 841 | if(enumerator & VK_SHADER_STAGE_VERTEX_BIT) |
| 842 | { |
| 843 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
| 844 | } |
| 845 | |
| 846 | std::string enumeratorString; |
| 847 | for(auto const& string : strings) |
| 848 | { |
| 849 | enumeratorString += string; |
| 850 | |
| 851 | if(string != strings.back()) |
| 852 | { |
| 853 | enumeratorString += '|'; |
| 854 | } |
| 855 | } |
| 856 | |
| 857 | return enumeratorString; |
| 858 | } |
| 859 | |
| 860 | static |
| 861 | bool ValidateEnumerator(VkImageUsageFlagBits const& enumerator) |
| 862 | { |
| 863 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)(VK_IMAGE_USAGE_DEPTH_STENCIL_BIT | |
| 864 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 865 | VK_IMAGE_USAGE_STORAGE_BIT | |
| 866 | VK_IMAGE_USAGE_SAMPLED_BIT | |
| 867 | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT | |
| 868 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | |
| 869 | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT | |
| 870 | VK_IMAGE_USAGE_GENERAL); |
| 871 | if(enumerator & (~allFlags)) |
| 872 | { |
| 873 | return false; |
| 874 | } |
| 875 | |
| 876 | return true; |
| 877 | } |
| 878 | |
| 879 | static |
| 880 | std::string EnumeratorString(VkImageUsageFlagBits const& enumerator) |
| 881 | { |
| 882 | if(!ValidateEnumerator(enumerator)) |
| 883 | { |
| 884 | return "unrecognized enumerator"; |
| 885 | } |
| 886 | |
| 887 | std::vector<std::string> strings; |
| 888 | if(enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_BIT) |
| 889 | { |
| 890 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_BIT"); |
| 891 | } |
| 892 | if(enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) |
| 893 | { |
| 894 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 895 | } |
| 896 | if(enumerator & VK_IMAGE_USAGE_STORAGE_BIT) |
| 897 | { |
| 898 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 899 | } |
| 900 | if(enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) |
| 901 | { |
| 902 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 903 | } |
| 904 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) |
| 905 | { |
| 906 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT"); |
| 907 | } |
| 908 | if(enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) |
| 909 | { |
| 910 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 911 | } |
| 912 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) |
| 913 | { |
| 914 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT"); |
| 915 | } |
| 916 | if(enumerator & VK_IMAGE_USAGE_GENERAL) |
| 917 | { |
| 918 | strings.push_back("VK_IMAGE_USAGE_GENERAL"); |
| 919 | } |
| 920 | |
| 921 | std::string enumeratorString; |
| 922 | for(auto const& string : strings) |
| 923 | { |
| 924 | enumeratorString += string; |
| 925 | |
| 926 | if(string != strings.back()) |
| 927 | { |
| 928 | enumeratorString += '|'; |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | return enumeratorString; |
| 933 | } |
| 934 | |
| 935 | static |
| 936 | bool ValidateEnumerator(VkImageCreateFlagBits const& enumerator) |
| 937 | { |
| 938 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)(VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 939 | VK_IMAGE_CREATE_INVARIANT_DATA_BIT | |
| 940 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | |
| 941 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 942 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 943 | VK_IMAGE_CREATE_SPARSE_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 944 | if(enumerator & (~allFlags)) |
| 945 | { |
| 946 | return false; |
| 947 | } |
| 948 | |
| 949 | return true; |
| 950 | } |
| 951 | |
| 952 | static |
| 953 | std::string EnumeratorString(VkImageCreateFlagBits const& enumerator) |
| 954 | { |
| 955 | if(!ValidateEnumerator(enumerator)) |
| 956 | { |
| 957 | return "unrecognized enumerator"; |
| 958 | } |
| 959 | |
| 960 | std::vector<std::string> strings; |
| 961 | if(enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) |
| 962 | { |
| 963 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 964 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 965 | if(enumerator & VK_IMAGE_CREATE_INVARIANT_DATA_BIT) |
| 966 | { |
| 967 | strings.push_back("VK_IMAGE_CREATE_INVARIANT_DATA_BIT"); |
| 968 | } |
| 969 | if(enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) |
| 970 | { |
| 971 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 972 | } |
| 973 | if(enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) |
| 974 | { |
| 975 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 976 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 977 | if(enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) |
| 978 | { |
| 979 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 980 | } |
| 981 | if(enumerator & VK_IMAGE_CREATE_SPARSE_BIT) |
| 982 | { |
| 983 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BIT"); |
| 984 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 985 | |
| 986 | std::string enumeratorString; |
| 987 | for(auto const& string : strings) |
| 988 | { |
| 989 | enumeratorString += string; |
| 990 | |
| 991 | if(string != strings.back()) |
| 992 | { |
| 993 | enumeratorString += '|'; |
| 994 | } |
| 995 | } |
| 996 | |
| 997 | return enumeratorString; |
| 998 | } |
| 999 | |
| 1000 | static |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1001 | bool ValidateEnumerator(VkAttachmentViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1002 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1003 | VkAttachmentViewCreateFlagBits allFlags = (VkAttachmentViewCreateFlagBits)(VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT | |
| 1004 | VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1005 | if(enumerator & (~allFlags)) |
| 1006 | { |
| 1007 | return false; |
| 1008 | } |
| 1009 | |
| 1010 | return true; |
| 1011 | } |
| 1012 | |
| 1013 | static |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1014 | std::string EnumeratorString(VkAttachmentViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1015 | { |
| 1016 | if(!ValidateEnumerator(enumerator)) |
| 1017 | { |
| 1018 | return "unrecognized enumerator"; |
| 1019 | } |
| 1020 | |
| 1021 | std::vector<std::string> strings; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1022 | if(enumerator & VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1023 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1024 | strings.push_back("VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1025 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1026 | if(enumerator & VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_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_DEPTH_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1029 | } |
| 1030 | |
| 1031 | std::string enumeratorString; |
| 1032 | for(auto const& string : strings) |
| 1033 | { |
| 1034 | enumeratorString += string; |
| 1035 | |
| 1036 | if(string != strings.back()) |
| 1037 | { |
| 1038 | enumeratorString += '|'; |
| 1039 | } |
| 1040 | } |
| 1041 | |
| 1042 | return enumeratorString; |
| 1043 | } |
| 1044 | |
| 1045 | static |
| 1046 | bool ValidateEnumerator(VkPipelineCreateFlagBits const& enumerator) |
| 1047 | { |
| 1048 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)(VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | |
| 1049 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
| 1050 | if(enumerator & (~allFlags)) |
| 1051 | { |
| 1052 | return false; |
| 1053 | } |
| 1054 | |
| 1055 | return true; |
| 1056 | } |
| 1057 | |
| 1058 | static |
| 1059 | std::string EnumeratorString(VkPipelineCreateFlagBits const& enumerator) |
| 1060 | { |
| 1061 | if(!ValidateEnumerator(enumerator)) |
| 1062 | { |
| 1063 | return "unrecognized enumerator"; |
| 1064 | } |
| 1065 | |
| 1066 | std::vector<std::string> strings; |
| 1067 | if(enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) |
| 1068 | { |
| 1069 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 1070 | } |
| 1071 | if(enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) |
| 1072 | { |
| 1073 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
| 1074 | } |
| 1075 | |
| 1076 | std::string enumeratorString; |
| 1077 | for(auto const& string : strings) |
| 1078 | { |
| 1079 | enumeratorString += string; |
| 1080 | |
| 1081 | if(string != strings.back()) |
| 1082 | { |
| 1083 | enumeratorString += '|'; |
| 1084 | } |
| 1085 | } |
| 1086 | |
| 1087 | return enumeratorString; |
| 1088 | } |
| 1089 | |
| 1090 | static |
| 1091 | bool ValidateEnumerator(VkChannelFlagBits const& enumerator) |
| 1092 | { |
| 1093 | VkChannelFlagBits allFlags = (VkChannelFlagBits)(VK_CHANNEL_A_BIT | |
| 1094 | VK_CHANNEL_B_BIT | |
| 1095 | VK_CHANNEL_G_BIT | |
| 1096 | VK_CHANNEL_R_BIT); |
| 1097 | if(enumerator & (~allFlags)) |
| 1098 | { |
| 1099 | return false; |
| 1100 | } |
| 1101 | |
| 1102 | return true; |
| 1103 | } |
| 1104 | |
| 1105 | static |
| 1106 | std::string EnumeratorString(VkChannelFlagBits const& enumerator) |
| 1107 | { |
| 1108 | if(!ValidateEnumerator(enumerator)) |
| 1109 | { |
| 1110 | return "unrecognized enumerator"; |
| 1111 | } |
| 1112 | |
| 1113 | std::vector<std::string> strings; |
| 1114 | if(enumerator & VK_CHANNEL_A_BIT) |
| 1115 | { |
| 1116 | strings.push_back("VK_CHANNEL_A_BIT"); |
| 1117 | } |
| 1118 | if(enumerator & VK_CHANNEL_B_BIT) |
| 1119 | { |
| 1120 | strings.push_back("VK_CHANNEL_B_BIT"); |
| 1121 | } |
| 1122 | if(enumerator & VK_CHANNEL_G_BIT) |
| 1123 | { |
| 1124 | strings.push_back("VK_CHANNEL_G_BIT"); |
| 1125 | } |
| 1126 | if(enumerator & VK_CHANNEL_R_BIT) |
| 1127 | { |
| 1128 | strings.push_back("VK_CHANNEL_R_BIT"); |
| 1129 | } |
| 1130 | |
| 1131 | std::string enumeratorString; |
| 1132 | for(auto const& string : strings) |
| 1133 | { |
| 1134 | enumeratorString += string; |
| 1135 | |
| 1136 | if(string != strings.back()) |
| 1137 | { |
| 1138 | enumeratorString += '|'; |
| 1139 | } |
| 1140 | } |
| 1141 | |
| 1142 | return enumeratorString; |
| 1143 | } |
| 1144 | |
| 1145 | static |
| 1146 | bool ValidateEnumerator(VkFenceCreateFlagBits const& enumerator) |
| 1147 | { |
| 1148 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
| 1149 | if(enumerator & (~allFlags)) |
| 1150 | { |
| 1151 | return false; |
| 1152 | } |
| 1153 | |
| 1154 | return true; |
| 1155 | } |
| 1156 | |
| 1157 | static |
| 1158 | std::string EnumeratorString(VkFenceCreateFlagBits const& enumerator) |
| 1159 | { |
| 1160 | if(!ValidateEnumerator(enumerator)) |
| 1161 | { |
| 1162 | return "unrecognized enumerator"; |
| 1163 | } |
| 1164 | |
| 1165 | std::vector<std::string> strings; |
| 1166 | if(enumerator & VK_FENCE_CREATE_SIGNALED_BIT) |
| 1167 | { |
| 1168 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 1169 | } |
| 1170 | |
| 1171 | std::string enumeratorString; |
| 1172 | for(auto const& string : strings) |
| 1173 | { |
| 1174 | enumeratorString += string; |
| 1175 | |
| 1176 | if(string != strings.back()) |
| 1177 | { |
| 1178 | enumeratorString += '|'; |
| 1179 | } |
| 1180 | } |
| 1181 | |
| 1182 | return enumeratorString; |
| 1183 | } |
| 1184 | |
| 1185 | static |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1186 | bool ValidateEnumerator(VkSparseImageFormatFlagBits const& enumerator) |
| 1187 | { |
| 1188 | VkSparseImageFormatFlagBits allFlags = (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT | |
| 1189 | VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT | |
| 1190 | VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT); |
| 1191 | if(enumerator & (~allFlags)) |
| 1192 | { |
| 1193 | return false; |
| 1194 | } |
| 1195 | |
| 1196 | return true; |
| 1197 | } |
| 1198 | |
| 1199 | static |
| 1200 | std::string EnumeratorString(VkSparseImageFormatFlagBits const& enumerator) |
| 1201 | { |
| 1202 | if(!ValidateEnumerator(enumerator)) |
| 1203 | { |
| 1204 | return "unrecognized enumerator"; |
| 1205 | } |
| 1206 | |
| 1207 | std::vector<std::string> strings; |
| 1208 | if(enumerator & VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT) |
| 1209 | { |
| 1210 | strings.push_back("VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT"); |
| 1211 | } |
| 1212 | if(enumerator & VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT) |
| 1213 | { |
| 1214 | strings.push_back("VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT"); |
| 1215 | } |
| 1216 | if(enumerator & VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT) |
| 1217 | { |
| 1218 | strings.push_back("VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT"); |
| 1219 | } |
| 1220 | |
| 1221 | std::string enumeratorString; |
| 1222 | for(auto const& string : strings) |
| 1223 | { |
| 1224 | enumeratorString += string; |
| 1225 | |
| 1226 | if(string != strings.back()) |
| 1227 | { |
| 1228 | enumeratorString += '|'; |
| 1229 | } |
| 1230 | } |
| 1231 | |
| 1232 | return enumeratorString; |
| 1233 | } |
| 1234 | |
| 1235 | static |
| 1236 | bool ValidateEnumerator(VkSparseMemoryBindFlagBits const& enumerator) |
| 1237 | { |
| 1238 | VkSparseMemoryBindFlagBits allFlags = (VkSparseMemoryBindFlagBits)(VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT); |
| 1239 | if(enumerator & (~allFlags)) |
| 1240 | { |
| 1241 | return false; |
| 1242 | } |
| 1243 | |
| 1244 | return true; |
| 1245 | } |
| 1246 | |
| 1247 | static |
| 1248 | std::string EnumeratorString(VkSparseMemoryBindFlagBits const& enumerator) |
| 1249 | { |
| 1250 | if(!ValidateEnumerator(enumerator)) |
| 1251 | { |
| 1252 | return "unrecognized enumerator"; |
| 1253 | } |
| 1254 | |
| 1255 | std::vector<std::string> strings; |
| 1256 | if(enumerator & VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT) |
| 1257 | { |
| 1258 | strings.push_back("VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT"); |
| 1259 | } |
| 1260 | |
| 1261 | std::string enumeratorString; |
| 1262 | for(auto const& string : strings) |
| 1263 | { |
| 1264 | enumeratorString += string; |
| 1265 | |
| 1266 | if(string != strings.back()) |
| 1267 | { |
| 1268 | enumeratorString += '|'; |
| 1269 | } |
| 1270 | } |
| 1271 | |
| 1272 | return enumeratorString; |
| 1273 | } |
| 1274 | |
| 1275 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1276 | bool ValidateEnumerator(VkFormatFeatureFlagBits const& enumerator) |
| 1277 | { |
| 1278 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)(VK_FORMAT_FEATURE_CONVERSION_BIT | |
| 1279 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | |
| 1280 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 1281 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | |
| 1282 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 1283 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | |
| 1284 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | |
| 1285 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 1286 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | |
| 1287 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
| 1288 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT); |
| 1289 | if(enumerator & (~allFlags)) |
| 1290 | { |
| 1291 | return false; |
| 1292 | } |
| 1293 | |
| 1294 | return true; |
| 1295 | } |
| 1296 | |
| 1297 | static |
| 1298 | std::string EnumeratorString(VkFormatFeatureFlagBits const& enumerator) |
| 1299 | { |
| 1300 | if(!ValidateEnumerator(enumerator)) |
| 1301 | { |
| 1302 | return "unrecognized enumerator"; |
| 1303 | } |
| 1304 | |
| 1305 | std::vector<std::string> strings; |
| 1306 | if(enumerator & VK_FORMAT_FEATURE_CONVERSION_BIT) |
| 1307 | { |
| 1308 | strings.push_back("VK_FORMAT_FEATURE_CONVERSION_BIT"); |
| 1309 | } |
| 1310 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) |
| 1311 | { |
| 1312 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 1313 | } |
| 1314 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) |
| 1315 | { |
| 1316 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 1317 | } |
| 1318 | if(enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) |
| 1319 | { |
| 1320 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 1321 | } |
| 1322 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) |
| 1323 | { |
| 1324 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 1325 | } |
| 1326 | if(enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) |
| 1327 | { |
| 1328 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 1329 | } |
| 1330 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) |
| 1331 | { |
| 1332 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 1333 | } |
| 1334 | if(enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) |
| 1335 | { |
| 1336 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 1337 | } |
| 1338 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) |
| 1339 | { |
| 1340 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 1341 | } |
| 1342 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 1343 | { |
| 1344 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 1345 | } |
| 1346 | if(enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 1347 | { |
| 1348 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 1349 | } |
| 1350 | |
| 1351 | std::string enumeratorString; |
| 1352 | for(auto const& string : strings) |
| 1353 | { |
| 1354 | enumeratorString += string; |
| 1355 | |
| 1356 | if(string != strings.back()) |
| 1357 | { |
| 1358 | enumeratorString += '|'; |
| 1359 | } |
| 1360 | } |
| 1361 | |
| 1362 | return enumeratorString; |
| 1363 | } |
| 1364 | |
| 1365 | static |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1366 | bool ValidateEnumerator(VkImageAspectFlagBits const& enumerator) |
| 1367 | { |
| 1368 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1369 | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 1370 | VK_IMAGE_ASPECT_COLOR_BIT); |
| 1371 | if(enumerator & (~allFlags)) |
| 1372 | { |
| 1373 | return false; |
| 1374 | } |
| 1375 | |
| 1376 | return true; |
| 1377 | } |
| 1378 | |
| 1379 | static |
| 1380 | std::string EnumeratorString(VkImageAspectFlagBits const& enumerator) |
| 1381 | { |
| 1382 | if(!ValidateEnumerator(enumerator)) |
| 1383 | { |
| 1384 | return "unrecognized enumerator"; |
| 1385 | } |
| 1386 | |
| 1387 | std::vector<std::string> strings; |
| 1388 | if(enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) |
| 1389 | { |
| 1390 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1391 | } |
| 1392 | if(enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) |
| 1393 | { |
| 1394 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1395 | } |
| 1396 | if(enumerator & VK_IMAGE_ASPECT_COLOR_BIT) |
| 1397 | { |
| 1398 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1399 | } |
| 1400 | |
| 1401 | std::string enumeratorString; |
| 1402 | for(auto const& string : strings) |
| 1403 | { |
| 1404 | enumeratorString += string; |
| 1405 | |
| 1406 | if(string != strings.back()) |
| 1407 | { |
| 1408 | enumeratorString += '|'; |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | return enumeratorString; |
| 1413 | } |
| 1414 | |
| 1415 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1416 | bool ValidateEnumerator(VkQueryControlFlagBits const& enumerator) |
| 1417 | { |
| 1418 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_CONSERVATIVE_BIT); |
| 1419 | if(enumerator & (~allFlags)) |
| 1420 | { |
| 1421 | return false; |
| 1422 | } |
| 1423 | |
| 1424 | return true; |
| 1425 | } |
| 1426 | |
| 1427 | static |
| 1428 | std::string EnumeratorString(VkQueryControlFlagBits const& enumerator) |
| 1429 | { |
| 1430 | if(!ValidateEnumerator(enumerator)) |
| 1431 | { |
| 1432 | return "unrecognized enumerator"; |
| 1433 | } |
| 1434 | |
| 1435 | std::vector<std::string> strings; |
| 1436 | if(enumerator & VK_QUERY_CONTROL_CONSERVATIVE_BIT) |
| 1437 | { |
| 1438 | strings.push_back("VK_QUERY_CONTROL_CONSERVATIVE_BIT"); |
| 1439 | } |
| 1440 | |
| 1441 | std::string enumeratorString; |
| 1442 | for(auto const& string : strings) |
| 1443 | { |
| 1444 | enumeratorString += string; |
| 1445 | |
| 1446 | if(string != strings.back()) |
| 1447 | { |
| 1448 | enumeratorString += '|'; |
| 1449 | } |
| 1450 | } |
| 1451 | |
| 1452 | return enumeratorString; |
| 1453 | } |
| 1454 | |
| 1455 | static |
| 1456 | bool ValidateEnumerator(VkQueryResultFlagBits const& enumerator) |
| 1457 | { |
| 1458 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | |
| 1459 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 1460 | VK_QUERY_RESULT_WAIT_BIT | |
| 1461 | VK_QUERY_RESULT_64_BIT | |
| 1462 | VK_QUERY_RESULT_DEFAULT); |
| 1463 | if(enumerator & (~allFlags)) |
| 1464 | { |
| 1465 | return false; |
| 1466 | } |
| 1467 | |
| 1468 | return true; |
| 1469 | } |
| 1470 | |
| 1471 | static |
| 1472 | std::string EnumeratorString(VkQueryResultFlagBits const& enumerator) |
| 1473 | { |
| 1474 | if(!ValidateEnumerator(enumerator)) |
| 1475 | { |
| 1476 | return "unrecognized enumerator"; |
| 1477 | } |
| 1478 | |
| 1479 | std::vector<std::string> strings; |
| 1480 | if(enumerator & VK_QUERY_RESULT_PARTIAL_BIT) |
| 1481 | { |
| 1482 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 1483 | } |
| 1484 | if(enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) |
| 1485 | { |
| 1486 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 1487 | } |
| 1488 | if(enumerator & VK_QUERY_RESULT_WAIT_BIT) |
| 1489 | { |
| 1490 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 1491 | } |
| 1492 | if(enumerator & VK_QUERY_RESULT_64_BIT) |
| 1493 | { |
| 1494 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 1495 | } |
| 1496 | if(enumerator & VK_QUERY_RESULT_DEFAULT) |
| 1497 | { |
| 1498 | strings.push_back("VK_QUERY_RESULT_DEFAULT"); |
| 1499 | } |
| 1500 | |
| 1501 | std::string enumeratorString; |
| 1502 | for(auto const& string : strings) |
| 1503 | { |
| 1504 | enumeratorString += string; |
| 1505 | |
| 1506 | if(string != strings.back()) |
| 1507 | { |
| 1508 | enumeratorString += '|'; |
| 1509 | } |
| 1510 | } |
| 1511 | |
| 1512 | return enumeratorString; |
| 1513 | } |
| 1514 | |
| 1515 | static |
| 1516 | bool ValidateEnumerator(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1517 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1518 | VkCmdBufferOptimizeFlagBits allFlags = (VkCmdBufferOptimizeFlagBits)(VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT | |
| 1519 | VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1520 | VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT | |
| 1521 | VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT | |
| 1522 | VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT); |
| 1523 | if(enumerator & (~allFlags)) |
| 1524 | { |
| 1525 | return false; |
| 1526 | } |
| 1527 | |
| 1528 | return true; |
| 1529 | } |
| 1530 | |
| 1531 | static |
| 1532 | std::string EnumeratorString(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1533 | { |
| 1534 | if(!ValidateEnumerator(enumerator)) |
| 1535 | { |
| 1536 | return "unrecognized enumerator"; |
| 1537 | } |
| 1538 | |
| 1539 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1540 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT) |
| 1541 | { |
| 1542 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT"); |
| 1543 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1544 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT) |
| 1545 | { |
| 1546 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT"); |
| 1547 | } |
| 1548 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT) |
| 1549 | { |
| 1550 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT"); |
| 1551 | } |
| 1552 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT) |
| 1553 | { |
| 1554 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT"); |
| 1555 | } |
| 1556 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT) |
| 1557 | { |
| 1558 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT"); |
| 1559 | } |
| 1560 | |
| 1561 | std::string enumeratorString; |
| 1562 | for(auto const& string : strings) |
| 1563 | { |
| 1564 | enumeratorString += string; |
| 1565 | |
| 1566 | if(string != strings.back()) |
| 1567 | { |
| 1568 | enumeratorString += '|'; |
| 1569 | } |
| 1570 | } |
| 1571 | |
| 1572 | return enumeratorString; |
| 1573 | } |
| 1574 | |
| 1575 | static |
| 1576 | bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 1577 | { |
| 1578 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)(VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT | |
| 1579 | VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT | |
| 1580 | VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT | |
| 1581 | VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT | |
| 1582 | VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT | |
| 1583 | VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT | |
| 1584 | VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT | |
| 1585 | VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT | |
| 1586 | VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT | |
| 1587 | VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT | |
| 1588 | VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT); |
| 1589 | if(enumerator & (~allFlags)) |
| 1590 | { |
| 1591 | return false; |
| 1592 | } |
| 1593 | |
| 1594 | return true; |
| 1595 | } |
| 1596 | |
| 1597 | static |
| 1598 | std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 1599 | { |
| 1600 | if(!ValidateEnumerator(enumerator)) |
| 1601 | { |
| 1602 | return "unrecognized enumerator"; |
| 1603 | } |
| 1604 | |
| 1605 | std::vector<std::string> strings; |
| 1606 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT) |
| 1607 | { |
| 1608 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT"); |
| 1609 | } |
| 1610 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT) |
| 1611 | { |
| 1612 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT"); |
| 1613 | } |
| 1614 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT) |
| 1615 | { |
| 1616 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT"); |
| 1617 | } |
| 1618 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT) |
| 1619 | { |
| 1620 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT"); |
| 1621 | } |
| 1622 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT) |
| 1623 | { |
| 1624 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT"); |
| 1625 | } |
| 1626 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT) |
| 1627 | { |
| 1628 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT"); |
| 1629 | } |
| 1630 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT) |
| 1631 | { |
| 1632 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT"); |
| 1633 | } |
| 1634 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT) |
| 1635 | { |
| 1636 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT"); |
| 1637 | } |
| 1638 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT) |
| 1639 | { |
| 1640 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT"); |
| 1641 | } |
| 1642 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT) |
| 1643 | { |
| 1644 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT"); |
| 1645 | } |
| 1646 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT) |
| 1647 | { |
| 1648 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT"); |
| 1649 | } |
| 1650 | |
| 1651 | std::string enumeratorString; |
| 1652 | for(auto const& string : strings) |
| 1653 | { |
| 1654 | enumeratorString += string; |
| 1655 | |
| 1656 | if(string != strings.back()) |
| 1657 | { |
| 1658 | enumeratorString += '|'; |
| 1659 | } |
| 1660 | } |
| 1661 | |
| 1662 | return enumeratorString; |
| 1663 | } |
| 1664 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1665 | static |
| 1666 | bool ValidateEnumerator(VkMemoryHeapFlagBits const& enumerator) |
| 1667 | { |
| 1668 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_HOST_LOCAL); |
| 1669 | if(enumerator & (~allFlags)) |
| 1670 | { |
| 1671 | return false; |
| 1672 | } |
| 1673 | |
| 1674 | return true; |
| 1675 | } |
| 1676 | |
| 1677 | static |
| 1678 | std::string EnumeratorString(VkMemoryHeapFlagBits const& enumerator) |
| 1679 | { |
| 1680 | if(!ValidateEnumerator(enumerator)) |
| 1681 | { |
| 1682 | return "unrecognized enumerator"; |
| 1683 | } |
| 1684 | |
| 1685 | std::vector<std::string> strings; |
| 1686 | if(enumerator & VK_MEMORY_HEAP_HOST_LOCAL) |
| 1687 | { |
| 1688 | strings.push_back("VK_MEMORY_HEAP_HOST_LOCAL"); |
| 1689 | } |
| 1690 | |
| 1691 | std::string enumeratorString; |
| 1692 | for(auto const& string : strings) |
| 1693 | { |
| 1694 | enumeratorString += string; |
| 1695 | |
| 1696 | if(string != strings.back()) |
| 1697 | { |
| 1698 | enumeratorString += '|'; |
| 1699 | } |
| 1700 | } |
| 1701 | |
| 1702 | return enumeratorString; |
| 1703 | } |
| 1704 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1705 | VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance( |
| 1706 | const VkInstanceCreateInfo* pCreateInfo, |
| 1707 | VkInstance* pInstance) |
| 1708 | { |
| 1709 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, *pInstance); |
| 1710 | VkResult result = pTable->CreateInstance(pCreateInfo, pInstance); |
| 1711 | |
| 1712 | if (result == VK_SUCCESS) { |
| 1713 | layer_data *data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); |
| 1714 | data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->extensionCount, |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 1715 | pCreateInfo->ppEnabledExtensionNames); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1716 | |
| 1717 | InitParamChecker(data); |
| 1718 | } |
| 1719 | |
| 1720 | return result; |
| 1721 | } |
| 1722 | |
| 1723 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance( |
| 1724 | VkInstance instance) |
| 1725 | { |
| 1726 | // Grab the key before the instance is destroyed. |
| 1727 | dispatch_key key = get_dispatch_key(instance); |
| 1728 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 1729 | VkResult result = pTable->DestroyInstance(instance); |
| 1730 | |
| 1731 | // Clean up logging callback, if any |
| 1732 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 1733 | if(data->logging_callback) |
| 1734 | { |
| 1735 | layer_destroy_msg_callback(data->report_data, data->logging_callback); |
| 1736 | } |
| 1737 | |
| 1738 | layer_debug_report_destroy_instance(mid(instance)); |
| 1739 | layer_data_map.erase(pTable); |
| 1740 | |
| 1741 | pc_instance_table_map.erase(key); |
| 1742 | assert(pc_instance_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
| 1743 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1744 | return result; |
| 1745 | } |
| 1746 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1747 | bool PostEnumeratePhysicalDevices( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1748 | VkInstance instance, |
| 1749 | uint32_t* pPhysicalDeviceCount, |
| 1750 | VkPhysicalDevice* pPhysicalDevices, |
| 1751 | VkResult result) |
| 1752 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1753 | |
| 1754 | if(pPhysicalDeviceCount == nullptr) |
| 1755 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1756 | 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] | 1757 | "vkEnumeratePhysicalDevices parameter, uint32_t* pPhysicalDeviceCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1758 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1759 | } |
| 1760 | |
| 1761 | if(pPhysicalDevices == nullptr) |
| 1762 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1763 | 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] | 1764 | "vkEnumeratePhysicalDevices parameter, VkPhysicalDevice* pPhysicalDevices, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1765 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1766 | } |
| 1767 | |
| 1768 | if(result != VK_SUCCESS) |
| 1769 | { |
| 1770 | std::string reason = "vkEnumeratePhysicalDevices parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1771 | log_msg(mid(instance), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1772 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1773 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1774 | |
| 1775 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1776 | } |
| 1777 | |
| 1778 | VK_LAYER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
| 1779 | VkInstance instance, |
| 1780 | uint32_t* pPhysicalDeviceCount, |
| 1781 | VkPhysicalDevice* pPhysicalDevices) |
| 1782 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1783 | VkResult result = get_dispatch_table(pc_instance_table_map, instance)->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
| 1784 | |
| 1785 | PostEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices, result); |
| 1786 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1787 | return result; |
| 1788 | } |
| 1789 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1790 | bool PostGetPhysicalDeviceFeatures( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1791 | VkPhysicalDevice physicalDevice, |
| 1792 | VkPhysicalDeviceFeatures* pFeatures, |
| 1793 | VkResult result) |
| 1794 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1795 | |
| 1796 | if(pFeatures == nullptr) |
| 1797 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1798 | 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] | 1799 | "vkGetPhysicalDeviceFeatures parameter, VkPhysicalDeviceFeatures* pFeatures, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1800 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1801 | } |
| 1802 | |
| 1803 | if(result != VK_SUCCESS) |
| 1804 | { |
| 1805 | std::string reason = "vkGetPhysicalDeviceFeatures parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1806 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1807 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1808 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1809 | |
| 1810 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1811 | } |
| 1812 | |
| 1813 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures( |
| 1814 | VkPhysicalDevice physicalDevice, |
| 1815 | VkPhysicalDeviceFeatures* pFeatures) |
| 1816 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1817 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
| 1818 | |
| 1819 | PostGetPhysicalDeviceFeatures(physicalDevice, pFeatures, result); |
| 1820 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1821 | return result; |
| 1822 | } |
| 1823 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1824 | bool PostGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1825 | VkPhysicalDevice physicalDevice, |
| 1826 | VkFormat format, |
| 1827 | VkFormatProperties* pFormatInfo, |
| 1828 | VkResult result) |
| 1829 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1830 | |
| 1831 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 1832 | format > VK_FORMAT_END_RANGE) |
| 1833 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1834 | 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] | 1835 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormat format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1836 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1837 | } |
| 1838 | |
| 1839 | if(pFormatInfo == nullptr) |
| 1840 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1841 | 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] | 1842 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormatProperties* pFormatInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1843 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1844 | } |
| 1845 | if(!ValidateEnumerator((VkFormatFeatureFlagBits)pFormatInfo->linearTilingFeatures)) |
| 1846 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1847 | 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] | 1848 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1849 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1850 | } |
| 1851 | if(!ValidateEnumerator((VkFormatFeatureFlagBits)pFormatInfo->optimalTilingFeatures)) |
| 1852 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1853 | 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] | 1854 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1855 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1856 | } |
| 1857 | |
| 1858 | if(result != VK_SUCCESS) |
| 1859 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1860 | std::string reason = "vkGetPhysicalDeviceFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1861 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1862 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1863 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1864 | |
| 1865 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1866 | } |
| 1867 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1868 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1869 | VkPhysicalDevice physicalDevice, |
| 1870 | VkFormat format, |
| 1871 | VkFormatProperties* pFormatInfo) |
| 1872 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1873 | 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] | 1874 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1875 | PostGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatInfo, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1876 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1877 | return result; |
| 1878 | } |
| 1879 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1880 | bool PostGetPhysicalDeviceLimits( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1881 | VkPhysicalDevice physicalDevice, |
| 1882 | VkPhysicalDeviceLimits* pLimits, |
| 1883 | VkResult result) |
| 1884 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1885 | |
| 1886 | if(pLimits == nullptr) |
| 1887 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1888 | 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] | 1889 | "vkGetPhysicalDeviceLimits parameter, VkPhysicalDeviceLimits* pLimits, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1890 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1891 | } |
| 1892 | |
| 1893 | if(result != VK_SUCCESS) |
| 1894 | { |
| 1895 | std::string reason = "vkGetPhysicalDeviceLimits parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1896 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1897 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1898 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1899 | |
| 1900 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1901 | } |
| 1902 | |
| 1903 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits( |
| 1904 | VkPhysicalDevice physicalDevice, |
| 1905 | VkPhysicalDeviceLimits* pLimits) |
| 1906 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1907 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceLimits(physicalDevice, pLimits); |
| 1908 | |
| 1909 | PostGetPhysicalDeviceLimits(physicalDevice, pLimits, result); |
| 1910 | |
| 1911 | return result; |
| 1912 | } |
| 1913 | |
| 1914 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice( |
| 1915 | VkPhysicalDevice physicalDevice, |
| 1916 | const VkDeviceCreateInfo* pCreateInfo, |
| 1917 | VkDevice* pDevice) |
| 1918 | { |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 1919 | VkLayerDispatchTable *pTable = get_dispatch_table(pc_device_table_map, *pDevice); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1920 | VkResult result = pTable->CreateDevice(physicalDevice, pCreateInfo, pDevice); |
| 1921 | if(result == VK_SUCCESS) |
| 1922 | { |
| 1923 | layer_data *instance_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
| 1924 | layer_data *device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); |
| 1925 | device_data->report_data = layer_debug_report_create_device(instance_data->report_data, *pDevice); |
| 1926 | } |
| 1927 | |
| 1928 | return result; |
| 1929 | } |
| 1930 | |
| 1931 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice( |
| 1932 | VkDevice device) |
| 1933 | { |
| 1934 | layer_debug_report_destroy_device(device); |
| 1935 | |
| 1936 | dispatch_key key = get_dispatch_key(device); |
| 1937 | #if DISPATCH_MAP_DEBUG |
| 1938 | fprintf(stderr, "Device: %p, key: %p\n", device, key); |
| 1939 | #endif |
| 1940 | |
| 1941 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device); |
| 1942 | pc_device_table_map.erase(key); |
| 1943 | assert(pc_device_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
| 1944 | |
| 1945 | return result; |
| 1946 | } |
| 1947 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1948 | bool PostGetPhysicalDeviceProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1949 | VkPhysicalDevice physicalDevice, |
| 1950 | VkPhysicalDeviceProperties* pProperties, |
| 1951 | VkResult result) |
| 1952 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1953 | |
| 1954 | if(pProperties == nullptr) |
| 1955 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1956 | 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] | 1957 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceProperties* pProperties, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1958 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1959 | } |
| 1960 | if(pProperties->deviceType < VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE || |
| 1961 | pProperties->deviceType > VK_PHYSICAL_DEVICE_TYPE_END_RANGE) |
| 1962 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1963 | 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] | 1964 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceType pProperties->deviceType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1965 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1966 | } |
| 1967 | |
| 1968 | if(result != VK_SUCCESS) |
| 1969 | { |
| 1970 | std::string reason = "vkGetPhysicalDeviceProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1971 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1972 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1973 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1974 | |
| 1975 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1976 | } |
| 1977 | |
| 1978 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties( |
| 1979 | VkPhysicalDevice physicalDevice, |
| 1980 | VkPhysicalDeviceProperties* pProperties) |
| 1981 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1982 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties(physicalDevice, pProperties); |
| 1983 | |
| 1984 | PostGetPhysicalDeviceProperties(physicalDevice, pProperties, result); |
| 1985 | |
| 1986 | return result; |
| 1987 | } |
| 1988 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1989 | bool PostGetPhysicalDeviceQueueCount( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1990 | VkPhysicalDevice physicalDevice, |
| 1991 | uint32_t* pCount, |
| 1992 | VkResult result) |
| 1993 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1994 | |
| 1995 | if(pCount == nullptr) |
| 1996 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1997 | 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] | 1998 | "vkGetPhysicalDeviceQueueCount parameter, uint32_t* pCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1999 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2000 | } |
| 2001 | |
| 2002 | if(result != VK_SUCCESS) |
| 2003 | { |
| 2004 | std::string reason = "vkGetPhysicalDeviceQueueCount parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2005 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2006 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2007 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2008 | |
| 2009 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2010 | } |
| 2011 | |
| 2012 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueCount( |
| 2013 | VkPhysicalDevice physicalDevice, |
| 2014 | uint32_t* pCount) |
| 2015 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2016 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceQueueCount(physicalDevice, pCount); |
| 2017 | |
| 2018 | PostGetPhysicalDeviceQueueCount(physicalDevice, pCount, result); |
| 2019 | |
| 2020 | return result; |
| 2021 | } |
| 2022 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2023 | bool PostGetPhysicalDeviceQueueProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2024 | VkPhysicalDevice physicalDevice, |
| 2025 | uint32_t count, |
| 2026 | VkPhysicalDeviceQueueProperties* pQueueProperties, |
| 2027 | VkResult result) |
| 2028 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2029 | |
| 2030 | |
| 2031 | if(pQueueProperties == nullptr) |
| 2032 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2033 | 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] | 2034 | "vkGetPhysicalDeviceQueueProperties parameter, VkPhysicalDeviceQueueProperties* pQueueProperties, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2035 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2036 | } |
| 2037 | if(!ValidateEnumerator((VkQueueFlagBits)pQueueProperties->queueFlags)) |
| 2038 | { |
| 2039 | 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] | 2040 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2041 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2042 | } |
| 2043 | |
| 2044 | if(result != VK_SUCCESS) |
| 2045 | { |
| 2046 | std::string reason = "vkGetPhysicalDeviceQueueProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2047 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2048 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2049 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2050 | |
| 2051 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2052 | } |
| 2053 | |
| 2054 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties( |
| 2055 | VkPhysicalDevice physicalDevice, |
| 2056 | uint32_t count, |
| 2057 | VkPhysicalDeviceQueueProperties* pQueueProperties) |
| 2058 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2059 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceQueueProperties(physicalDevice, count, pQueueProperties); |
| 2060 | |
| 2061 | PostGetPhysicalDeviceQueueProperties(physicalDevice, count, pQueueProperties, result); |
| 2062 | |
| 2063 | return result; |
| 2064 | } |
| 2065 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2066 | bool PostGetPhysicalDeviceMemoryProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2067 | VkPhysicalDevice physicalDevice, |
| 2068 | VkPhysicalDeviceMemoryProperties* pMemoryProperies, |
| 2069 | VkResult result) |
| 2070 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2071 | |
| 2072 | if(pMemoryProperies == nullptr) |
| 2073 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2074 | 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] | 2075 | "vkGetPhysicalDeviceMemoryProperties parameter, VkPhysicalDeviceMemoryProperties* pMemoryProperies, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2076 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2077 | } |
| 2078 | |
| 2079 | if(result != VK_SUCCESS) |
| 2080 | { |
| 2081 | std::string reason = "vkGetPhysicalDeviceMemoryProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2082 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2083 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2084 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2085 | |
| 2086 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2087 | } |
| 2088 | |
| 2089 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( |
| 2090 | VkPhysicalDevice physicalDevice, |
| 2091 | VkPhysicalDeviceMemoryProperties* pMemoryProperies) |
| 2092 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2093 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperies); |
| 2094 | |
| 2095 | PostGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperies, result); |
| 2096 | |
| 2097 | return result; |
| 2098 | } |
| 2099 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2100 | bool PostGetDeviceQueue( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2101 | VkDevice device, |
| 2102 | uint32_t queueNodeIndex, |
| 2103 | uint32_t queueIndex, |
| 2104 | VkQueue* pQueue, |
| 2105 | VkResult result) |
| 2106 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2107 | |
| 2108 | |
| 2109 | |
| 2110 | if(pQueue == nullptr) |
| 2111 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2112 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2113 | "vkGetDeviceQueue parameter, VkQueue* pQueue, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2114 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2115 | } |
| 2116 | |
| 2117 | if(result != VK_SUCCESS) |
| 2118 | { |
| 2119 | std::string reason = "vkGetDeviceQueue parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2120 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2121 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2122 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2123 | |
| 2124 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2125 | } |
| 2126 | |
| 2127 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceQueue( |
| 2128 | VkDevice device, |
| 2129 | uint32_t queueNodeIndex, |
| 2130 | uint32_t queueIndex, |
| 2131 | VkQueue* pQueue) |
| 2132 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2133 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); |
| 2134 | |
| 2135 | PostGetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue, result); |
| 2136 | |
| 2137 | return result; |
| 2138 | } |
| 2139 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2140 | bool PreQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2141 | VkQueue queue, |
| 2142 | const VkCmdBuffer* pCmdBuffers) |
| 2143 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2144 | if(pCmdBuffers == nullptr) |
| 2145 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2146 | 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] | 2147 | "vkQueueSubmit parameter, const VkCmdBuffer* pCmdBuffers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2148 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2149 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2150 | |
| 2151 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2152 | } |
| 2153 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2154 | bool PostQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2155 | VkQueue queue, |
| 2156 | uint32_t cmdBufferCount, |
| 2157 | VkFence fence, |
| 2158 | VkResult result) |
| 2159 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2160 | |
| 2161 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2162 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2163 | if(result != VK_SUCCESS) |
| 2164 | { |
| 2165 | std::string reason = "vkQueueSubmit parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2166 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2167 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2168 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2169 | |
| 2170 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2171 | } |
| 2172 | |
| 2173 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( |
| 2174 | VkQueue queue, |
| 2175 | uint32_t cmdBufferCount, |
| 2176 | const VkCmdBuffer* pCmdBuffers, |
| 2177 | VkFence fence) |
| 2178 | { |
| 2179 | PreQueueSubmit(queue, pCmdBuffers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2180 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2181 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence); |
| 2182 | |
| 2183 | PostQueueSubmit(queue, cmdBufferCount, fence, result); |
| 2184 | |
| 2185 | return result; |
| 2186 | } |
| 2187 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2188 | bool PostQueueWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2189 | VkQueue queue, |
| 2190 | VkResult result) |
| 2191 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2192 | |
| 2193 | if(result != VK_SUCCESS) |
| 2194 | { |
| 2195 | std::string reason = "vkQueueWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2196 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2197 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2198 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2199 | |
| 2200 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2201 | } |
| 2202 | |
| 2203 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitIdle( |
| 2204 | VkQueue queue) |
| 2205 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2206 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue); |
| 2207 | |
| 2208 | PostQueueWaitIdle(queue, result); |
| 2209 | |
| 2210 | return result; |
| 2211 | } |
| 2212 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2213 | bool PostDeviceWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2214 | VkDevice device, |
| 2215 | VkResult result) |
| 2216 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2217 | |
| 2218 | if(result != VK_SUCCESS) |
| 2219 | { |
| 2220 | std::string reason = "vkDeviceWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2221 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2222 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2223 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2224 | |
| 2225 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2226 | } |
| 2227 | |
| 2228 | VK_LAYER_EXPORT VkResult VKAPI vkDeviceWaitIdle( |
| 2229 | VkDevice device) |
| 2230 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2231 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device); |
| 2232 | |
| 2233 | PostDeviceWaitIdle(device, result); |
| 2234 | |
| 2235 | return result; |
| 2236 | } |
| 2237 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2238 | bool PreAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2239 | VkDevice device, |
| 2240 | const VkMemoryAllocInfo* pAllocInfo) |
| 2241 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2242 | if(pAllocInfo == nullptr) |
| 2243 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2244 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2245 | "vkAllocMemory parameter, const VkMemoryAllocInfo* pAllocInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2246 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2247 | } |
| 2248 | if(pAllocInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2249 | pAllocInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2250 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2251 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2252 | "vkAllocMemory parameter, VkStructureType pAllocInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2253 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2254 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2255 | |
| 2256 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2257 | } |
| 2258 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2259 | bool PostAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2260 | VkDevice device, |
| 2261 | VkDeviceMemory* pMem, |
| 2262 | VkResult result) |
| 2263 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2264 | |
| 2265 | if(pMem == nullptr) |
| 2266 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2267 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2268 | "vkAllocMemory parameter, VkDeviceMemory* pMem, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2269 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2270 | } |
| 2271 | |
| 2272 | if(result != VK_SUCCESS) |
| 2273 | { |
| 2274 | std::string reason = "vkAllocMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2275 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2276 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2277 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2278 | |
| 2279 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2280 | } |
| 2281 | |
| 2282 | VK_LAYER_EXPORT VkResult VKAPI vkAllocMemory( |
| 2283 | VkDevice device, |
| 2284 | const VkMemoryAllocInfo* pAllocInfo, |
| 2285 | VkDeviceMemory* pMem) |
| 2286 | { |
| 2287 | PreAllocMemory(device, pAllocInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2288 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2289 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocMemory(device, pAllocInfo, pMem); |
| 2290 | |
| 2291 | PostAllocMemory(device, pMem, result); |
| 2292 | |
| 2293 | return result; |
| 2294 | } |
| 2295 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2296 | bool PostFreeMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2297 | VkDevice device, |
| 2298 | VkDeviceMemory mem, |
| 2299 | VkResult result) |
| 2300 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2301 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2302 | |
| 2303 | if(result != VK_SUCCESS) |
| 2304 | { |
| 2305 | std::string reason = "vkFreeMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2306 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2307 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2308 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2309 | |
| 2310 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2311 | } |
| 2312 | |
| 2313 | VK_LAYER_EXPORT VkResult VKAPI vkFreeMemory( |
| 2314 | VkDevice device, |
| 2315 | VkDeviceMemory mem) |
| 2316 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2317 | VkResult result = get_dispatch_table(pc_device_table_map, device)->FreeMemory(device, mem); |
| 2318 | |
| 2319 | PostFreeMemory(device, mem, result); |
| 2320 | |
| 2321 | return result; |
| 2322 | } |
| 2323 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2324 | bool PostMapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2325 | VkDevice device, |
| 2326 | VkDeviceMemory mem, |
| 2327 | VkDeviceSize offset, |
| 2328 | VkDeviceSize size, |
| 2329 | VkMemoryMapFlags flags, |
| 2330 | void** ppData, |
| 2331 | VkResult result) |
| 2332 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2333 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2334 | |
| 2335 | |
| 2336 | |
| 2337 | |
| 2338 | if(ppData == nullptr) |
| 2339 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2340 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2341 | "vkMapMemory parameter, void** ppData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2342 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2343 | } |
| 2344 | |
| 2345 | if(result != VK_SUCCESS) |
| 2346 | { |
| 2347 | std::string reason = "vkMapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2348 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2349 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2350 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2351 | |
| 2352 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2353 | } |
| 2354 | |
| 2355 | VK_LAYER_EXPORT VkResult VKAPI vkMapMemory( |
| 2356 | VkDevice device, |
| 2357 | VkDeviceMemory mem, |
| 2358 | VkDeviceSize offset, |
| 2359 | VkDeviceSize size, |
| 2360 | VkMemoryMapFlags flags, |
| 2361 | void** ppData) |
| 2362 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2363 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, mem, offset, size, flags, ppData); |
| 2364 | |
| 2365 | PostMapMemory(device, mem, offset, size, flags, ppData, result); |
| 2366 | |
| 2367 | return result; |
| 2368 | } |
| 2369 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2370 | bool PostUnmapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2371 | VkDevice device, |
| 2372 | VkDeviceMemory mem, |
| 2373 | VkResult result) |
| 2374 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2375 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2376 | |
| 2377 | if(result != VK_SUCCESS) |
| 2378 | { |
| 2379 | std::string reason = "vkUnmapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2380 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2381 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2382 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2383 | |
| 2384 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2385 | } |
| 2386 | |
| 2387 | VK_LAYER_EXPORT VkResult VKAPI vkUnmapMemory( |
| 2388 | VkDevice device, |
| 2389 | VkDeviceMemory mem) |
| 2390 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2391 | VkResult result = get_dispatch_table(pc_device_table_map, device)->UnmapMemory(device, mem); |
| 2392 | |
| 2393 | PostUnmapMemory(device, mem, result); |
| 2394 | |
| 2395 | return result; |
| 2396 | } |
| 2397 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2398 | bool PreFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2399 | VkDevice device, |
| 2400 | const VkMappedMemoryRange* pMemRanges) |
| 2401 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2402 | if(pMemRanges == nullptr) |
| 2403 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2404 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2405 | "vkFlushMappedMemoryRanges parameter, const VkMappedMemoryRange* pMemRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2406 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2407 | } |
| 2408 | if(pMemRanges->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2409 | pMemRanges->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2410 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2411 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2412 | "vkFlushMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2413 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2414 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2415 | |
| 2416 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2417 | } |
| 2418 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2419 | bool PostFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2420 | VkDevice device, |
| 2421 | uint32_t memRangeCount, |
| 2422 | VkResult result) |
| 2423 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2424 | |
| 2425 | |
| 2426 | if(result != VK_SUCCESS) |
| 2427 | { |
| 2428 | std::string reason = "vkFlushMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2429 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2430 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2431 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2432 | |
| 2433 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2434 | } |
| 2435 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2436 | VK_LAYER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2437 | VkDevice device, |
| 2438 | uint32_t memRangeCount, |
| 2439 | const VkMappedMemoryRange* pMemRanges) |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2440 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2441 | PreFlushMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2442 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2443 | 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] | 2444 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2445 | PostFlushMappedMemoryRanges(device, memRangeCount, result); |
| 2446 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2447 | return result; |
| 2448 | } |
| 2449 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2450 | bool PreInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2451 | VkDevice device, |
| 2452 | const VkMappedMemoryRange* pMemRanges) |
| 2453 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2454 | if(pMemRanges == nullptr) |
| 2455 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2456 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2457 | "vkInvalidateMappedMemoryRanges parameter, const VkMappedMemoryRange* pMemRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2458 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2459 | } |
| 2460 | if(pMemRanges->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2461 | pMemRanges->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 2462 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2463 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2464 | "vkInvalidateMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2465 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2466 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2467 | |
| 2468 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2469 | } |
| 2470 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2471 | bool PostInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2472 | VkDevice device, |
| 2473 | uint32_t memRangeCount, |
| 2474 | VkResult result) |
| 2475 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2476 | |
| 2477 | |
| 2478 | if(result != VK_SUCCESS) |
| 2479 | { |
| 2480 | std::string reason = "vkInvalidateMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2481 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2482 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2483 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2484 | |
| 2485 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2486 | } |
| 2487 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2488 | VK_LAYER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2489 | VkDevice device, |
| 2490 | uint32_t memRangeCount, |
| 2491 | const VkMappedMemoryRange* pMemRanges) |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2492 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2493 | PreInvalidateMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2494 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2495 | 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] | 2496 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2497 | PostInvalidateMappedMemoryRanges(device, memRangeCount, result); |
| 2498 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2499 | return result; |
| 2500 | } |
| 2501 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2502 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment( |
| 2503 | VkDevice device, |
| 2504 | VkDeviceMemory memory, |
| 2505 | VkDeviceSize* pCommittedMemoryInBytes) |
| 2506 | { |
| 2507 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
| 2508 | |
| 2509 | return result; |
| 2510 | } |
| 2511 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2512 | bool PostBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2513 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2514 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2515 | VkDeviceMemory mem, |
| 2516 | VkDeviceSize memOffset, |
| 2517 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2518 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2519 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2520 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2521 | |
| 2522 | |
| 2523 | if(result != VK_SUCCESS) |
| 2524 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2525 | std::string reason = "vkBindBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2526 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2527 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2528 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2529 | |
| 2530 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2531 | } |
| 2532 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2533 | VK_LAYER_EXPORT VkResult VKAPI vkBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2534 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2535 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2536 | VkDeviceMemory mem, |
| 2537 | VkDeviceSize memOffset) |
| 2538 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2539 | 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] | 2540 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2541 | PostBindBufferMemory(device, buffer, mem, memOffset, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2542 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2543 | return result; |
| 2544 | } |
| 2545 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2546 | bool PostBindImageMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2547 | VkDevice device, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2548 | VkImage image, |
| 2549 | VkDeviceMemory mem, |
| 2550 | VkDeviceSize memOffset, |
| 2551 | VkResult result) |
| 2552 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2553 | |
| 2554 | |
| 2555 | |
| 2556 | |
| 2557 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2558 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2559 | std::string reason = "vkBindImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2560 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2561 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2562 | } |
| 2563 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2564 | return true; |
| 2565 | } |
| 2566 | |
| 2567 | VK_LAYER_EXPORT VkResult VKAPI vkBindImageMemory( |
| 2568 | VkDevice device, |
| 2569 | VkImage image, |
| 2570 | VkDeviceMemory mem, |
| 2571 | VkDeviceSize memOffset) |
| 2572 | { |
| 2573 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, mem, memOffset); |
| 2574 | |
| 2575 | PostBindImageMemory(device, image, mem, memOffset, result); |
| 2576 | |
| 2577 | return result; |
| 2578 | } |
| 2579 | |
| 2580 | bool PostGetBufferMemoryRequirements( |
| 2581 | VkDevice device, |
| 2582 | VkBuffer buffer, |
| 2583 | VkMemoryRequirements* pMemoryRequirements, |
| 2584 | VkResult result) |
| 2585 | { |
| 2586 | |
| 2587 | |
| 2588 | if(pMemoryRequirements == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2589 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2590 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2591 | "vkGetBufferMemoryRequirements parameter, VkMemoryRequirements* pMemoryRequirements, is null pointer"); |
| 2592 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2593 | } |
| 2594 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2595 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2596 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2597 | std::string reason = "vkGetBufferMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2598 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2599 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2600 | } |
| 2601 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2602 | return true; |
| 2603 | } |
| 2604 | |
| 2605 | VK_LAYER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements( |
| 2606 | VkDevice device, |
| 2607 | VkBuffer buffer, |
| 2608 | VkMemoryRequirements* pMemoryRequirements) |
| 2609 | { |
| 2610 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
| 2611 | |
| 2612 | PostGetBufferMemoryRequirements(device, buffer, pMemoryRequirements, result); |
| 2613 | |
| 2614 | return result; |
| 2615 | } |
| 2616 | |
| 2617 | bool PostGetImageMemoryRequirements( |
| 2618 | VkDevice device, |
| 2619 | VkImage image, |
| 2620 | VkMemoryRequirements* pMemoryRequirements, |
| 2621 | VkResult result) |
| 2622 | { |
| 2623 | |
| 2624 | |
| 2625 | if(pMemoryRequirements == nullptr) |
| 2626 | { |
| 2627 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2628 | "vkGetImageMemoryRequirements parameter, VkMemoryRequirements* pMemoryRequirements, is null pointer"); |
| 2629 | return false; |
| 2630 | } |
| 2631 | |
| 2632 | if(result != VK_SUCCESS) |
| 2633 | { |
| 2634 | std::string reason = "vkGetImageMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2635 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2636 | return false; |
| 2637 | } |
| 2638 | |
| 2639 | return true; |
| 2640 | } |
| 2641 | |
| 2642 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageMemoryRequirements( |
| 2643 | VkDevice device, |
| 2644 | VkImage image, |
| 2645 | VkMemoryRequirements* pMemoryRequirements) |
| 2646 | { |
| 2647 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
| 2648 | |
| 2649 | PostGetImageMemoryRequirements(device, image, pMemoryRequirements, result); |
| 2650 | |
| 2651 | return result; |
| 2652 | } |
| 2653 | |
| 2654 | bool PostGetImageSparseMemoryRequirements( |
| 2655 | VkDevice device, |
| 2656 | VkImage image, |
| 2657 | uint32_t* pNumRequirements, |
| 2658 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements, |
| 2659 | VkResult result) |
| 2660 | { |
| 2661 | |
| 2662 | |
| 2663 | if(pNumRequirements == nullptr) |
| 2664 | { |
| 2665 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2666 | "vkGetImageSparseMemoryRequirements parameter, uint32_t* pNumRequirements, is null pointer"); |
| 2667 | return false; |
| 2668 | } |
| 2669 | |
| 2670 | if(pSparseMemoryRequirements == nullptr) |
| 2671 | { |
| 2672 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2673 | "vkGetImageSparseMemoryRequirements parameter, VkSparseImageMemoryRequirements* pSparseMemoryRequirements, is null pointer"); |
| 2674 | return false; |
| 2675 | } |
| 2676 | if(pSparseMemoryRequirements->formatProps.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2677 | pSparseMemoryRequirements->formatProps.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2678 | { |
| 2679 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2680 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect pSparseMemoryRequirements->formatProps.aspect, is unrecognized enumerator"); |
| 2681 | return false; |
| 2682 | } |
| 2683 | if(!ValidateEnumerator((VkSparseImageFormatFlagBits)pSparseMemoryRequirements->formatProps.flags)) |
| 2684 | { |
| 2685 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkSparseImageFormatFlags pSparseMemoryRequirements->formatProps.flags, is " + EnumeratorString((VkSparseImageFormatFlagBits)pSparseMemoryRequirements->formatProps.flags); |
| 2686 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2687 | return false; |
| 2688 | } |
| 2689 | |
| 2690 | if(result != VK_SUCCESS) |
| 2691 | { |
| 2692 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2693 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2694 | return false; |
| 2695 | } |
| 2696 | |
| 2697 | return true; |
| 2698 | } |
| 2699 | |
| 2700 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements( |
| 2701 | VkDevice device, |
| 2702 | VkImage image, |
| 2703 | uint32_t* pNumRequirements, |
| 2704 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2705 | { |
| 2706 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements); |
| 2707 | |
| 2708 | PostGetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements, result); |
| 2709 | |
| 2710 | return result; |
| 2711 | } |
| 2712 | |
| 2713 | bool PostGetPhysicalDeviceSparseImageFormatProperties( |
| 2714 | VkPhysicalDevice physicalDevice, |
| 2715 | VkFormat format, |
| 2716 | VkImageType type, |
| 2717 | uint32_t samples, |
| 2718 | VkImageUsageFlags usage, |
| 2719 | VkImageTiling tiling, |
| 2720 | uint32_t* pNumProperties, |
| 2721 | VkSparseImageFormatProperties* pProperties, |
| 2722 | VkResult result) |
| 2723 | { |
| 2724 | |
| 2725 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2726 | format > VK_FORMAT_END_RANGE) |
| 2727 | { |
| 2728 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2729 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkFormat format, is unrecognized enumerator"); |
| 2730 | return false; |
| 2731 | } |
| 2732 | |
| 2733 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 2734 | type > VK_IMAGE_TYPE_END_RANGE) |
| 2735 | { |
| 2736 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2737 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageType type, is unrecognized enumerator"); |
| 2738 | return false; |
| 2739 | } |
| 2740 | |
| 2741 | |
| 2742 | if(!ValidateEnumerator((VkImageUsageFlagBits)usage)) |
| 2743 | { |
| 2744 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageUsageFlags usage, is " + EnumeratorString((VkImageUsageFlagBits)usage); |
| 2745 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2746 | return false; |
| 2747 | } |
| 2748 | |
| 2749 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 2750 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 2751 | { |
| 2752 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2753 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageTiling tiling, is unrecognized enumerator"); |
| 2754 | return false; |
| 2755 | } |
| 2756 | |
| 2757 | if(pNumProperties == nullptr) |
| 2758 | { |
| 2759 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2760 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, uint32_t* pNumProperties, is null pointer"); |
| 2761 | return false; |
| 2762 | } |
| 2763 | |
| 2764 | if(pProperties == nullptr) |
| 2765 | { |
| 2766 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2767 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkSparseImageFormatProperties* pProperties, is null pointer"); |
| 2768 | return false; |
| 2769 | } |
| 2770 | if(pProperties->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2771 | pProperties->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2772 | { |
| 2773 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2774 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspect, is unrecognized enumerator"); |
| 2775 | return false; |
| 2776 | } |
| 2777 | if(!ValidateEnumerator((VkSparseImageFormatFlagBits)pProperties->flags)) |
| 2778 | { |
| 2779 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkSparseImageFormatFlags pProperties->flags, is " + EnumeratorString((VkSparseImageFormatFlagBits)pProperties->flags); |
| 2780 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2781 | return false; |
| 2782 | } |
| 2783 | |
| 2784 | if(result != VK_SUCCESS) |
| 2785 | { |
| 2786 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2787 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2788 | return false; |
| 2789 | } |
| 2790 | |
| 2791 | return true; |
| 2792 | } |
| 2793 | |
| 2794 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2795 | VkPhysicalDevice physicalDevice, |
| 2796 | VkFormat format, |
| 2797 | VkImageType type, |
| 2798 | uint32_t samples, |
| 2799 | VkImageUsageFlags usage, |
| 2800 | VkImageTiling tiling, |
| 2801 | uint32_t* pNumProperties, |
| 2802 | VkSparseImageFormatProperties* pProperties) |
| 2803 | { |
| 2804 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties); |
| 2805 | |
| 2806 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties, result); |
| 2807 | |
| 2808 | return result; |
| 2809 | } |
| 2810 | |
| 2811 | bool PreQueueBindSparseBufferMemory( |
| 2812 | VkQueue queue, |
| 2813 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2814 | { |
| 2815 | if(pBindInfo == nullptr) |
| 2816 | { |
| 2817 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2818 | "vkQueueBindSparseBufferMemory parameter, const VkSparseMemoryBindInfo* pBindInfo, is null pointer"); |
| 2819 | return false; |
| 2820 | } |
| 2821 | |
| 2822 | return true; |
| 2823 | } |
| 2824 | |
| 2825 | bool PostQueueBindSparseBufferMemory( |
| 2826 | VkQueue queue, |
| 2827 | VkBuffer buffer, |
| 2828 | uint32_t numBindings, |
| 2829 | VkResult result) |
| 2830 | { |
| 2831 | |
| 2832 | |
| 2833 | |
| 2834 | if(result != VK_SUCCESS) |
| 2835 | { |
| 2836 | std::string reason = "vkQueueBindSparseBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2837 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2838 | return false; |
| 2839 | } |
| 2840 | |
| 2841 | return true; |
| 2842 | } |
| 2843 | |
| 2844 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory( |
| 2845 | VkQueue queue, |
| 2846 | VkBuffer buffer, |
| 2847 | uint32_t numBindings, |
| 2848 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2849 | { |
| 2850 | PreQueueBindSparseBufferMemory(queue, pBindInfo); |
| 2851 | |
| 2852 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo); |
| 2853 | |
| 2854 | PostQueueBindSparseBufferMemory(queue, buffer, numBindings, result); |
| 2855 | |
| 2856 | return result; |
| 2857 | } |
| 2858 | |
| 2859 | bool PreQueueBindSparseImageOpaqueMemory( |
| 2860 | VkQueue queue, |
| 2861 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2862 | { |
| 2863 | if(pBindInfo == nullptr) |
| 2864 | { |
| 2865 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2866 | "vkQueueBindSparseImageOpaqueMemory parameter, const VkSparseMemoryBindInfo* pBindInfo, is null pointer"); |
| 2867 | return false; |
| 2868 | } |
| 2869 | |
| 2870 | return true; |
| 2871 | } |
| 2872 | |
| 2873 | bool PostQueueBindSparseImageOpaqueMemory( |
| 2874 | VkQueue queue, |
| 2875 | VkImage image, |
| 2876 | uint32_t numBindings, |
| 2877 | VkResult result) |
| 2878 | { |
| 2879 | |
| 2880 | |
| 2881 | |
| 2882 | if(result != VK_SUCCESS) |
| 2883 | { |
| 2884 | std::string reason = "vkQueueBindSparseImageOpaqueMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2885 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2886 | return false; |
| 2887 | } |
| 2888 | |
| 2889 | return true; |
| 2890 | } |
| 2891 | |
| 2892 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory( |
| 2893 | VkQueue queue, |
| 2894 | VkImage image, |
| 2895 | uint32_t numBindings, |
| 2896 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2897 | { |
| 2898 | PreQueueBindSparseImageOpaqueMemory(queue, pBindInfo); |
| 2899 | |
| 2900 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo); |
| 2901 | |
| 2902 | PostQueueBindSparseImageOpaqueMemory(queue, image, numBindings, result); |
| 2903 | |
| 2904 | return result; |
| 2905 | } |
| 2906 | |
| 2907 | bool PreQueueBindSparseImageMemory( |
| 2908 | VkQueue queue, |
| 2909 | const VkSparseImageMemoryBindInfo* pBindInfo) |
| 2910 | { |
| 2911 | if(pBindInfo == nullptr) |
| 2912 | { |
| 2913 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2914 | "vkQueueBindSparseImageMemory parameter, const VkSparseImageMemoryBindInfo* pBindInfo, is null pointer"); |
| 2915 | return false; |
| 2916 | } |
| 2917 | if(pBindInfo->subresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2918 | pBindInfo->subresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2919 | { |
| 2920 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2921 | "vkQueueBindSparseImageMemory parameter, VkImageAspect pBindInfo->subresource.aspect, is unrecognized enumerator"); |
| 2922 | return false; |
| 2923 | } |
| 2924 | if(!ValidateEnumerator((VkSparseMemoryBindFlagBits)pBindInfo->flags)) |
| 2925 | { |
| 2926 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkSparseMemoryBindFlags pBindInfo->flags, is " + EnumeratorString((VkSparseMemoryBindFlagBits)pBindInfo->flags); |
| 2927 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2928 | return false; |
| 2929 | } |
| 2930 | |
| 2931 | return true; |
| 2932 | } |
| 2933 | |
| 2934 | bool PostQueueBindSparseImageMemory( |
| 2935 | VkQueue queue, |
| 2936 | VkImage image, |
| 2937 | uint32_t numBindings, |
| 2938 | VkResult result) |
| 2939 | { |
| 2940 | |
| 2941 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2942 | |
| 2943 | if(result != VK_SUCCESS) |
| 2944 | { |
| 2945 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2946 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2947 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2948 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2949 | |
| 2950 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2951 | } |
| 2952 | |
| 2953 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2954 | VkQueue queue, |
| 2955 | VkImage image, |
| 2956 | uint32_t numBindings, |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 2957 | const VkSparseImageMemoryBindInfo* pBindInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2958 | { |
| 2959 | PreQueueBindSparseImageMemory(queue, pBindInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2960 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 2961 | 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] | 2962 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2963 | PostQueueBindSparseImageMemory(queue, image, numBindings, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2964 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2965 | return result; |
| 2966 | } |
| 2967 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2968 | bool PreCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2969 | VkDevice device, |
| 2970 | const VkFenceCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2971 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2972 | if(pCreateInfo == nullptr) |
| 2973 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2974 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2975 | "vkCreateFence parameter, const VkFenceCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2976 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2977 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2978 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 2979 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2980 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2981 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2982 | "vkCreateFence parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2983 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2984 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2985 | if(!ValidateEnumerator((VkFenceCreateFlagBits)pCreateInfo->flags)) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2986 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2987 | 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] | 2988 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2989 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2990 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2991 | |
| 2992 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2993 | } |
| 2994 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2995 | bool PostCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2996 | VkDevice device, |
| 2997 | VkFence* pFence, |
| 2998 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2999 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3000 | |
| 3001 | if(pFence == nullptr) |
| 3002 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3003 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3004 | "vkCreateFence parameter, VkFence* pFence, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3005 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3006 | } |
| 3007 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 3008 | if(result != VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3009 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3010 | std::string reason = "vkCreateFence parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3011 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3012 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3013 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3014 | |
| 3015 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3016 | } |
| 3017 | |
| 3018 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFence( |
| 3019 | VkDevice device, |
| 3020 | const VkFenceCreateInfo* pCreateInfo, |
| 3021 | VkFence* pFence) |
| 3022 | { |
| 3023 | PreCreateFence(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3024 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3025 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pFence); |
| 3026 | |
| 3027 | PostCreateFence(device, pFence, result); |
| 3028 | |
| 3029 | return result; |
| 3030 | } |
| 3031 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3032 | bool PostDestroyFence( |
| 3033 | VkDevice device, |
| 3034 | VkFence fence, |
| 3035 | VkResult result) |
| 3036 | { |
| 3037 | |
| 3038 | |
| 3039 | if(result != VK_SUCCESS) |
| 3040 | { |
| 3041 | std::string reason = "vkDestroyFence parameter, VkResult result, is " + EnumeratorString(result); |
| 3042 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3043 | return false; |
| 3044 | } |
| 3045 | |
| 3046 | return true; |
| 3047 | } |
| 3048 | |
| 3049 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyFence( |
| 3050 | VkDevice device, |
| 3051 | VkFence fence) |
| 3052 | { |
| 3053 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyFence(device, fence); |
| 3054 | |
| 3055 | PostDestroyFence(device, fence, result); |
| 3056 | |
| 3057 | return result; |
| 3058 | } |
| 3059 | |
| 3060 | bool PreResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3061 | VkDevice device, |
| 3062 | const VkFence* pFences) |
| 3063 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3064 | if(pFences == nullptr) |
| 3065 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3066 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3067 | "vkResetFences parameter, const VkFence* pFences, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3068 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3069 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3070 | |
| 3071 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3072 | } |
| 3073 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3074 | bool PostResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3075 | VkDevice device, |
| 3076 | uint32_t fenceCount, |
| 3077 | VkResult result) |
| 3078 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3079 | |
| 3080 | |
| 3081 | if(result != VK_SUCCESS) |
| 3082 | { |
| 3083 | std::string reason = "vkResetFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3084 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3085 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3086 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3087 | |
| 3088 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3089 | } |
| 3090 | |
| 3091 | VK_LAYER_EXPORT VkResult VKAPI vkResetFences( |
| 3092 | VkDevice device, |
| 3093 | uint32_t fenceCount, |
| 3094 | const VkFence* pFences) |
| 3095 | { |
| 3096 | PreResetFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3097 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3098 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences); |
| 3099 | |
| 3100 | PostResetFences(device, fenceCount, result); |
| 3101 | |
| 3102 | return result; |
| 3103 | } |
| 3104 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3105 | bool PostGetFenceStatus( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3106 | VkDevice device, |
| 3107 | VkFence fence, |
| 3108 | VkResult result) |
| 3109 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3110 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3111 | |
| 3112 | if(result != VK_SUCCESS) |
| 3113 | { |
| 3114 | std::string reason = "vkGetFenceStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3115 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3116 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3117 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3118 | |
| 3119 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3120 | } |
| 3121 | |
| 3122 | VK_LAYER_EXPORT VkResult VKAPI vkGetFenceStatus( |
| 3123 | VkDevice device, |
| 3124 | VkFence fence) |
| 3125 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3126 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence); |
| 3127 | |
| 3128 | PostGetFenceStatus(device, fence, result); |
| 3129 | |
| 3130 | return result; |
| 3131 | } |
| 3132 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3133 | bool PreWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3134 | VkDevice device, |
| 3135 | const VkFence* pFences) |
| 3136 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3137 | if(pFences == nullptr) |
| 3138 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3139 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3140 | "vkWaitForFences parameter, const VkFence* pFences, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3141 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3142 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3143 | |
| 3144 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3145 | } |
| 3146 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3147 | bool PostWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3148 | VkDevice device, |
| 3149 | uint32_t fenceCount, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3150 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3151 | uint64_t timeout, |
| 3152 | VkResult result) |
| 3153 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3154 | |
| 3155 | |
| 3156 | |
| 3157 | |
| 3158 | if(result != VK_SUCCESS) |
| 3159 | { |
| 3160 | std::string reason = "vkWaitForFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3161 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3162 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3163 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3164 | |
| 3165 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3166 | } |
| 3167 | |
| 3168 | VK_LAYER_EXPORT VkResult VKAPI vkWaitForFences( |
| 3169 | VkDevice device, |
| 3170 | uint32_t fenceCount, |
| 3171 | const VkFence* pFences, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3172 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3173 | uint64_t timeout) |
| 3174 | { |
| 3175 | PreWaitForFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3176 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3177 | VkResult result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 3178 | |
| 3179 | PostWaitForFences(device, fenceCount, waitAll, timeout, result); |
| 3180 | |
| 3181 | return result; |
| 3182 | } |
| 3183 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3184 | bool PreCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3185 | VkDevice device, |
| 3186 | const VkSemaphoreCreateInfo* pCreateInfo) |
| 3187 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3188 | if(pCreateInfo == nullptr) |
| 3189 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3190 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3191 | "vkCreateSemaphore parameter, const VkSemaphoreCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3192 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3193 | } |
| 3194 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3195 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3196 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3197 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3198 | "vkCreateSemaphore parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3199 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3200 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3201 | |
| 3202 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3203 | } |
| 3204 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3205 | bool PostCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3206 | VkDevice device, |
| 3207 | VkSemaphore* pSemaphore, |
| 3208 | VkResult result) |
| 3209 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3210 | |
| 3211 | if(pSemaphore == nullptr) |
| 3212 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3213 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3214 | "vkCreateSemaphore parameter, VkSemaphore* pSemaphore, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3215 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3216 | } |
| 3217 | |
| 3218 | if(result != VK_SUCCESS) |
| 3219 | { |
| 3220 | std::string reason = "vkCreateSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3221 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3222 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3223 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3224 | |
| 3225 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3226 | } |
| 3227 | |
| 3228 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSemaphore( |
| 3229 | VkDevice device, |
| 3230 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 3231 | VkSemaphore* pSemaphore) |
| 3232 | { |
| 3233 | PreCreateSemaphore(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3234 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3235 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pSemaphore); |
| 3236 | |
| 3237 | PostCreateSemaphore(device, pSemaphore, result); |
| 3238 | |
| 3239 | return result; |
| 3240 | } |
| 3241 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3242 | bool PostDestroySemaphore( |
| 3243 | VkDevice device, |
| 3244 | VkSemaphore semaphore, |
| 3245 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3246 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3247 | |
| 3248 | |
| 3249 | if(result != VK_SUCCESS) |
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 | std::string reason = "vkDestroySemaphore parameter, VkResult result, is " + EnumeratorString(result); |
| 3252 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3253 | return false; |
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 | |
| 3256 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3257 | } |
| 3258 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3259 | VK_LAYER_EXPORT VkResult VKAPI vkDestroySemaphore( |
| 3260 | VkDevice device, |
| 3261 | VkSemaphore semaphore) |
| 3262 | { |
| 3263 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroySemaphore(device, semaphore); |
| 3264 | |
| 3265 | PostDestroySemaphore(device, semaphore, result); |
| 3266 | |
| 3267 | return result; |
| 3268 | } |
| 3269 | |
| 3270 | bool PostQueueSignalSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3271 | VkQueue queue, |
| 3272 | VkSemaphore semaphore, |
| 3273 | VkResult result) |
| 3274 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3275 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3276 | |
| 3277 | if(result != VK_SUCCESS) |
| 3278 | { |
| 3279 | std::string reason = "vkQueueSignalSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3280 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3281 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3282 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3283 | |
| 3284 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3285 | } |
| 3286 | |
| 3287 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSignalSemaphore( |
| 3288 | VkQueue queue, |
| 3289 | VkSemaphore semaphore) |
| 3290 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3291 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSignalSemaphore(queue, semaphore); |
| 3292 | |
| 3293 | PostQueueSignalSemaphore(queue, semaphore, result); |
| 3294 | |
| 3295 | return result; |
| 3296 | } |
| 3297 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3298 | bool PostQueueWaitSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3299 | VkQueue queue, |
| 3300 | VkSemaphore semaphore, |
| 3301 | VkResult result) |
| 3302 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3303 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3304 | |
| 3305 | if(result != VK_SUCCESS) |
| 3306 | { |
| 3307 | std::string reason = "vkQueueWaitSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3308 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3309 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3310 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3311 | |
| 3312 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3313 | } |
| 3314 | |
| 3315 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitSemaphore( |
| 3316 | VkQueue queue, |
| 3317 | VkSemaphore semaphore) |
| 3318 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3319 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitSemaphore(queue, semaphore); |
| 3320 | |
| 3321 | PostQueueWaitSemaphore(queue, semaphore, result); |
| 3322 | |
| 3323 | return result; |
| 3324 | } |
| 3325 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3326 | bool PreCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3327 | VkDevice device, |
| 3328 | const VkEventCreateInfo* pCreateInfo) |
| 3329 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3330 | if(pCreateInfo == nullptr) |
| 3331 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3332 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3333 | "vkCreateEvent parameter, const VkEventCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3334 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3335 | } |
| 3336 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3337 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3338 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3339 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3340 | "vkCreateEvent parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3341 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3342 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3343 | |
| 3344 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3345 | } |
| 3346 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3347 | bool PostCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3348 | VkDevice device, |
| 3349 | VkEvent* pEvent, |
| 3350 | VkResult result) |
| 3351 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3352 | |
| 3353 | if(pEvent == nullptr) |
| 3354 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3355 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3356 | "vkCreateEvent parameter, VkEvent* pEvent, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3357 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3358 | } |
| 3359 | |
| 3360 | if(result != VK_SUCCESS) |
| 3361 | { |
| 3362 | std::string reason = "vkCreateEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3363 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3364 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3365 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3366 | |
| 3367 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3368 | } |
| 3369 | |
| 3370 | VK_LAYER_EXPORT VkResult VKAPI vkCreateEvent( |
| 3371 | VkDevice device, |
| 3372 | const VkEventCreateInfo* pCreateInfo, |
| 3373 | VkEvent* pEvent) |
| 3374 | { |
| 3375 | PreCreateEvent(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3376 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3377 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pEvent); |
| 3378 | |
| 3379 | PostCreateEvent(device, pEvent, result); |
| 3380 | |
| 3381 | return result; |
| 3382 | } |
| 3383 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3384 | bool PostDestroyEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3385 | VkDevice device, |
| 3386 | VkEvent event, |
| 3387 | VkResult result) |
| 3388 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3389 | |
| 3390 | |
| 3391 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3392 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3393 | std::string reason = "vkDestroyEvent parameter, VkResult result, is " + EnumeratorString(result); |
| 3394 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3395 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3396 | } |
| 3397 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3398 | return true; |
| 3399 | } |
| 3400 | |
| 3401 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyEvent( |
| 3402 | VkDevice device, |
| 3403 | VkEvent event) |
| 3404 | { |
| 3405 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyEvent(device, event); |
| 3406 | |
| 3407 | PostDestroyEvent(device, event, result); |
| 3408 | |
| 3409 | return result; |
| 3410 | } |
| 3411 | |
| 3412 | bool PostGetEventStatus( |
| 3413 | VkDevice device, |
| 3414 | VkEvent event, |
| 3415 | VkResult result) |
| 3416 | { |
| 3417 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3418 | |
| 3419 | if(result != VK_SUCCESS) |
| 3420 | { |
| 3421 | std::string reason = "vkGetEventStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3422 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3423 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3424 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3425 | |
| 3426 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3427 | } |
| 3428 | |
| 3429 | VK_LAYER_EXPORT VkResult VKAPI vkGetEventStatus( |
| 3430 | VkDevice device, |
| 3431 | VkEvent event) |
| 3432 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3433 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event); |
| 3434 | |
| 3435 | PostGetEventStatus(device, event, result); |
| 3436 | |
| 3437 | return result; |
| 3438 | } |
| 3439 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3440 | bool PostSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3441 | VkDevice device, |
| 3442 | VkEvent event, |
| 3443 | VkResult result) |
| 3444 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3445 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3446 | |
| 3447 | if(result != VK_SUCCESS) |
| 3448 | { |
| 3449 | std::string reason = "vkSetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3450 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3451 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3452 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3453 | |
| 3454 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3455 | } |
| 3456 | |
| 3457 | VK_LAYER_EXPORT VkResult VKAPI vkSetEvent( |
| 3458 | VkDevice device, |
| 3459 | VkEvent event) |
| 3460 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3461 | VkResult result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event); |
| 3462 | |
| 3463 | PostSetEvent(device, event, result); |
| 3464 | |
| 3465 | return result; |
| 3466 | } |
| 3467 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3468 | bool PostResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3469 | VkDevice device, |
| 3470 | VkEvent event, |
| 3471 | VkResult result) |
| 3472 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3473 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3474 | |
| 3475 | if(result != VK_SUCCESS) |
| 3476 | { |
| 3477 | std::string reason = "vkResetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3478 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3479 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3480 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3481 | |
| 3482 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3483 | } |
| 3484 | |
| 3485 | VK_LAYER_EXPORT VkResult VKAPI vkResetEvent( |
| 3486 | VkDevice device, |
| 3487 | VkEvent event) |
| 3488 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3489 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event); |
| 3490 | |
| 3491 | PostResetEvent(device, event, result); |
| 3492 | |
| 3493 | return result; |
| 3494 | } |
| 3495 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3496 | bool PreCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3497 | VkDevice device, |
| 3498 | const VkQueryPoolCreateInfo* pCreateInfo) |
| 3499 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3500 | if(pCreateInfo == nullptr) |
| 3501 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3502 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3503 | "vkCreateQueryPool parameter, const VkQueryPoolCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3504 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3505 | } |
| 3506 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3507 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3508 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3509 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3510 | "vkCreateQueryPool parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3511 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3512 | } |
| 3513 | if(pCreateInfo->queryType < VK_QUERY_TYPE_BEGIN_RANGE || |
| 3514 | pCreateInfo->queryType > VK_QUERY_TYPE_END_RANGE) |
| 3515 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3516 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3517 | "vkCreateQueryPool parameter, VkQueryType pCreateInfo->queryType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3518 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3519 | } |
| 3520 | if(!ValidateEnumerator((VkQueryPipelineStatisticFlagBits)pCreateInfo->pipelineStatistics)) |
| 3521 | { |
| 3522 | 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] | 3523 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3524 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3525 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3526 | |
| 3527 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3528 | } |
| 3529 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3530 | bool PostCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3531 | VkDevice device, |
| 3532 | VkQueryPool* pQueryPool, |
| 3533 | VkResult result) |
| 3534 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3535 | |
| 3536 | if(pQueryPool == nullptr) |
| 3537 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3538 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3539 | "vkCreateQueryPool parameter, VkQueryPool* pQueryPool, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3540 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3541 | } |
| 3542 | |
| 3543 | if(result != VK_SUCCESS) |
| 3544 | { |
| 3545 | std::string reason = "vkCreateQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3546 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3547 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3548 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3549 | |
| 3550 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3551 | } |
| 3552 | |
| 3553 | VK_LAYER_EXPORT VkResult VKAPI vkCreateQueryPool( |
| 3554 | VkDevice device, |
| 3555 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3556 | VkQueryPool* pQueryPool) |
| 3557 | { |
| 3558 | PreCreateQueryPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3559 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3560 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 3561 | |
| 3562 | PostCreateQueryPool(device, pQueryPool, result); |
| 3563 | |
| 3564 | return result; |
| 3565 | } |
| 3566 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3567 | bool PostDestroyQueryPool( |
| 3568 | VkDevice device, |
| 3569 | VkQueryPool queryPool, |
| 3570 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3571 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3572 | |
| 3573 | |
| 3574 | if(result != VK_SUCCESS) |
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 | std::string reason = "vkDestroyQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
| 3577 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3578 | return false; |
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 | |
| 3581 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3582 | } |
| 3583 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3584 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyQueryPool( |
| 3585 | VkDevice device, |
| 3586 | VkQueryPool queryPool) |
| 3587 | { |
| 3588 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyQueryPool(device, queryPool); |
| 3589 | |
| 3590 | PostDestroyQueryPool(device, queryPool, result); |
| 3591 | |
| 3592 | return result; |
| 3593 | } |
| 3594 | |
| 3595 | bool PostGetQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3596 | VkDevice device, |
| 3597 | VkQueryPool queryPool, |
| 3598 | uint32_t startQuery, |
| 3599 | uint32_t queryCount, |
| 3600 | size_t* pDataSize, |
| 3601 | void* pData, |
| 3602 | VkQueryResultFlags flags, |
| 3603 | VkResult result) |
| 3604 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3605 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3606 | |
| 3607 | |
| 3608 | |
| 3609 | if(pDataSize == nullptr) |
| 3610 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3611 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3612 | "vkGetQueryPoolResults parameter, size_t* pDataSize, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3613 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3614 | } |
| 3615 | |
| 3616 | if(pData == nullptr) |
| 3617 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3618 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3619 | "vkGetQueryPoolResults parameter, void* pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3620 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3621 | } |
| 3622 | |
| 3623 | if(!ValidateEnumerator((VkQueryResultFlagBits)flags)) |
| 3624 | { |
| 3625 | std::string reason = "vkGetQueryPoolResults parameter, VkQueryResultFlags flags, is " + EnumeratorString((VkQueryResultFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3626 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3627 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3628 | } |
| 3629 | |
| 3630 | if(result != VK_SUCCESS) |
| 3631 | { |
| 3632 | std::string reason = "vkGetQueryPoolResults parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3633 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3634 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3635 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3636 | |
| 3637 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3638 | } |
| 3639 | |
| 3640 | VK_LAYER_EXPORT VkResult VKAPI vkGetQueryPoolResults( |
| 3641 | VkDevice device, |
| 3642 | VkQueryPool queryPool, |
| 3643 | uint32_t startQuery, |
| 3644 | uint32_t queryCount, |
| 3645 | size_t* pDataSize, |
| 3646 | void* pData, |
| 3647 | VkQueryResultFlags flags) |
| 3648 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3649 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags); |
| 3650 | |
| 3651 | PostGetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags, result); |
| 3652 | |
| 3653 | return result; |
| 3654 | } |
| 3655 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3656 | bool PreCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3657 | VkDevice device, |
| 3658 | const VkBufferCreateInfo* pCreateInfo) |
| 3659 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3660 | if(pCreateInfo == nullptr) |
| 3661 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3662 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3663 | "vkCreateBuffer parameter, const VkBufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3664 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3665 | } |
| 3666 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3667 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3668 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3669 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3670 | "vkCreateBuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3671 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3672 | } |
| 3673 | if(!ValidateEnumerator((VkBufferUsageFlagBits)pCreateInfo->usage)) |
| 3674 | { |
| 3675 | 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] | 3676 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3677 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3678 | } |
| 3679 | if(!ValidateEnumerator((VkBufferCreateFlagBits)pCreateInfo->flags)) |
| 3680 | { |
| 3681 | 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] | 3682 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3683 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3684 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3685 | |
| 3686 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3687 | } |
| 3688 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3689 | bool PostCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3690 | VkDevice device, |
| 3691 | VkBuffer* pBuffer, |
| 3692 | VkResult result) |
| 3693 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3694 | |
| 3695 | if(pBuffer == nullptr) |
| 3696 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3697 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3698 | "vkCreateBuffer parameter, VkBuffer* pBuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3699 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3700 | } |
| 3701 | |
| 3702 | if(result != VK_SUCCESS) |
| 3703 | { |
| 3704 | std::string reason = "vkCreateBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3705 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3706 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3707 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3708 | |
| 3709 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3710 | } |
| 3711 | |
| 3712 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBuffer( |
| 3713 | VkDevice device, |
| 3714 | const VkBufferCreateInfo* pCreateInfo, |
| 3715 | VkBuffer* pBuffer) |
| 3716 | { |
| 3717 | PreCreateBuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3718 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3719 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pBuffer); |
| 3720 | |
| 3721 | PostCreateBuffer(device, pBuffer, result); |
| 3722 | |
| 3723 | return result; |
| 3724 | } |
| 3725 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3726 | bool PostDestroyBuffer( |
| 3727 | VkDevice device, |
| 3728 | VkBuffer buffer, |
| 3729 | VkResult result) |
| 3730 | { |
| 3731 | |
| 3732 | |
| 3733 | if(result != VK_SUCCESS) |
| 3734 | { |
| 3735 | std::string reason = "vkDestroyBuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 3736 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3737 | return false; |
| 3738 | } |
| 3739 | |
| 3740 | return true; |
| 3741 | } |
| 3742 | |
| 3743 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyBuffer( |
| 3744 | VkDevice device, |
| 3745 | VkBuffer buffer) |
| 3746 | { |
| 3747 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyBuffer(device, buffer); |
| 3748 | |
| 3749 | PostDestroyBuffer(device, buffer, result); |
| 3750 | |
| 3751 | return result; |
| 3752 | } |
| 3753 | |
| 3754 | bool PreCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3755 | VkDevice device, |
| 3756 | const VkBufferViewCreateInfo* pCreateInfo) |
| 3757 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3758 | if(pCreateInfo == nullptr) |
| 3759 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3760 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3761 | "vkCreateBufferView parameter, const VkBufferViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3762 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3763 | } |
| 3764 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3765 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3766 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3767 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3768 | "vkCreateBufferView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3769 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3770 | } |
| 3771 | if(pCreateInfo->viewType < VK_BUFFER_VIEW_TYPE_BEGIN_RANGE || |
| 3772 | pCreateInfo->viewType > VK_BUFFER_VIEW_TYPE_END_RANGE) |
| 3773 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3774 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3775 | "vkCreateBufferView parameter, VkBufferViewType pCreateInfo->viewType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3776 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3777 | } |
| 3778 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3779 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3780 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3781 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3782 | "vkCreateBufferView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3783 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3784 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3785 | |
| 3786 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3787 | } |
| 3788 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3789 | bool PostCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3790 | VkDevice device, |
| 3791 | VkBufferView* pView, |
| 3792 | VkResult result) |
| 3793 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3794 | |
| 3795 | if(pView == nullptr) |
| 3796 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3797 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3798 | "vkCreateBufferView parameter, VkBufferView* pView, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3799 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3800 | } |
| 3801 | |
| 3802 | if(result != VK_SUCCESS) |
| 3803 | { |
| 3804 | std::string reason = "vkCreateBufferView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3805 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3806 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3807 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3808 | |
| 3809 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3810 | } |
| 3811 | |
| 3812 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBufferView( |
| 3813 | VkDevice device, |
| 3814 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3815 | VkBufferView* pView) |
| 3816 | { |
| 3817 | PreCreateBufferView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3818 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3819 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pView); |
| 3820 | |
| 3821 | PostCreateBufferView(device, pView, result); |
| 3822 | |
| 3823 | return result; |
| 3824 | } |
| 3825 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3826 | bool PostDestroyBufferView( |
| 3827 | VkDevice device, |
| 3828 | VkBufferView bufferView, |
| 3829 | VkResult result) |
| 3830 | { |
| 3831 | |
| 3832 | |
| 3833 | if(result != VK_SUCCESS) |
| 3834 | { |
| 3835 | std::string reason = "vkDestroyBufferView parameter, VkResult result, is " + EnumeratorString(result); |
| 3836 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3837 | return false; |
| 3838 | } |
| 3839 | |
| 3840 | return true; |
| 3841 | } |
| 3842 | |
| 3843 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyBufferView( |
| 3844 | VkDevice device, |
| 3845 | VkBufferView bufferView) |
| 3846 | { |
| 3847 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyBufferView(device, bufferView); |
| 3848 | |
| 3849 | PostDestroyBufferView(device, bufferView, result); |
| 3850 | |
| 3851 | return result; |
| 3852 | } |
| 3853 | |
| 3854 | bool PreCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3855 | VkDevice device, |
| 3856 | const VkImageCreateInfo* pCreateInfo) |
| 3857 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3858 | if(pCreateInfo == nullptr) |
| 3859 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3860 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3861 | "vkCreateImage parameter, const VkImageCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3862 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3863 | } |
| 3864 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 3865 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 3866 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3867 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3868 | "vkCreateImage parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3869 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3870 | } |
| 3871 | if(pCreateInfo->imageType < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 3872 | pCreateInfo->imageType > VK_IMAGE_TYPE_END_RANGE) |
| 3873 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3874 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3875 | "vkCreateImage parameter, VkImageType pCreateInfo->imageType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3876 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3877 | } |
| 3878 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3879 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3880 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3881 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3882 | "vkCreateImage parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3883 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3884 | } |
| 3885 | if(pCreateInfo->tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 3886 | pCreateInfo->tiling > VK_IMAGE_TILING_END_RANGE) |
| 3887 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3888 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3889 | "vkCreateImage parameter, VkImageTiling pCreateInfo->tiling, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3890 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3891 | } |
| 3892 | if(!ValidateEnumerator((VkImageUsageFlagBits)pCreateInfo->usage)) |
| 3893 | { |
| 3894 | 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] | 3895 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3896 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3897 | } |
| 3898 | if(!ValidateEnumerator((VkImageCreateFlagBits)pCreateInfo->flags)) |
| 3899 | { |
| 3900 | 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] | 3901 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3902 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3903 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3904 | |
| 3905 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3906 | } |
| 3907 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3908 | bool PostCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3909 | VkDevice device, |
| 3910 | VkImage* pImage, |
| 3911 | VkResult result) |
| 3912 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3913 | |
| 3914 | if(pImage == nullptr) |
| 3915 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3916 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3917 | "vkCreateImage parameter, VkImage* pImage, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3918 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3919 | } |
| 3920 | |
| 3921 | if(result != VK_SUCCESS) |
| 3922 | { |
| 3923 | std::string reason = "vkCreateImage parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3924 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3925 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3926 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3927 | |
| 3928 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3929 | } |
| 3930 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3931 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImage( |
| 3932 | VkDevice device, |
| 3933 | const VkImageCreateInfo* pCreateInfo, |
| 3934 | VkImage* pImage) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3935 | { |
| 3936 | PreCreateImage(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3937 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3938 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pImage); |
| 3939 | |
| 3940 | PostCreateImage(device, pImage, result); |
| 3941 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3942 | return result; |
| 3943 | } |
| 3944 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3945 | bool PostDestroyImage( |
| 3946 | VkDevice device, |
| 3947 | VkImage image, |
| 3948 | VkResult result) |
| 3949 | { |
| 3950 | |
| 3951 | |
| 3952 | if(result != VK_SUCCESS) |
| 3953 | { |
| 3954 | std::string reason = "vkDestroyImage parameter, VkResult result, is " + EnumeratorString(result); |
| 3955 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3956 | return false; |
| 3957 | } |
| 3958 | |
| 3959 | return true; |
| 3960 | } |
| 3961 | |
| 3962 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyImage( |
| 3963 | VkDevice device, |
| 3964 | VkImage image) |
| 3965 | { |
| 3966 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyImage(device, image); |
| 3967 | |
| 3968 | PostDestroyImage(device, image, result); |
| 3969 | |
| 3970 | return result; |
| 3971 | } |
| 3972 | |
| 3973 | bool PreGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3974 | VkDevice device, |
| 3975 | const VkImageSubresource* pSubresource) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3976 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3977 | if(pSubresource == nullptr) |
| 3978 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3979 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3980 | "vkGetImageSubresourceLayout parameter, const VkImageSubresource* pSubresource, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3981 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3982 | } |
| 3983 | if(pSubresource->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 3984 | pSubresource->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 3985 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3986 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3987 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3988 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3989 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3990 | |
| 3991 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3992 | } |
| 3993 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3994 | bool PostGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3995 | VkDevice device, |
| 3996 | VkImage image, |
| 3997 | VkSubresourceLayout* pLayout, |
| 3998 | VkResult result) |
| 3999 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4000 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4001 | |
| 4002 | if(pLayout == nullptr) |
| 4003 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4004 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4005 | "vkGetImageSubresourceLayout parameter, VkSubresourceLayout* pLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4006 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4007 | } |
| 4008 | |
| 4009 | if(result != VK_SUCCESS) |
| 4010 | { |
| 4011 | std::string reason = "vkGetImageSubresourceLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4012 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4013 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4014 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4015 | |
| 4016 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4017 | } |
| 4018 | |
| 4019 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout( |
| 4020 | VkDevice device, |
| 4021 | VkImage image, |
| 4022 | const VkImageSubresource* pSubresource, |
| 4023 | VkSubresourceLayout* pLayout) |
| 4024 | { |
| 4025 | PreGetImageSubresourceLayout(device, pSubresource); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4026 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4027 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
| 4028 | |
| 4029 | PostGetImageSubresourceLayout(device, image, pLayout, result); |
| 4030 | |
| 4031 | return result; |
| 4032 | } |
| 4033 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4034 | bool PreCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4035 | VkDevice device, |
| 4036 | const VkImageViewCreateInfo* pCreateInfo) |
| 4037 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4038 | if(pCreateInfo == nullptr) |
| 4039 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4040 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4041 | "vkCreateImageView parameter, const VkImageViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4042 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4043 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4044 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4045 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4046 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4047 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4048 | "vkCreateImageView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4049 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4050 | } |
| 4051 | if(pCreateInfo->viewType < VK_IMAGE_VIEW_TYPE_BEGIN_RANGE || |
| 4052 | pCreateInfo->viewType > VK_IMAGE_VIEW_TYPE_END_RANGE) |
| 4053 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4054 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4055 | "vkCreateImageView parameter, VkImageViewType pCreateInfo->viewType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4056 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4057 | } |
| 4058 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4059 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4060 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4061 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4062 | "vkCreateImageView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4063 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4064 | } |
| 4065 | if(pCreateInfo->channels.r < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4066 | pCreateInfo->channels.r > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4067 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4068 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4069 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.r, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4070 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4071 | } |
| 4072 | if(pCreateInfo->channels.g < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4073 | pCreateInfo->channels.g > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4074 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4075 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4076 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.g, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4077 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4078 | } |
| 4079 | if(pCreateInfo->channels.b < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4080 | pCreateInfo->channels.b > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4081 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4082 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4083 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.b, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4084 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4085 | } |
| 4086 | if(pCreateInfo->channels.a < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4087 | pCreateInfo->channels.a > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4088 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4089 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4090 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.a, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4091 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4092 | } |
| 4093 | if(pCreateInfo->subresourceRange.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 4094 | pCreateInfo->subresourceRange.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 4095 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4096 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4097 | "vkCreateImageView parameter, VkImageAspect pCreateInfo->subresourceRange.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4098 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4099 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4100 | |
| 4101 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4102 | } |
| 4103 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4104 | bool PostCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4105 | VkDevice device, |
| 4106 | VkImageView* pView, |
| 4107 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4108 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4109 | |
| 4110 | if(pView == nullptr) |
| 4111 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4112 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4113 | "vkCreateImageView parameter, VkImageView* pView, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4114 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4115 | } |
| 4116 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 4117 | if(result != VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4118 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4119 | std::string reason = "vkCreateImageView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4120 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4121 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4122 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4123 | |
| 4124 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4125 | } |
| 4126 | |
| 4127 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImageView( |
| 4128 | VkDevice device, |
| 4129 | const VkImageViewCreateInfo* pCreateInfo, |
| 4130 | VkImageView* pView) |
| 4131 | { |
| 4132 | PreCreateImageView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4133 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4134 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pView); |
| 4135 | |
| 4136 | PostCreateImageView(device, pView, result); |
| 4137 | |
| 4138 | return result; |
| 4139 | } |
| 4140 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4141 | bool PostDestroyImageView( |
| 4142 | VkDevice device, |
| 4143 | VkImageView imageView, |
| 4144 | VkResult result) |
| 4145 | { |
| 4146 | |
| 4147 | |
| 4148 | if(result != VK_SUCCESS) |
| 4149 | { |
| 4150 | std::string reason = "vkDestroyImageView parameter, VkResult result, is " + EnumeratorString(result); |
| 4151 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4152 | return false; |
| 4153 | } |
| 4154 | |
| 4155 | return true; |
| 4156 | } |
| 4157 | |
| 4158 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyImageView( |
| 4159 | VkDevice device, |
| 4160 | VkImageView imageView) |
| 4161 | { |
| 4162 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyImageView(device, imageView); |
| 4163 | |
| 4164 | PostDestroyImageView(device, imageView, result); |
| 4165 | |
| 4166 | return result; |
| 4167 | } |
| 4168 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4169 | void PreCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4170 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4171 | const VkAttachmentViewCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4172 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4173 | if(pCreateInfo == nullptr) |
| 4174 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4175 | 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] | 4176 | "vkCreateAttachmentView parameter, const VkAttachmentViewCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4177 | return; |
| 4178 | } |
| 4179 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4180 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4181 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4182 | 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] | 4183 | "vkCreateAttachmentView parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4184 | return; |
| 4185 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4186 | if(pCreateInfo->image.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4187 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4188 | 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] | 4189 | "vkCreateAttachmentView parameter, VkImage pCreateInfo->image, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4190 | return; |
| 4191 | } |
| 4192 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4193 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4194 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4195 | 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] | 4196 | "vkCreateAttachmentView parameter, VkFormat pCreateInfo->format, is unrecognized enumerator"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4197 | return; |
| 4198 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4199 | if(!ValidateEnumerator((VkAttachmentViewCreateFlagBits)pCreateInfo->flags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4200 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4201 | 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] | 4202 | 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] | 4203 | return; |
| 4204 | } |
| 4205 | } |
| 4206 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4207 | bool PostDestroyAttachmentView( |
| 4208 | VkDevice device, |
| 4209 | VkAttachmentView attachmentView, |
| 4210 | VkResult result) |
| 4211 | { |
| 4212 | |
| 4213 | |
| 4214 | if(result != VK_SUCCESS) |
| 4215 | { |
| 4216 | std::string reason = "vkDestroyAttachmentView parameter, VkResult result, is " + EnumeratorString(result); |
| 4217 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4218 | return false; |
| 4219 | } |
| 4220 | |
| 4221 | return true; |
| 4222 | } |
| 4223 | |
| 4224 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyAttachmentView( |
| 4225 | VkDevice device, |
| 4226 | VkAttachmentView attachmentView) |
| 4227 | { |
| 4228 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyAttachmentView(device, attachmentView); |
| 4229 | |
| 4230 | PostDestroyAttachmentView(device, attachmentView, result); |
| 4231 | |
| 4232 | return result; |
| 4233 | } |
| 4234 | |
| 4235 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4236 | void PostCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4237 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4238 | VkAttachmentView* pView, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4239 | VkResult result) |
| 4240 | { |
| 4241 | if(device == nullptr) |
| 4242 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4243 | 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] | 4244 | "vkCreateAttachmentView parameter, VkDevice device, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4245 | return; |
| 4246 | } |
| 4247 | |
| 4248 | if(pView == nullptr) |
| 4249 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4250 | 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] | 4251 | "vkCreateAttachmentView parameter, VkAttachmentView* pView, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4252 | return; |
| 4253 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4254 | if((*pView).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4255 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4256 | 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] | 4257 | "vkCreateAttachmentView parameter, VkAttachmentView* pView, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4258 | return; |
| 4259 | } |
| 4260 | |
| 4261 | if(result != VK_SUCCESS) |
| 4262 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4263 | std::string reason = "vkCreateAttachmentView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4264 | 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] | 4265 | return; |
| 4266 | } |
| 4267 | } |
| 4268 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4269 | VK_LAYER_EXPORT VkResult VKAPI vkCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4270 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4271 | const VkAttachmentViewCreateInfo* pCreateInfo, |
| 4272 | VkAttachmentView* pView) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4273 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4274 | PreCreateAttachmentView(device, pCreateInfo); |
| 4275 | 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] | 4276 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4277 | PostCreateAttachmentView(device, pView, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4278 | |
| 4279 | return result; |
| 4280 | } |
| 4281 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4282 | bool PostDestroyShaderModule( |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4283 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4284 | VkShaderModule shaderModule, |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4285 | VkResult result) |
| 4286 | { |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4287 | |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4288 | |
| 4289 | if(result != VK_SUCCESS) |
| 4290 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4291 | std::string reason = "vkDestroyShaderModule parameter, VkResult result, is " + EnumeratorString(result); |
| 4292 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4293 | return false; |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4294 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4295 | |
| 4296 | return true; |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4297 | } |
| 4298 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4299 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyShaderModule( |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4300 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4301 | VkShaderModule shaderModule) |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4302 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4303 | 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] | 4304 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4305 | PostDestroyShaderModule(device, shaderModule, result); |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4306 | |
| 4307 | return result; |
| 4308 | } |
| 4309 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4310 | bool PreCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4311 | VkDevice device, |
| 4312 | const VkShaderCreateInfo* pCreateInfo) |
| 4313 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4314 | if(pCreateInfo == nullptr) |
| 4315 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4316 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4317 | "vkCreateShader parameter, const VkShaderCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4318 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4319 | } |
| 4320 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4321 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4322 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4323 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4324 | "vkCreateShader parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4325 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4326 | } |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4327 | if(pCreateInfo->pName == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4328 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4329 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4330 | "vkCreateShader parameter, const char* pCreateInfo->pName, is null pointer"); |
| 4331 | return false; |
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 | |
| 4334 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4335 | } |
| 4336 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4337 | bool PostCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4338 | VkDevice device, |
| 4339 | VkShader* pShader, |
| 4340 | VkResult result) |
| 4341 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4342 | |
| 4343 | if(pShader == nullptr) |
| 4344 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4345 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4346 | "vkCreateShader parameter, VkShader* pShader, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4347 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4348 | } |
| 4349 | |
| 4350 | if(result != VK_SUCCESS) |
| 4351 | { |
| 4352 | std::string reason = "vkCreateShader parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4353 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4354 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4355 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4356 | |
| 4357 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4358 | } |
| 4359 | |
| 4360 | VK_LAYER_EXPORT VkResult VKAPI vkCreateShader( |
| 4361 | VkDevice device, |
| 4362 | const VkShaderCreateInfo* pCreateInfo, |
| 4363 | VkShader* pShader) |
| 4364 | { |
| 4365 | PreCreateShader(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4366 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4367 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateShader(device, pCreateInfo, pShader); |
| 4368 | |
| 4369 | PostCreateShader(device, pShader, result); |
| 4370 | |
| 4371 | return result; |
| 4372 | } |
| 4373 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4374 | bool PostDestroyShader( |
| 4375 | VkDevice device, |
| 4376 | VkShader shader, |
| 4377 | VkResult result) |
| 4378 | { |
| 4379 | if(result != VK_SUCCESS) |
| 4380 | { |
| 4381 | std::string reason = "vkDestroyShader parameter, VkResult result, is " + EnumeratorString(result); |
| 4382 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4383 | return false; |
| 4384 | } |
| 4385 | |
| 4386 | return true; |
| 4387 | } |
| 4388 | |
| 4389 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyShader( |
| 4390 | VkDevice device, |
| 4391 | VkShader shader) |
| 4392 | { |
| 4393 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyShader(device, shader); |
| 4394 | |
| 4395 | PostDestroyShader(device, shader, result); |
| 4396 | |
| 4397 | return result; |
| 4398 | } |
| 4399 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 4400 | //TODO handle count > 1 |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4401 | bool PreCreateGraphicsPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4402 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 4403 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4404 | const VkGraphicsPipelineCreateInfo* pCreateInfo) |
| 4405 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4406 | if(pCreateInfo == nullptr) |
| 4407 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4408 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4409 | "vkCreateGraphicsPipeline parameter, const VkGraphicsPipelineCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4410 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4411 | } |
| 4412 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4413 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4414 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4415 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4416 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4417 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4418 | } |
| 4419 | if(pCreateInfo->pStages == nullptr) |
| 4420 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4421 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4422 | "vkCreateGraphicsPipeline parameter, const VkPipelineShaderStageCreateInfo* pCreateInfo->pStages, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4423 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4424 | } |
| 4425 | if(pCreateInfo->pStages->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4426 | pCreateInfo->pStages->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4427 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4428 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4429 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pStages->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4430 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4431 | } |
| 4432 | if(pCreateInfo->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4433 | pCreateInfo->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4434 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4435 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4436 | "vkCreateGraphicsPipeline parameter, VkShaderStage pCreateInfo->pStages->stage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4437 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4438 | } |
| 4439 | if(pCreateInfo->pStages->pSpecializationInfo == nullptr) |
| 4440 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4441 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4442 | "vkCreateGraphicsPipeline parameter, const VkSpecializationInfo* pCreateInfo->pStages->pSpecializationInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4443 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4444 | } |
| 4445 | if(pCreateInfo->pStages->pSpecializationInfo->pMap == nullptr) |
| 4446 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4447 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4448 | "vkCreateGraphicsPipeline parameter, const VkSpecializationMapEntry* pCreateInfo->pStages->pSpecializationInfo->pMap, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4449 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4450 | } |
| 4451 | if(pCreateInfo->pStages->pSpecializationInfo->pData == nullptr) |
| 4452 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4453 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4454 | "vkCreateGraphicsPipeline parameter, const void* pCreateInfo->pStages->pSpecializationInfo->pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4455 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4456 | } |
| 4457 | if(pCreateInfo->pVertexInputState == nullptr) |
| 4458 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4459 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4460 | "vkCreateGraphicsPipeline parameter, const VkPipelineVertexInputStateCreateInfo* pCreateInfo->pVertexInputState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4461 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4462 | } |
| 4463 | if(pCreateInfo->pVertexInputState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4464 | pCreateInfo->pVertexInputState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4465 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4466 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4467 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pVertexInputState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4468 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4469 | } |
| 4470 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions == nullptr) |
| 4471 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4472 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4473 | "vkCreateGraphicsPipeline parameter, const VkVertexInputBindingDescription* pCreateInfo->pVertexInputState->pVertexBindingDescriptions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4474 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4475 | } |
| 4476 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4477 | pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4478 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4479 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4480 | "vkCreateGraphicsPipeline parameter, VkVertexInputStepRate pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4481 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4482 | } |
| 4483 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions == nullptr) |
| 4484 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4485 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4486 | "vkCreateGraphicsPipeline parameter, const VkVertexInputAttributeDescription* pCreateInfo->pVertexInputState->pVertexAttributeDescriptions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4487 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4488 | } |
| 4489 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4490 | pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4491 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4492 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4493 | "vkCreateGraphicsPipeline parameter, VkFormat pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4494 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4495 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4496 | if(pCreateInfo->pInputAssemblyState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4497 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4498 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4499 | "vkCreateGraphicsPipeline parameter, const VkPipelineIaStateCreateInfo* pCreateInfo->pIaState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4500 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4501 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4502 | if(pCreateInfo->pInputAssemblyState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4503 | pCreateInfo->pInputAssemblyState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4504 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4505 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4506 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pIaState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4507 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4508 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4509 | if(pCreateInfo->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4510 | pCreateInfo->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4511 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4512 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4513 | "vkCreateGraphicsPipeline parameter, VkPrimitiveTopology pCreateInfo->pIaState->topology, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4514 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4515 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4516 | if(pCreateInfo->pTessellationState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4517 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4518 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4519 | "vkCreateGraphicsPipeline parameter, const VkPipelineTessStateCreateInfo* pCreateInfo->pTessState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4520 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4521 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4522 | if(pCreateInfo->pTessellationState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4523 | pCreateInfo->pTessellationState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4524 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4525 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4526 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pTessState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4527 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4528 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4529 | if(pCreateInfo->pViewportState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4530 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4531 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4532 | "vkCreateGraphicsPipeline parameter, const VkPipelineVpStateCreateInfo* pCreateInfo->pVpState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4533 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4534 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4535 | if(pCreateInfo->pViewportState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4536 | pCreateInfo->pViewportState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4537 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4538 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4539 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pVpState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4540 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4541 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4542 | if(pCreateInfo->pRasterState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4543 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4544 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4545 | "vkCreateGraphicsPipeline parameter, const VkPipelineRsStateCreateInfo* pCreateInfo->pRsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4546 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4547 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4548 | if(pCreateInfo->pRasterState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4549 | pCreateInfo->pRasterState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4550 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4551 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4552 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pRsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4553 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4554 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4555 | if(pCreateInfo->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 4556 | pCreateInfo->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4557 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4558 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4559 | "vkCreateGraphicsPipeline parameter, VkFillMode pCreateInfo->pRsState->fillMode, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4560 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4561 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4562 | if(pCreateInfo->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 4563 | pCreateInfo->pRasterState->cullMode > VK_CULL_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4564 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4565 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4566 | "vkCreateGraphicsPipeline parameter, VkCullMode pCreateInfo->pRsState->cullMode, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4567 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4568 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4569 | if(pCreateInfo->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 4570 | pCreateInfo->pRasterState->frontFace > VK_FRONT_FACE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4571 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4572 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4573 | "vkCreateGraphicsPipeline parameter, VkFrontFace pCreateInfo->pRsState->frontFace, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4574 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4575 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4576 | if(pCreateInfo->pMultisampleState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4577 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4578 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4579 | "vkCreateGraphicsPipeline parameter, const VkPipelineMsStateCreateInfo* pCreateInfo->pMsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4580 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4581 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4582 | if(pCreateInfo->pMultisampleState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4583 | pCreateInfo->pMultisampleState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4584 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4585 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4586 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pMsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4587 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4588 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4589 | if(pCreateInfo->pDepthStencilState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4590 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4591 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4592 | "vkCreateGraphicsPipeline parameter, const VkPipelineDsStateCreateInfo* pCreateInfo->pDsState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4593 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4594 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4595 | if(pCreateInfo->pDepthStencilState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4596 | pCreateInfo->pDepthStencilState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4597 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4598 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4599 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pDsState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4600 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4601 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4602 | if(pCreateInfo->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4603 | pCreateInfo->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4604 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4605 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4606 | "vkCreateGraphicsPipeline parameter, VkCompareOp pCreateInfo->pDsState->depthCompareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4607 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4608 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4609 | if(pCreateInfo->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4610 | pCreateInfo->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4611 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4612 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4613 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4614 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4615 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4616 | if(pCreateInfo->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4617 | pCreateInfo->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4618 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4619 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4620 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilPassOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4621 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4622 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4623 | if(pCreateInfo->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4624 | pCreateInfo->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4625 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4626 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4627 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->front.stencilDepthFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4628 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4629 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4630 | if(pCreateInfo->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4631 | pCreateInfo->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4632 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4633 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4634 | "vkCreateGraphicsPipeline parameter, VkCompareOp pCreateInfo->pDsState->front.stencilCompareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4635 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4636 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4637 | if(pCreateInfo->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4638 | pCreateInfo->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4639 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4640 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4641 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->back.stencilFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4642 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4643 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4644 | if(pCreateInfo->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4645 | pCreateInfo->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4646 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4647 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4648 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->back.stencilPassOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4649 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4650 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4651 | if(pCreateInfo->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4652 | pCreateInfo->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4653 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4654 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4655 | "vkCreateGraphicsPipeline parameter, VkStencilOp pCreateInfo->pDsState->back.stencilDepthFailOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4656 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4657 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4658 | if(pCreateInfo->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4659 | pCreateInfo->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4660 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4661 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4662 | "vkCreateGraphicsPipeline parameter, VkCompareOp pCreateInfo->pDsState->back.stencilCompareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4663 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4664 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4665 | if(pCreateInfo->pColorBlendState == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4666 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4667 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4668 | "vkCreateGraphicsPipeline parameter, const VkPipelineCbStateCreateInfo* pCreateInfo->pCbState, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4669 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4670 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4671 | if(pCreateInfo->pColorBlendState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4672 | pCreateInfo->pColorBlendState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4673 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4674 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4675 | "vkCreateGraphicsPipeline parameter, VkStructureType pCreateInfo->pCbState->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4676 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4677 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4678 | if(pCreateInfo->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 4679 | pCreateInfo->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4680 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4681 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4682 | "vkCreateGraphicsPipeline parameter, VkLogicOp pCreateInfo->pCbState->logicOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4683 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4684 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4685 | if(pCreateInfo->pColorBlendState->pAttachments == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4686 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4687 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4688 | "vkCreateGraphicsPipeline parameter, const VkPipelineCbAttachmentState* pCreateInfo->pCbState->pAttachments, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4689 | return false; |
| 4690 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4691 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4692 | pCreateInfo->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4693 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4694 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4695 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4696 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4697 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4698 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4699 | pCreateInfo->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4700 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4701 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4702 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4703 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4704 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4705 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 4706 | pCreateInfo->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4707 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4708 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4709 | "vkCreateGraphicsPipeline parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4710 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4711 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4712 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4713 | pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4714 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4715 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4716 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4717 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4718 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4719 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4720 | pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4721 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4722 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4723 | "vkCreateGraphicsPipeline parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4724 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4725 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4726 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 4727 | pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4728 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4729 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4730 | "vkCreateGraphicsPipeline parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpAlpha, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4731 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4732 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4733 | if(!ValidateEnumerator((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4734 | { |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4735 | std::string reason = "vkCreateGraphicsPipeline parameter, VkChannelFlags pCreateInfo->pCbState->pAttachments->channelWriteMask, is " + EnumeratorString((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask); |
| 4736 | 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] | 4737 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4738 | } |
| 4739 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 4740 | { |
| 4741 | 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] | 4742 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4743 | return false; |
| 4744 | } |
| 4745 | |
| 4746 | return true; |
| 4747 | } |
| 4748 | |
| 4749 | bool PostCreateGraphicsPipeline( |
| 4750 | VkDevice device, |
| 4751 | VkPipeline* pPipeline, |
| 4752 | VkResult result) |
| 4753 | { |
| 4754 | |
| 4755 | if(pPipeline == nullptr) |
| 4756 | { |
| 4757 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4758 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 4759 | return false; |
| 4760 | } |
| 4761 | |
| 4762 | if(result != VK_SUCCESS) |
| 4763 | { |
| 4764 | std::string reason = "vkCreateGraphicsPipeline parameter, VkResult result, is " + EnumeratorString(result); |
| 4765 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4766 | return false; |
| 4767 | } |
| 4768 | |
| 4769 | return true; |
| 4770 | } |
| 4771 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4772 | bool PostDestroyPipeline( |
| 4773 | VkDevice device, |
| 4774 | VkPipeline pipeline, |
| 4775 | VkResult result) |
| 4776 | { |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4777 | if(result != VK_SUCCESS) |
| 4778 | { |
| 4779 | std::string reason = "vkDestroyPipeline parameter, VkResult result, is " + EnumeratorString(result); |
| 4780 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4781 | return false; |
| 4782 | } |
| 4783 | |
| 4784 | return true; |
| 4785 | } |
| 4786 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4787 | bool PreCreateGraphicsPipelineDerivative( |
| 4788 | VkDevice device, |
| 4789 | const VkGraphicsPipelineCreateInfo* pCreateInfo) |
| 4790 | { |
| 4791 | if(pCreateInfo == nullptr) |
| 4792 | { |
| 4793 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4794 | "vkCreateGraphicsPipelineDerivative parameter, const VkGraphicsPipelineCreateInfo* pCreateInfo, is null pointer"); |
| 4795 | return false; |
| 4796 | } |
| 4797 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4798 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4799 | { |
| 4800 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4801 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 4802 | return false; |
| 4803 | } |
| 4804 | if(pCreateInfo->pStages == nullptr) |
| 4805 | { |
| 4806 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4807 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineShaderStageCreateInfo* pCreateInfo->pStages, is null pointer"); |
| 4808 | return false; |
| 4809 | } |
| 4810 | if(pCreateInfo->pStages->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4811 | pCreateInfo->pStages->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4812 | { |
| 4813 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4814 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pStages->sType, is unrecognized enumerator"); |
| 4815 | return false; |
| 4816 | } |
| 4817 | if(pCreateInfo->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4818 | pCreateInfo->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4819 | { |
| 4820 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4821 | "vkCreateGraphicsPipelineDerivative parameter, VkShaderStage pCreateInfo->pStages->stage, is unrecognized enumerator"); |
| 4822 | return false; |
| 4823 | } |
| 4824 | if(pCreateInfo->pStages->pSpecializationInfo == nullptr) |
| 4825 | { |
| 4826 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4827 | "vkCreateGraphicsPipelineDerivative parameter, const VkSpecializationInfo* pCreateInfo->pStages->pSpecializationInfo, is null pointer"); |
| 4828 | return false; |
| 4829 | } |
| 4830 | if(pCreateInfo->pStages->pSpecializationInfo->pMap == nullptr) |
| 4831 | { |
| 4832 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4833 | "vkCreateGraphicsPipelineDerivative parameter, const VkSpecializationMapEntry* pCreateInfo->pStages->pSpecializationInfo->pMap, is null pointer"); |
| 4834 | return false; |
| 4835 | } |
| 4836 | if(pCreateInfo->pStages->pSpecializationInfo->pData == nullptr) |
| 4837 | { |
| 4838 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4839 | "vkCreateGraphicsPipelineDerivative parameter, const void* pCreateInfo->pStages->pSpecializationInfo->pData, is null pointer"); |
| 4840 | return false; |
| 4841 | } |
| 4842 | if(pCreateInfo->pVertexInputState == nullptr) |
| 4843 | { |
| 4844 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4845 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineVertexInputStateCreateInfo* pCreateInfo->pVertexInputState, is null pointer"); |
| 4846 | return false; |
| 4847 | } |
| 4848 | if(pCreateInfo->pVertexInputState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4849 | pCreateInfo->pVertexInputState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4850 | { |
| 4851 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4852 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pVertexInputState->sType, is unrecognized enumerator"); |
| 4853 | return false; |
| 4854 | } |
| 4855 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions == nullptr) |
| 4856 | { |
| 4857 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4858 | "vkCreateGraphicsPipelineDerivative parameter, const VkVertexInputBindingDescription* pCreateInfo->pVertexInputState->pVertexBindingDescriptions, is null pointer"); |
| 4859 | return false; |
| 4860 | } |
| 4861 | if(pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4862 | pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4863 | { |
| 4864 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4865 | "vkCreateGraphicsPipelineDerivative parameter, VkVertexInputStepRate pCreateInfo->pVertexInputState->pVertexBindingDescriptions->stepRate, is unrecognized enumerator"); |
| 4866 | return false; |
| 4867 | } |
| 4868 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions == nullptr) |
| 4869 | { |
| 4870 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4871 | "vkCreateGraphicsPipelineDerivative parameter, const VkVertexInputAttributeDescription* pCreateInfo->pVertexInputState->pVertexAttributeDescriptions, is null pointer"); |
| 4872 | return false; |
| 4873 | } |
| 4874 | if(pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4875 | pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4876 | { |
| 4877 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4878 | "vkCreateGraphicsPipelineDerivative parameter, VkFormat pCreateInfo->pVertexInputState->pVertexAttributeDescriptions->format, is unrecognized enumerator"); |
| 4879 | return false; |
| 4880 | } |
| 4881 | if(pCreateInfo->pInputAssemblyState == nullptr) |
| 4882 | { |
| 4883 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4884 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineIaStateCreateInfo* pCreateInfo->pIaState, is null pointer"); |
| 4885 | return false; |
| 4886 | } |
| 4887 | if(pCreateInfo->pInputAssemblyState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4888 | pCreateInfo->pInputAssemblyState->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->pIaState->sType, is unrecognized enumerator"); |
| 4892 | return false; |
| 4893 | } |
| 4894 | if(pCreateInfo->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4895 | pCreateInfo->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
| 4896 | { |
| 4897 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4898 | "vkCreateGraphicsPipelineDerivative parameter, VkPrimitiveTopology pCreateInfo->pIaState->topology, is unrecognized enumerator"); |
| 4899 | return false; |
| 4900 | } |
| 4901 | if(pCreateInfo->pTessellationState == nullptr) |
| 4902 | { |
| 4903 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4904 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineTessStateCreateInfo* pCreateInfo->pTessState, is null pointer"); |
| 4905 | return false; |
| 4906 | } |
| 4907 | if(pCreateInfo->pTessellationState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4908 | pCreateInfo->pTessellationState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4909 | { |
| 4910 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4911 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pTessState->sType, is unrecognized enumerator"); |
| 4912 | return false; |
| 4913 | } |
| 4914 | if(pCreateInfo->pViewportState == nullptr) |
| 4915 | { |
| 4916 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4917 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineVpStateCreateInfo* pCreateInfo->pVpState, is null pointer"); |
| 4918 | return false; |
| 4919 | } |
| 4920 | if(pCreateInfo->pViewportState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4921 | pCreateInfo->pViewportState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4922 | { |
| 4923 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4924 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pVpState->sType, is unrecognized enumerator"); |
| 4925 | return false; |
| 4926 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4927 | if(pCreateInfo->pRasterState == nullptr) |
| 4928 | { |
| 4929 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4930 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineRsStateCreateInfo* pCreateInfo->pRsState, is null pointer"); |
| 4931 | return false; |
| 4932 | } |
| 4933 | if(pCreateInfo->pRasterState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4934 | pCreateInfo->pRasterState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4935 | { |
| 4936 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4937 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pRsState->sType, is unrecognized enumerator"); |
| 4938 | return false; |
| 4939 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4940 | if(pCreateInfo->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 4941 | pCreateInfo->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
| 4942 | { |
| 4943 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4944 | "vkCreateGraphicsPipelineDerivative parameter, VkFillMode pCreateInfo->pRsState->fillMode, is unrecognized enumerator"); |
| 4945 | return false; |
| 4946 | } |
| 4947 | if(pCreateInfo->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 4948 | pCreateInfo->pRasterState->cullMode > VK_CULL_MODE_END_RANGE) |
| 4949 | { |
| 4950 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4951 | "vkCreateGraphicsPipelineDerivative parameter, VkCullMode pCreateInfo->pRsState->cullMode, is unrecognized enumerator"); |
| 4952 | return false; |
| 4953 | } |
| 4954 | if(pCreateInfo->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 4955 | pCreateInfo->pRasterState->frontFace > VK_FRONT_FACE_END_RANGE) |
| 4956 | { |
| 4957 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4958 | "vkCreateGraphicsPipelineDerivative parameter, VkFrontFace pCreateInfo->pRsState->frontFace, is unrecognized enumerator"); |
| 4959 | return false; |
| 4960 | } |
| 4961 | if(pCreateInfo->pMultisampleState == nullptr) |
| 4962 | { |
| 4963 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4964 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineMsStateCreateInfo* pCreateInfo->pMsState, is null pointer"); |
| 4965 | return false; |
| 4966 | } |
| 4967 | if(pCreateInfo->pMultisampleState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4968 | pCreateInfo->pMultisampleState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4969 | { |
| 4970 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4971 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pMsState->sType, is unrecognized enumerator"); |
| 4972 | return false; |
| 4973 | } |
| 4974 | if(pCreateInfo->pDepthStencilState == nullptr) |
| 4975 | { |
| 4976 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4977 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineDsStateCreateInfo* pCreateInfo->pDsState, is null pointer"); |
| 4978 | return false; |
| 4979 | } |
| 4980 | if(pCreateInfo->pDepthStencilState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 4981 | pCreateInfo->pDepthStencilState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 4982 | { |
| 4983 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4984 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pDsState->sType, is unrecognized enumerator"); |
| 4985 | return false; |
| 4986 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4987 | if(pCreateInfo->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4988 | pCreateInfo->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4989 | { |
| 4990 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4991 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->depthCompareOp, is unrecognized enumerator"); |
| 4992 | return false; |
| 4993 | } |
| 4994 | if(pCreateInfo->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4995 | pCreateInfo->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 4996 | { |
| 4997 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4998 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilFailOp, is unrecognized enumerator"); |
| 4999 | return false; |
| 5000 | } |
| 5001 | if(pCreateInfo->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5002 | pCreateInfo->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 5003 | { |
| 5004 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5005 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilPassOp, is unrecognized enumerator"); |
| 5006 | return false; |
| 5007 | } |
| 5008 | if(pCreateInfo->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5009 | pCreateInfo->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 5010 | { |
| 5011 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5012 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->front.stencilDepthFailOp, is unrecognized enumerator"); |
| 5013 | return false; |
| 5014 | } |
| 5015 | if(pCreateInfo->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5016 | pCreateInfo->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 5017 | { |
| 5018 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5019 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->front.stencilCompareOp, is unrecognized enumerator"); |
| 5020 | return false; |
| 5021 | } |
| 5022 | if(pCreateInfo->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5023 | pCreateInfo->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 5024 | { |
| 5025 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5026 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilFailOp, is unrecognized enumerator"); |
| 5027 | return false; |
| 5028 | } |
| 5029 | if(pCreateInfo->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5030 | pCreateInfo->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 5031 | { |
| 5032 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5033 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilPassOp, is unrecognized enumerator"); |
| 5034 | return false; |
| 5035 | } |
| 5036 | if(pCreateInfo->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 5037 | pCreateInfo->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 5038 | { |
| 5039 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5040 | "vkCreateGraphicsPipelineDerivative parameter, VkStencilOp pCreateInfo->pDsState->back.stencilDepthFailOp, is unrecognized enumerator"); |
| 5041 | return false; |
| 5042 | } |
| 5043 | if(pCreateInfo->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5044 | pCreateInfo->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 5045 | { |
| 5046 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5047 | "vkCreateGraphicsPipelineDerivative parameter, VkCompareOp pCreateInfo->pDsState->back.stencilCompareOp, is unrecognized enumerator"); |
| 5048 | return false; |
| 5049 | } |
| 5050 | if(pCreateInfo->pColorBlendState == nullptr) |
| 5051 | { |
| 5052 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5053 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineCbStateCreateInfo* pCreateInfo->pCbState, is null pointer"); |
| 5054 | return false; |
| 5055 | } |
| 5056 | if(pCreateInfo->pColorBlendState->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5057 | pCreateInfo->pColorBlendState->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5058 | { |
| 5059 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5060 | "vkCreateGraphicsPipelineDerivative parameter, VkStructureType pCreateInfo->pCbState->sType, is unrecognized enumerator"); |
| 5061 | return false; |
| 5062 | } |
| 5063 | if(pCreateInfo->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 5064 | pCreateInfo->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
| 5065 | { |
| 5066 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5067 | "vkCreateGraphicsPipelineDerivative parameter, VkLogicOp pCreateInfo->pCbState->logicOp, is unrecognized enumerator"); |
| 5068 | return false; |
| 5069 | } |
| 5070 | if(pCreateInfo->pColorBlendState->pAttachments == nullptr) |
| 5071 | { |
| 5072 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5073 | "vkCreateGraphicsPipelineDerivative parameter, const VkPipelineCbAttachmentState* pCreateInfo->pCbState->pAttachments, is null pointer"); |
| 5074 | return false; |
| 5075 | } |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 5076 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 5077 | pCreateInfo->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
| 5078 | { |
| 5079 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5080 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendColor, is unrecognized enumerator"); |
| 5081 | return false; |
| 5082 | } |
| 5083 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 5084 | pCreateInfo->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
| 5085 | { |
| 5086 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5087 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendColor, is unrecognized enumerator"); |
| 5088 | return false; |
| 5089 | } |
| 5090 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 5091 | pCreateInfo->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
| 5092 | { |
| 5093 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5094 | "vkCreateGraphicsPipelineDerivative parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpColor, is unrecognized enumerator"); |
| 5095 | return false; |
| 5096 | } |
| 5097 | if(pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 5098 | pCreateInfo->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
| 5099 | { |
| 5100 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5101 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->srcBlendAlpha, is unrecognized enumerator"); |
| 5102 | return false; |
| 5103 | } |
| 5104 | if(pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 5105 | pCreateInfo->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
| 5106 | { |
| 5107 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5108 | "vkCreateGraphicsPipelineDerivative parameter, VkBlend pCreateInfo->pCbState->pAttachments->destBlendAlpha, is unrecognized enumerator"); |
| 5109 | return false; |
| 5110 | } |
| 5111 | if(pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 5112 | pCreateInfo->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
| 5113 | { |
| 5114 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5115 | "vkCreateGraphicsPipelineDerivative parameter, VkBlendOp pCreateInfo->pCbState->pAttachments->blendOpAlpha, is unrecognized enumerator"); |
| 5116 | return false; |
| 5117 | } |
| 5118 | if(!ValidateEnumerator((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask)) |
| 5119 | { |
| 5120 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkChannelFlags pCreateInfo->pCbState->pAttachments->channelWriteMask, is " + EnumeratorString((VkChannelFlagBits)pCreateInfo->pColorBlendState->pAttachments->channelWriteMask); |
| 5121 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5122 | return false; |
| 5123 | } |
| 5124 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5125 | { |
| 5126 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkPipelineCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkPipelineCreateFlagBits)pCreateInfo->flags); |
| 5127 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5128 | return false; |
| 5129 | } |
| 5130 | |
| 5131 | return true; |
| 5132 | } |
| 5133 | |
| 5134 | bool PostCreateGraphicsPipelineDerivative( |
| 5135 | VkDevice device, |
| 5136 | VkPipeline basePipeline, |
| 5137 | VkPipeline* pPipeline, |
| 5138 | VkResult result) |
| 5139 | { |
| 5140 | |
| 5141 | |
| 5142 | if(pPipeline == nullptr) |
| 5143 | { |
| 5144 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5145 | "vkCreateGraphicsPipelineDerivative parameter, VkPipeline* pPipeline, is null pointer"); |
| 5146 | return false; |
| 5147 | } |
| 5148 | |
| 5149 | if(result != VK_SUCCESS) |
| 5150 | { |
| 5151 | std::string reason = "vkCreateGraphicsPipelineDerivative parameter, VkResult result, is " + EnumeratorString(result); |
| 5152 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5153 | return false; |
| 5154 | } |
| 5155 | |
| 5156 | return true; |
| 5157 | } |
| 5158 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 5159 | bool PreCreateComputePipeline( |
| 5160 | VkDevice device, |
| 5161 | const VkComputePipelineCreateInfo* pCreateInfo) |
| 5162 | { |
| 5163 | if(pCreateInfo == nullptr) |
| 5164 | { |
| 5165 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5166 | "vkCreateComputePipeline parameter, const VkComputePipelineCreateInfo* pCreateInfo, is null pointer"); |
| 5167 | return false; |
| 5168 | } |
| 5169 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5170 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5171 | { |
| 5172 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5173 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5174 | return false; |
| 5175 | } |
| 5176 | if(pCreateInfo->cs.sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5177 | pCreateInfo->cs.sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5178 | { |
| 5179 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5180 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->cs.sType, is unrecognized enumerator"); |
| 5181 | return false; |
| 5182 | } |
| 5183 | if(pCreateInfo->cs.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 5184 | pCreateInfo->cs.stage > VK_SHADER_STAGE_END_RANGE) |
| 5185 | { |
| 5186 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5187 | "vkCreateComputePipeline parameter, VkShaderStage pCreateInfo->cs.stage, is unrecognized enumerator"); |
| 5188 | return false; |
| 5189 | } |
| 5190 | if(pCreateInfo->cs.pSpecializationInfo == nullptr) |
| 5191 | { |
| 5192 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5193 | "vkCreateComputePipeline parameter, const VkSpecializationInfo* pCreateInfo->cs.pSpecializationInfo, is null pointer"); |
| 5194 | return false; |
| 5195 | } |
| 5196 | if(pCreateInfo->cs.pSpecializationInfo->pMap == nullptr) |
| 5197 | { |
| 5198 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5199 | "vkCreateComputePipeline parameter, const VkSpecializationMapEntry* pCreateInfo->cs.pSpecializationInfo->pMap, is null pointer"); |
| 5200 | return false; |
| 5201 | } |
| 5202 | if(pCreateInfo->cs.pSpecializationInfo->pData == nullptr) |
| 5203 | { |
| 5204 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5205 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pSpecializationInfo->pData, is null pointer"); |
| 5206 | return false; |
| 5207 | } |
| 5208 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5209 | { |
| 5210 | std::string reason = "vkCreateComputePipeline parameter, VkPipelineCreateFlags pCreateInfo->flags, is " + EnumeratorString((VkPipelineCreateFlagBits)pCreateInfo->flags); |
| 5211 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5212 | return false; |
| 5213 | } |
| 5214 | |
| 5215 | return true; |
| 5216 | } |
| 5217 | |
| 5218 | bool PostCreateComputePipeline( |
| 5219 | VkDevice device, |
| 5220 | VkPipeline* pPipeline, |
| 5221 | VkResult result) |
| 5222 | { |
| 5223 | |
| 5224 | if(pPipeline == nullptr) |
| 5225 | { |
| 5226 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5227 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5228 | return false; |
| 5229 | } |
| 5230 | |
| 5231 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5232 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5233 | 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] | 5234 | "vkCreateGraphicsPipeline parameter, VkPipelineLayout pCreateInfo->layout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5235 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5236 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5237 | |
| 5238 | return true; |
| 5239 | } |
| 5240 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5241 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipeline( |
| 5242 | VkDevice device, |
| 5243 | VkPipeline pipeline) |
| 5244 | { |
| 5245 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipeline(device, pipeline); |
| 5246 | |
| 5247 | PostDestroyPipeline(device, pipeline, result); |
| 5248 | |
| 5249 | return result; |
| 5250 | } |
| 5251 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5252 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5253 | void PostCreateGraphicsPipeline( |
| 5254 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5255 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5256 | VkPipeline* pPipeline, |
| 5257 | VkResult result) |
| 5258 | { |
| 5259 | if(device == nullptr) |
| 5260 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5261 | 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] | 5262 | "vkCreateGraphicsPipeline parameter, VkDevice device, is null pointer"); |
| 5263 | return; |
| 5264 | } |
| 5265 | |
| 5266 | if(pPipeline == nullptr) |
| 5267 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5268 | 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] | 5269 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5270 | return; |
| 5271 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5272 | if((*pPipeline).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5273 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5274 | 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] | 5275 | "vkCreateGraphicsPipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5276 | return; |
| 5277 | } |
| 5278 | |
| 5279 | if(result != VK_SUCCESS) |
| 5280 | { |
| 5281 | std::string reason = "vkCreateGraphicsPipeline parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5282 | 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] | 5283 | return; |
| 5284 | } |
| 5285 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5286 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5287 | //TODO add intercept of pipelineCache entrypoints |
| 5288 | VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5289 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5290 | VkPipelineCache pipelineCache, |
| 5291 | uint32_t count, |
| 5292 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 5293 | VkPipeline* pPipelines) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5294 | { |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5295 | PreCreateGraphicsPipeline(device, count, pCreateInfos); |
| 5296 | 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] | 5297 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5298 | PostCreateGraphicsPipeline(device, count, pPipelines, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5299 | |
| 5300 | return result; |
| 5301 | } |
| 5302 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5303 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5304 | void PreCreateComputePipeline( |
| 5305 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5306 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5307 | const VkComputePipelineCreateInfo* pCreateInfo) |
| 5308 | { |
| 5309 | if(device == nullptr) |
| 5310 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5311 | 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] | 5312 | "vkCreateComputePipeline parameter, VkDevice device, is null pointer"); |
| 5313 | return; |
| 5314 | } |
| 5315 | |
| 5316 | if(pCreateInfo == nullptr) |
| 5317 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5318 | 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] | 5319 | "vkCreateComputePipeline parameter, const VkComputePipelineCreateInfo* pCreateInfo, is null pointer"); |
| 5320 | return; |
| 5321 | } |
| 5322 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5323 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5324 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5325 | 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] | 5326 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5327 | return; |
| 5328 | } |
| 5329 | if(pCreateInfo->cs.sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5330 | pCreateInfo->cs.sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5331 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5332 | 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] | 5333 | "vkCreateComputePipeline parameter, VkStructureType pCreateInfo->cs.sType, is unrecognized enumerator"); |
| 5334 | return; |
| 5335 | } |
| 5336 | if(pCreateInfo->cs.pNext == nullptr) |
| 5337 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5338 | 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] | 5339 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pNext, is null pointer"); |
| 5340 | return; |
| 5341 | } |
| 5342 | if(pCreateInfo->cs.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 5343 | pCreateInfo->cs.stage > VK_SHADER_STAGE_END_RANGE) |
| 5344 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5345 | 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] | 5346 | "vkCreateComputePipeline parameter, VkShaderStage pCreateInfo->cs.stage, is unrecognized enumerator"); |
| 5347 | return; |
| 5348 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5349 | if(pCreateInfo->cs.shader.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5350 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5351 | 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] | 5352 | "vkCreateComputePipeline parameter, VkShader pCreateInfo->cs.shader, is null pointer"); |
| 5353 | return; |
| 5354 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5355 | if(pCreateInfo->cs.pSpecializationInfo == nullptr) |
| 5356 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5357 | 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] | 5358 | "vkCreateComputePipeline parameter, const VkSpecializationInfo* pCreateInfo->cs.pSpecializationInfo, is null pointer"); |
| 5359 | return; |
| 5360 | } |
| 5361 | if(pCreateInfo->cs.pSpecializationInfo->pMap == nullptr) |
| 5362 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5363 | 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] | 5364 | "vkCreateComputePipeline parameter, const VkSpecializationMapEntry* pCreateInfo->cs.pSpecializationInfo->pMap, is null pointer"); |
| 5365 | return; |
| 5366 | } |
| 5367 | if(pCreateInfo->cs.pSpecializationInfo->pData == nullptr) |
| 5368 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5369 | 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] | 5370 | "vkCreateComputePipeline parameter, const void* pCreateInfo->cs.pSpecializationInfo->pData, is null pointer"); |
| 5371 | return; |
| 5372 | } |
| 5373 | if(!ValidateEnumerator((VkPipelineCreateFlagBits)pCreateInfo->flags)) |
| 5374 | { |
| 5375 | 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] | 5376 | 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] | 5377 | return; |
| 5378 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5379 | if(pCreateInfo->layout.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5380 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5381 | 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] | 5382 | "vkCreateComputePipeline parameter, VkPipelineLayout pCreateInfo->layout, is null pointer"); |
| 5383 | return; |
| 5384 | } |
| 5385 | } |
| 5386 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5387 | //TODO handle count > 1 |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5388 | void PostCreateComputePipeline( |
| 5389 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5390 | uint32_t count, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5391 | VkPipeline* pPipeline, |
| 5392 | VkResult result) |
| 5393 | { |
| 5394 | if(device == nullptr) |
| 5395 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5396 | 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] | 5397 | "vkCreateComputePipeline parameter, VkDevice device, is null pointer"); |
| 5398 | return; |
| 5399 | } |
| 5400 | |
| 5401 | if(pPipeline == nullptr) |
| 5402 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5403 | 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] | 5404 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5405 | return; |
| 5406 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5407 | if((*pPipeline).handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5408 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5409 | 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] | 5410 | "vkCreateComputePipeline parameter, VkPipeline* pPipeline, is null pointer"); |
| 5411 | return; |
| 5412 | } |
| 5413 | |
| 5414 | if(result != VK_SUCCESS) |
| 5415 | { |
| 5416 | std::string reason = "vkCreateComputePipeline parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5417 | 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] | 5418 | return; |
| 5419 | } |
| 5420 | } |
| 5421 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5422 | VK_LAYER_EXPORT VkResult VKAPI vkCreateComputePipelines( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5423 | VkDevice device, |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5424 | VkPipelineCache pipelineCache, |
| 5425 | uint32_t count, |
| 5426 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 5427 | VkPipeline* pPipelines) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5428 | { |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5429 | PreCreateComputePipeline(device, count, pCreateInfos); |
| 5430 | 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] | 5431 | |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 5432 | PostCreateComputePipeline(device, count, pPipelines, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5433 | |
| 5434 | return result; |
| 5435 | } |
| 5436 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5437 | void PreCreatePipelineLayout( |
| 5438 | VkDevice device, |
| 5439 | const VkPipelineLayoutCreateInfo* pCreateInfo) |
| 5440 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5441 | if(pCreateInfo == nullptr) |
| 5442 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5443 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5444 | "vkCreatePipelineLayout parameter, const VkPipelineLayoutCreateInfo* pCreateInfo, is null pointer"); |
| 5445 | return; |
| 5446 | } |
| 5447 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5448 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5449 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5450 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5451 | "vkCreatePipelineLayout parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
| 5452 | return; |
| 5453 | } |
| 5454 | if(pCreateInfo->pSetLayouts == nullptr) |
| 5455 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5456 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5457 | "vkCreatePipelineLayout parameter, const VkDescriptorSetLayout* pCreateInfo->pSetLayouts, is null pointer"); |
| 5458 | return; |
| 5459 | } |
| 5460 | } |
| 5461 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5462 | bool PostCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5463 | VkDevice device, |
| 5464 | VkPipelineLayout* pPipelineLayout, |
| 5465 | VkResult result) |
| 5466 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5467 | |
| 5468 | if(pPipelineLayout == nullptr) |
| 5469 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5470 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5471 | "vkCreatePipelineLayout parameter, VkPipelineLayout* pPipelineLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5472 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5473 | } |
| 5474 | |
| 5475 | if(result != VK_SUCCESS) |
| 5476 | { |
| 5477 | std::string reason = "vkCreatePipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5478 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5479 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5480 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5481 | |
| 5482 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5483 | } |
| 5484 | |
| 5485 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineLayout( |
| 5486 | VkDevice device, |
| 5487 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 5488 | VkPipelineLayout* pPipelineLayout) |
| 5489 | { |
| 5490 | PreCreatePipelineLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5491 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5492 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); |
| 5493 | |
| 5494 | PostCreatePipelineLayout(device, pPipelineLayout, result); |
| 5495 | |
| 5496 | return result; |
| 5497 | } |
| 5498 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5499 | bool PostDestroyPipelineLayout( |
| 5500 | VkDevice device, |
| 5501 | VkPipelineLayout pipelineLayout, |
| 5502 | VkResult result) |
| 5503 | { |
| 5504 | |
| 5505 | |
| 5506 | if(result != VK_SUCCESS) |
| 5507 | { |
| 5508 | std::string reason = "vkDestroyPipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
| 5509 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5510 | return false; |
| 5511 | } |
| 5512 | |
| 5513 | return true; |
| 5514 | } |
| 5515 | |
| 5516 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipelineLayout( |
| 5517 | VkDevice device, |
| 5518 | VkPipelineLayout pipelineLayout) |
| 5519 | { |
| 5520 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipelineLayout(device, pipelineLayout); |
| 5521 | |
| 5522 | PostDestroyPipelineLayout(device, pipelineLayout, result); |
| 5523 | |
| 5524 | return result; |
| 5525 | } |
| 5526 | |
| 5527 | bool PreCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5528 | VkDevice device, |
| 5529 | const VkSamplerCreateInfo* pCreateInfo) |
| 5530 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5531 | if(pCreateInfo == nullptr) |
| 5532 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5533 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5534 | "vkCreateSampler parameter, const VkSamplerCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5535 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5536 | } |
| 5537 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5538 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5539 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5540 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5541 | "vkCreateSampler parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5542 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5543 | } |
| 5544 | if(pCreateInfo->magFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5545 | pCreateInfo->magFilter > VK_TEX_FILTER_END_RANGE) |
| 5546 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5547 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5548 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->magFilter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5549 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5550 | } |
| 5551 | if(pCreateInfo->minFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5552 | pCreateInfo->minFilter > VK_TEX_FILTER_END_RANGE) |
| 5553 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5554 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5555 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->minFilter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5556 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5557 | } |
| 5558 | if(pCreateInfo->mipMode < VK_TEX_MIPMAP_MODE_BEGIN_RANGE || |
| 5559 | pCreateInfo->mipMode > VK_TEX_MIPMAP_MODE_END_RANGE) |
| 5560 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5561 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5562 | "vkCreateSampler parameter, VkTexMipmapMode pCreateInfo->mipMode, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5563 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5564 | } |
| 5565 | if(pCreateInfo->addressU < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5566 | pCreateInfo->addressU > VK_TEX_ADDRESS_END_RANGE) |
| 5567 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5568 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5569 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressU, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5570 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5571 | } |
| 5572 | if(pCreateInfo->addressV < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5573 | pCreateInfo->addressV > VK_TEX_ADDRESS_END_RANGE) |
| 5574 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5575 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5576 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressV, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5577 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5578 | } |
| 5579 | if(pCreateInfo->addressW < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5580 | pCreateInfo->addressW > VK_TEX_ADDRESS_END_RANGE) |
| 5581 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5582 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5583 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressW, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5584 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5585 | } |
| 5586 | if(pCreateInfo->compareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5587 | pCreateInfo->compareOp > VK_COMPARE_OP_END_RANGE) |
| 5588 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5589 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5590 | "vkCreateSampler parameter, VkCompareOp pCreateInfo->compareOp, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5591 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5592 | } |
| 5593 | if(pCreateInfo->borderColor < VK_BORDER_COLOR_BEGIN_RANGE || |
| 5594 | pCreateInfo->borderColor > VK_BORDER_COLOR_END_RANGE) |
| 5595 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5596 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5597 | "vkCreateSampler parameter, VkBorderColor pCreateInfo->borderColor, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5598 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5599 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5600 | |
| 5601 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5602 | } |
| 5603 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5604 | bool PostCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5605 | VkDevice device, |
| 5606 | VkSampler* pSampler, |
| 5607 | VkResult result) |
| 5608 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5609 | |
| 5610 | if(pSampler == nullptr) |
| 5611 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5612 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5613 | "vkCreateSampler parameter, VkSampler* pSampler, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5614 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5615 | } |
| 5616 | |
| 5617 | if(result != VK_SUCCESS) |
| 5618 | { |
| 5619 | std::string reason = "vkCreateSampler parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5620 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5621 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5622 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5623 | |
| 5624 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5625 | } |
| 5626 | |
| 5627 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSampler( |
| 5628 | VkDevice device, |
| 5629 | const VkSamplerCreateInfo* pCreateInfo, |
| 5630 | VkSampler* pSampler) |
| 5631 | { |
| 5632 | PreCreateSampler(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5633 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5634 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pSampler); |
| 5635 | |
| 5636 | PostCreateSampler(device, pSampler, result); |
| 5637 | |
| 5638 | return result; |
| 5639 | } |
| 5640 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5641 | bool PostDestroySampler( |
| 5642 | VkDevice device, |
| 5643 | VkSampler sampler, |
| 5644 | VkResult result) |
| 5645 | { |
| 5646 | |
| 5647 | |
| 5648 | if(result != VK_SUCCESS) |
| 5649 | { |
| 5650 | std::string reason = "vkDestroySampler parameter, VkResult result, is " + EnumeratorString(result); |
| 5651 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5652 | return false; |
| 5653 | } |
| 5654 | |
| 5655 | return true; |
| 5656 | } |
| 5657 | |
| 5658 | VK_LAYER_EXPORT VkResult VKAPI vkDestroySampler( |
| 5659 | VkDevice device, |
| 5660 | VkSampler sampler) |
| 5661 | { |
| 5662 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroySampler(device, sampler); |
| 5663 | |
| 5664 | PostDestroySampler(device, sampler, result); |
| 5665 | |
| 5666 | return result; |
| 5667 | } |
| 5668 | |
| 5669 | bool PreCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5670 | VkDevice device, |
| 5671 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo) |
| 5672 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5673 | if(pCreateInfo == nullptr) |
| 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 | "vkCreateDescriptorSetLayout parameter, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, is null pointer"); |
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->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5680 | pCreateInfo->sType > VK_STRUCTURE_TYPE_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 | "vkCreateDescriptorSetLayout parameter, VkStructureType pCreateInfo->sType, 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 | } |
| 5686 | if(pCreateInfo->pBinding == nullptr) |
| 5687 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5688 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5689 | "vkCreateDescriptorSetLayout parameter, const VkDescriptorSetLayoutBinding* pCreateInfo->pBinding, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5690 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5691 | } |
| 5692 | if(pCreateInfo->pBinding->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5693 | pCreateInfo->pBinding->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5694 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5695 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5696 | "vkCreateDescriptorSetLayout parameter, VkDescriptorType pCreateInfo->pBinding->descriptorType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5697 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5698 | } |
| 5699 | if(!ValidateEnumerator((VkShaderStageFlagBits)pCreateInfo->pBinding->stageFlags)) |
| 5700 | { |
| 5701 | 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] | 5702 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5703 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5704 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5705 | |
| 5706 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5707 | } |
| 5708 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5709 | bool PostCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5710 | VkDevice device, |
| 5711 | VkDescriptorSetLayout* pSetLayout, |
| 5712 | VkResult result) |
| 5713 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5714 | |
| 5715 | if(pSetLayout == nullptr) |
| 5716 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5717 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5718 | "vkCreateDescriptorSetLayout parameter, VkDescriptorSetLayout* pSetLayout, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5719 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5720 | } |
| 5721 | |
| 5722 | if(result != VK_SUCCESS) |
| 5723 | { |
| 5724 | std::string reason = "vkCreateDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5725 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5726 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5727 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5728 | |
| 5729 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5730 | } |
| 5731 | |
| 5732 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout( |
| 5733 | VkDevice device, |
| 5734 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5735 | VkDescriptorSetLayout* pSetLayout) |
| 5736 | { |
| 5737 | PreCreateDescriptorSetLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5738 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5739 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout); |
| 5740 | |
| 5741 | PostCreateDescriptorSetLayout(device, pSetLayout, result); |
| 5742 | |
| 5743 | return result; |
| 5744 | } |
| 5745 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5746 | bool PostDestroyDescriptorSetLayout( |
| 5747 | VkDevice device, |
| 5748 | VkDescriptorSetLayout descriptorSetLayout, |
| 5749 | VkResult result) |
| 5750 | { |
| 5751 | |
| 5752 | |
| 5753 | if(result != VK_SUCCESS) |
| 5754 | { |
| 5755 | std::string reason = "vkDestroyDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
| 5756 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5757 | return false; |
| 5758 | } |
| 5759 | |
| 5760 | return true; |
| 5761 | } |
| 5762 | |
| 5763 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDescriptorSetLayout( |
| 5764 | VkDevice device, |
| 5765 | VkDescriptorSetLayout descriptorSetLayout) |
| 5766 | { |
| 5767 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorSetLayout(device, descriptorSetLayout); |
| 5768 | |
| 5769 | PostDestroyDescriptorSetLayout(device, descriptorSetLayout, result); |
| 5770 | |
| 5771 | return result; |
| 5772 | } |
| 5773 | |
| 5774 | bool PreCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5775 | VkDevice device, |
| 5776 | const VkDescriptorPoolCreateInfo* pCreateInfo) |
| 5777 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5778 | if(pCreateInfo == nullptr) |
| 5779 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5780 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5781 | "vkCreateDescriptorPool parameter, const VkDescriptorPoolCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5782 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5783 | } |
| 5784 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 5785 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 5786 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5787 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5788 | "vkCreateDescriptorPool parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5789 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5790 | } |
| 5791 | if(pCreateInfo->pTypeCount == nullptr) |
| 5792 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5793 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5794 | "vkCreateDescriptorPool parameter, const VkDescriptorTypeCount* pCreateInfo->pTypeCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5795 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5796 | } |
| 5797 | if(pCreateInfo->pTypeCount->type < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5798 | pCreateInfo->pTypeCount->type > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5799 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5800 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5801 | "vkCreateDescriptorPool parameter, VkDescriptorType pCreateInfo->pTypeCount->type, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5802 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5803 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5804 | |
| 5805 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5806 | } |
| 5807 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5808 | bool PostCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5809 | VkDevice device, |
| 5810 | VkDescriptorPoolUsage poolUsage, |
| 5811 | uint32_t maxSets, |
| 5812 | VkDescriptorPool* pDescriptorPool, |
| 5813 | VkResult result) |
| 5814 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5815 | |
| 5816 | if(poolUsage < VK_DESCRIPTOR_POOL_USAGE_BEGIN_RANGE || |
| 5817 | poolUsage > VK_DESCRIPTOR_POOL_USAGE_END_RANGE) |
| 5818 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5819 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5820 | "vkCreateDescriptorPool parameter, VkDescriptorPoolUsage poolUsage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5821 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5822 | } |
| 5823 | |
| 5824 | |
| 5825 | if(pDescriptorPool == nullptr) |
| 5826 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5827 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5828 | "vkCreateDescriptorPool parameter, VkDescriptorPool* pDescriptorPool, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5829 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5830 | } |
| 5831 | |
| 5832 | if(result != VK_SUCCESS) |
| 5833 | { |
| 5834 | std::string reason = "vkCreateDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5835 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5836 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5837 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5838 | |
| 5839 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5840 | } |
| 5841 | |
| 5842 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool( |
| 5843 | VkDevice device, |
| 5844 | VkDescriptorPoolUsage poolUsage, |
| 5845 | uint32_t maxSets, |
| 5846 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 5847 | VkDescriptorPool* pDescriptorPool) |
| 5848 | { |
| 5849 | PreCreateDescriptorPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5850 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5851 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool); |
| 5852 | |
| 5853 | PostCreateDescriptorPool(device, poolUsage, maxSets, pDescriptorPool, result); |
| 5854 | |
| 5855 | return result; |
| 5856 | } |
| 5857 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5858 | bool PostDestroyDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5859 | VkDevice device, |
| 5860 | VkDescriptorPool descriptorPool, |
| 5861 | VkResult result) |
| 5862 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5863 | |
| 5864 | |
| 5865 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5866 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5867 | std::string reason = "vkDestroyDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
| 5868 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5869 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5870 | } |
| 5871 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5872 | return true; |
| 5873 | } |
| 5874 | |
| 5875 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDescriptorPool( |
| 5876 | VkDevice device, |
| 5877 | VkDescriptorPool descriptorPool) |
| 5878 | { |
| 5879 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorPool(device, descriptorPool); |
| 5880 | |
| 5881 | PostDestroyDescriptorPool(device, descriptorPool, result); |
| 5882 | |
| 5883 | return result; |
| 5884 | } |
| 5885 | |
| 5886 | bool PostResetDescriptorPool( |
| 5887 | VkDevice device, |
| 5888 | VkDescriptorPool descriptorPool, |
| 5889 | VkResult result) |
| 5890 | { |
| 5891 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5892 | |
| 5893 | if(result != VK_SUCCESS) |
| 5894 | { |
| 5895 | std::string reason = "vkResetDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5896 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5897 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5898 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5899 | |
| 5900 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5901 | } |
| 5902 | |
| 5903 | VK_LAYER_EXPORT VkResult VKAPI vkResetDescriptorPool( |
| 5904 | VkDevice device, |
| 5905 | VkDescriptorPool descriptorPool) |
| 5906 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5907 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool); |
| 5908 | |
| 5909 | PostResetDescriptorPool(device, descriptorPool, result); |
| 5910 | |
| 5911 | return result; |
| 5912 | } |
| 5913 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5914 | bool PreAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5915 | VkDevice device, |
| 5916 | const VkDescriptorSetLayout* pSetLayouts) |
| 5917 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5918 | if(pSetLayouts == nullptr) |
| 5919 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5920 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5921 | "vkAllocDescriptorSets parameter, const VkDescriptorSetLayout* pSetLayouts, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 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 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5928 | bool PostAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5929 | VkDevice device, |
| 5930 | VkDescriptorPool descriptorPool, |
| 5931 | VkDescriptorSetUsage setUsage, |
| 5932 | uint32_t count, |
| 5933 | VkDescriptorSet* pDescriptorSets, |
| 5934 | uint32_t* pCount, |
| 5935 | VkResult result) |
| 5936 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5937 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5938 | |
| 5939 | if(setUsage < VK_DESCRIPTOR_SET_USAGE_BEGIN_RANGE || |
| 5940 | setUsage > VK_DESCRIPTOR_SET_USAGE_END_RANGE) |
| 5941 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5942 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5943 | "vkAllocDescriptorSets parameter, VkDescriptorSetUsage setUsage, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5944 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5945 | } |
| 5946 | |
| 5947 | |
| 5948 | if(pDescriptorSets == nullptr) |
| 5949 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5950 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5951 | "vkAllocDescriptorSets parameter, VkDescriptorSet* pDescriptorSets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5952 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5953 | } |
| 5954 | |
| 5955 | if(pCount == nullptr) |
| 5956 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5957 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5958 | "vkAllocDescriptorSets parameter, uint32_t* pCount, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5959 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5960 | } |
| 5961 | |
| 5962 | if(result != VK_SUCCESS) |
| 5963 | { |
| 5964 | std::string reason = "vkAllocDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5965 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5966 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5967 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5968 | |
| 5969 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5970 | } |
| 5971 | |
| 5972 | VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets( |
| 5973 | VkDevice device, |
| 5974 | VkDescriptorPool descriptorPool, |
| 5975 | VkDescriptorSetUsage setUsage, |
| 5976 | uint32_t count, |
| 5977 | const VkDescriptorSetLayout* pSetLayouts, |
| 5978 | VkDescriptorSet* pDescriptorSets, |
| 5979 | uint32_t* pCount) |
| 5980 | { |
| 5981 | PreAllocDescriptorSets(device, pSetLayouts); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5982 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5983 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets, pCount); |
| 5984 | |
| 5985 | PostAllocDescriptorSets(device, descriptorPool, setUsage, count, pDescriptorSets, pCount, result); |
| 5986 | |
| 5987 | return result; |
| 5988 | } |
| 5989 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5990 | bool PreUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5991 | VkDevice device, |
| 5992 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 5993 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 5994 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5995 | if(pDescriptorWrites == nullptr) |
| 5996 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5997 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5998 | "vkUpdateDescriptorSets parameter, const VkWriteDescriptorSet* pDescriptorWrites, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5999 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6000 | } |
| 6001 | if(pDescriptorWrites->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6002 | pDescriptorWrites->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6003 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6004 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6005 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorWrites->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6006 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6007 | } |
| 6008 | if(pDescriptorWrites->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 6009 | pDescriptorWrites->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 6010 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6011 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6012 | "vkUpdateDescriptorSets parameter, VkDescriptorType pDescriptorWrites->descriptorType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6013 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6014 | } |
| 6015 | if(pDescriptorWrites->pDescriptors == nullptr) |
| 6016 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6017 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6018 | "vkUpdateDescriptorSets parameter, const VkDescriptorInfo* pDescriptorWrites->pDescriptors, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6019 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6020 | } |
| 6021 | if(pDescriptorWrites->pDescriptors->imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6022 | pDescriptorWrites->pDescriptors->imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6023 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6024 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6025 | "vkUpdateDescriptorSets parameter, VkImageLayout pDescriptorWrites->pDescriptors->imageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6026 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6027 | } |
| 6028 | |
| 6029 | if(pDescriptorCopies == nullptr) |
| 6030 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6031 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6032 | "vkUpdateDescriptorSets parameter, const VkCopyDescriptorSet* pDescriptorCopies, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6033 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6034 | } |
| 6035 | if(pDescriptorCopies->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6036 | pDescriptorCopies->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6037 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6038 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6039 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorCopies->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6040 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6041 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6042 | |
| 6043 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6044 | } |
| 6045 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6046 | bool PostUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6047 | VkDevice device, |
| 6048 | uint32_t writeCount, |
| 6049 | uint32_t copyCount, |
| 6050 | VkResult result) |
| 6051 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6052 | |
| 6053 | |
| 6054 | |
| 6055 | if(result != VK_SUCCESS) |
| 6056 | { |
| 6057 | std::string reason = "vkUpdateDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6058 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6059 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6060 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6061 | |
| 6062 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6063 | } |
| 6064 | |
| 6065 | VK_LAYER_EXPORT VkResult VKAPI vkUpdateDescriptorSets( |
| 6066 | VkDevice device, |
| 6067 | uint32_t writeCount, |
| 6068 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 6069 | uint32_t copyCount, |
| 6070 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 6071 | { |
| 6072 | PreUpdateDescriptorSets(device, pDescriptorWrites, pDescriptorCopies); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6073 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6074 | VkResult result = get_dispatch_table(pc_device_table_map, device)->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies); |
| 6075 | |
| 6076 | PostUpdateDescriptorSets(device, writeCount, copyCount, result); |
| 6077 | |
| 6078 | return result; |
| 6079 | } |
| 6080 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6081 | bool PreCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6082 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6083 | const VkDynamicViewportStateCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6084 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6085 | if(pCreateInfo == nullptr) |
| 6086 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6087 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6088 | "vkCreateDynamicViewportState parameter, const VkDynamicViewportStateCreateInfo* pCreateInfo, is null pointer"); |
| 6089 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6090 | } |
| 6091 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6092 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6093 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6094 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6095 | "vkCreateDynamicViewportState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6096 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6097 | } |
| 6098 | if(pCreateInfo->pViewports == nullptr) |
| 6099 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6100 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6101 | "vkCreateDynamicViewportState parameter, const VkViewport* pCreateInfo->pViewports, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6102 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6103 | } |
| 6104 | if(pCreateInfo->pScissors == nullptr) |
| 6105 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6106 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6107 | "vkCreateDynamicViewportState parameter, const VkRect2D* pCreateInfo->pScissors, is null pointer"); |
| 6108 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6109 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6110 | |
| 6111 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6112 | } |
| 6113 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6114 | bool PostCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6115 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6116 | VkDynamicViewportState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6117 | VkResult result) |
| 6118 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6119 | |
| 6120 | if(pState == nullptr) |
| 6121 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6122 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6123 | "vkCreateDynamicViewportState parameter, VkDynamicViewportState* pState, is null pointer"); |
| 6124 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6125 | } |
| 6126 | |
| 6127 | if(result != VK_SUCCESS) |
| 6128 | { |
| 6129 | std::string reason = "vkCreateDynamicViewportState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6130 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6131 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6132 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6133 | |
| 6134 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6135 | } |
| 6136 | |
| 6137 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicViewportState( |
| 6138 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6139 | const VkDynamicViewportStateCreateInfo* pCreateInfo, |
| 6140 | VkDynamicViewportState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6141 | { |
| 6142 | PreCreateDynamicViewportState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6143 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6144 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicViewportState(device, pCreateInfo, pState); |
| 6145 | |
| 6146 | PostCreateDynamicViewportState(device, pState, result); |
| 6147 | |
| 6148 | return result; |
| 6149 | } |
| 6150 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6151 | bool PostDestroyDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6152 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6153 | VkDynamicViewportState dynamicViewportState, |
| 6154 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6155 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6156 | |
| 6157 | |
| 6158 | if(result != VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6159 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6160 | std::string reason = "vkDestroyDynamicViewportState parameter, VkResult result, is " + EnumeratorString(result); |
| 6161 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6162 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6163 | } |
| 6164 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6165 | return true; |
| 6166 | } |
| 6167 | |
| 6168 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicViewportState( |
| 6169 | VkDevice device, |
| 6170 | VkDynamicViewportState dynamicViewportState) |
| 6171 | { |
| 6172 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicViewportState(device, dynamicViewportState); |
| 6173 | |
| 6174 | PostDestroyDynamicViewportState(device, dynamicViewportState, result); |
| 6175 | |
| 6176 | return result; |
| 6177 | } |
| 6178 | |
| 6179 | bool PreCreateDynamicRasterState( |
| 6180 | VkDevice device, |
| 6181 | const VkDynamicRasterStateCreateInfo* pCreateInfo) |
| 6182 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6183 | if(pCreateInfo == nullptr) |
| 6184 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6185 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6186 | "vkCreateDynamicRasterState parameter, const VkDynamicRasterStateCreateInfo* pCreateInfo, is null pointer"); |
| 6187 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6188 | } |
| 6189 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6190 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 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", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6193 | "vkCreateDynamicRasterState parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 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 PostCreateDynamicRasterState( |
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 | VkDynamicRasterState* 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 | "vkCreateDynamicRasterState parameter, VkDynamicRasterState* 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 = "vkCreateDynamicRasterState 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 vkCreateDynamicRasterState( |
| 6224 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6225 | const VkDynamicRasterStateCreateInfo* pCreateInfo, |
| 6226 | VkDynamicRasterState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6227 | { |
| 6228 | PreCreateDynamicRasterState(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)->CreateDynamicRasterState(device, pCreateInfo, pState); |
| 6231 | |
| 6232 | PostCreateDynamicRasterState(device, pState, result); |
| 6233 | |
| 6234 | return result; |
| 6235 | } |
| 6236 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6237 | bool PostDestroyDynamicRasterState( |
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 | VkDynamicRasterState dynamicRasterState, |
| 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 = "vkDestroyDynamicRasterState 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 vkDestroyDynamicRasterState( |
| 6255 | VkDevice device, |
| 6256 | VkDynamicRasterState dynamicRasterState) |
| 6257 | { |
| 6258 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicRasterState(device, dynamicRasterState); |
| 6259 | |
| 6260 | PostDestroyDynamicRasterState(device, dynamicRasterState, result); |
| 6261 | |
| 6262 | return result; |
| 6263 | } |
| 6264 | |
| 6265 | bool PreCreateDynamicColorBlendState( |
| 6266 | VkDevice device, |
| 6267 | const VkDynamicColorBlendStateCreateInfo* 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 | "vkCreateDynamicColorBlendState parameter, const VkDynamicColorBlendStateCreateInfo* 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 | "vkCreateDynamicColorBlendState 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 PostCreateDynamicColorBlendState( |
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 | VkDynamicColorBlendState* 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 | "vkCreateDynamicColorBlendState parameter, VkDynamicColorBlendState* 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 = "vkCreateDynamicColorBlendState 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 vkCreateDynamicColorBlendState( |
| 6310 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6311 | const VkDynamicColorBlendStateCreateInfo* pCreateInfo, |
| 6312 | VkDynamicColorBlendState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6313 | { |
| 6314 | PreCreateDynamicColorBlendState(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)->CreateDynamicColorBlendState(device, pCreateInfo, pState); |
| 6317 | |
| 6318 | PostCreateDynamicColorBlendState(device, pState, result); |
| 6319 | |
| 6320 | return result; |
| 6321 | } |
| 6322 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6323 | bool PostDestroyDynamicColorBlendState( |
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 | VkDynamicColorBlendState dynamicColorBlendState, |
| 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 = "vkDestroyDynamicColorBlendState 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 vkDestroyDynamicColorBlendState( |
| 6341 | VkDevice device, |
| 6342 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6343 | { |
| 6344 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicColorBlendState(device, dynamicColorBlendState); |
| 6345 | |
| 6346 | PostDestroyDynamicColorBlendState(device, dynamicColorBlendState, result); |
| 6347 | |
| 6348 | return result; |
| 6349 | } |
| 6350 | |
| 6351 | bool PreCreateDynamicDepthStencilState( |
| 6352 | VkDevice device, |
| 6353 | const VkDynamicDepthStencilStateCreateInfo* 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 | "vkCreateDynamicDepthStencilState parameter, const VkDynamicDepthStencilStateCreateInfo* 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 | "vkCreateDynamicDepthStencilState 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 PostCreateDynamicDepthStencilState( |
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 | VkDynamicDepthStencilState* 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 | "vkCreateDynamicDepthStencilState parameter, VkDynamicDepthStencilState* 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 = "vkCreateDynamicDepthStencilState 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 vkCreateDynamicDepthStencilState( |
| 6396 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6397 | const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, |
| 6398 | VkDynamicDepthStencilState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6399 | { |
| 6400 | PreCreateDynamicDepthStencilState(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)->CreateDynamicDepthStencilState(device, pCreateInfo, pState); |
| 6403 | |
| 6404 | PostCreateDynamicDepthStencilState(device, pState, result); |
| 6405 | |
| 6406 | return result; |
| 6407 | } |
| 6408 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6409 | bool PostDestroyDynamicDepthStencilState( |
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 | VkDynamicDepthStencilState dynamicDepthStencilState, |
| 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 = "vkDestroyDynamicDepthStencilState 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 vkDestroyDynamicDepthStencilState( |
| 6427 | VkDevice device, |
| 6428 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6429 | { |
| 6430 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicDepthStencilState(device, dynamicDepthStencilState); |
| 6431 | |
| 6432 | PostDestroyDynamicDepthStencilState(device, dynamicDepthStencilState, result); |
| 6433 | |
| 6434 | return result; |
| 6435 | } |
| 6436 | |
| 6437 | bool PreCreateCommandBuffer( |
| 6438 | VkDevice device, |
| 6439 | const VkCmdBufferCreateInfo* 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", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6444 | "vkCreateCommandBuffer parameter, const VkCmdBufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 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 | "vkCreateCommandBuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6452 | return false; |
| 6453 | } |
| 6454 | if(pCreateInfo->level < VK_CMD_BUFFER_LEVEL_BEGIN_RANGE || |
| 6455 | pCreateInfo->level > VK_CMD_BUFFER_LEVEL_END_RANGE) |
| 6456 | { |
| 6457 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6458 | "vkCreateCommandBuffer parameter, VkCmdBufferLevel pCreateInfo->level, is unrecognized enumerator"); |
| 6459 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6460 | } |
| 6461 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6462 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6463 | } |
| 6464 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6465 | bool PostCreateCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6466 | VkDevice device, |
| 6467 | VkCmdBuffer* pCmdBuffer, |
| 6468 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6469 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6470 | |
| 6471 | if(pCmdBuffer == nullptr) |
| 6472 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6473 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6474 | "vkCreateCommandBuffer parameter, VkCmdBuffer* pCmdBuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6475 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6476 | } |
| 6477 | |
| 6478 | if(result != VK_SUCCESS) |
| 6479 | { |
| 6480 | std::string reason = "vkCreateCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6481 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6482 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6483 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6484 | |
| 6485 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6486 | } |
| 6487 | |
| 6488 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandBuffer( |
| 6489 | VkDevice device, |
| 6490 | const VkCmdBufferCreateInfo* pCreateInfo, |
| 6491 | VkCmdBuffer* pCmdBuffer) |
| 6492 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6493 | PreCreateCommandBuffer(device, pCreateInfo); |
| 6494 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6495 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 6496 | |
| 6497 | PostCreateCommandBuffer(device, pCmdBuffer, result); |
| 6498 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6499 | return result; |
| 6500 | } |
| 6501 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6502 | bool PostDestroyCommandBuffer( |
| 6503 | VkDevice device, |
| 6504 | VkCmdBuffer commandBuffer, |
| 6505 | VkResult result) |
| 6506 | { |
| 6507 | |
| 6508 | |
| 6509 | if(result != VK_SUCCESS) |
| 6510 | { |
| 6511 | std::string reason = "vkDestroyCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 6512 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6513 | return false; |
| 6514 | } |
| 6515 | |
| 6516 | return true; |
| 6517 | } |
| 6518 | |
| 6519 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyCommandBuffer( |
| 6520 | VkDevice device, |
| 6521 | VkCmdBuffer commandBuffer) |
| 6522 | { |
| 6523 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyCommandBuffer(device, commandBuffer); |
| 6524 | |
| 6525 | PostDestroyCommandBuffer(device, commandBuffer, result); |
| 6526 | |
| 6527 | return result; |
| 6528 | } |
| 6529 | |
| 6530 | bool PreBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6531 | VkCmdBuffer cmdBuffer, |
| 6532 | const VkCmdBufferBeginInfo* pBeginInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6533 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6534 | if(pBeginInfo == nullptr) |
| 6535 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6536 | 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] | 6537 | "vkBeginCommandBuffer parameter, const VkCmdBufferBeginInfo* pBeginInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6538 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6539 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6540 | if(pBeginInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 6541 | pBeginInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 6542 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6543 | 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] | 6544 | "vkBeginCommandBuffer parameter, VkStructureType pBeginInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6545 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6546 | } |
| 6547 | if(!ValidateEnumerator((VkCmdBufferOptimizeFlagBits)pBeginInfo->flags)) |
| 6548 | { |
| 6549 | 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] | 6550 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6551 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6552 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6553 | |
| 6554 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6555 | } |
| 6556 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6557 | bool PostBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6558 | VkCmdBuffer cmdBuffer, |
| 6559 | VkResult result) |
| 6560 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6561 | |
| 6562 | if(result != VK_SUCCESS) |
| 6563 | { |
| 6564 | std::string reason = "vkBeginCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6565 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6566 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6567 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6568 | |
| 6569 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6570 | } |
| 6571 | |
| 6572 | VK_LAYER_EXPORT VkResult VKAPI vkBeginCommandBuffer( |
| 6573 | VkCmdBuffer cmdBuffer, |
| 6574 | const VkCmdBufferBeginInfo* pBeginInfo) |
| 6575 | { |
| 6576 | PreBeginCommandBuffer(cmdBuffer, pBeginInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6577 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6578 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->BeginCommandBuffer(cmdBuffer, pBeginInfo); |
| 6579 | |
| 6580 | PostBeginCommandBuffer(cmdBuffer, result); |
| 6581 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6582 | return result; |
| 6583 | } |
| 6584 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6585 | bool PostEndCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6586 | VkCmdBuffer cmdBuffer, |
| 6587 | VkResult result) |
| 6588 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6589 | |
| 6590 | if(result != VK_SUCCESS) |
| 6591 | { |
| 6592 | std::string reason = "vkEndCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6593 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6594 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6595 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6596 | |
| 6597 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6598 | } |
| 6599 | |
| 6600 | VK_LAYER_EXPORT VkResult VKAPI vkEndCommandBuffer( |
| 6601 | VkCmdBuffer cmdBuffer) |
| 6602 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6603 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->EndCommandBuffer(cmdBuffer); |
| 6604 | |
| 6605 | PostEndCommandBuffer(cmdBuffer, result); |
| 6606 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6607 | return result; |
| 6608 | } |
| 6609 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6610 | bool PostResetCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6611 | VkCmdBuffer cmdBuffer, |
| 6612 | VkResult result) |
| 6613 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6614 | |
| 6615 | if(result != VK_SUCCESS) |
| 6616 | { |
| 6617 | std::string reason = "vkResetCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6618 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6619 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6620 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6621 | |
| 6622 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6623 | } |
| 6624 | |
| 6625 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandBuffer( |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 6626 | VkCmdBuffer cmdBuffer, |
| 6627 | VkCmdBufferResetFlags flags) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6628 | { |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 6629 | 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] | 6630 | |
| 6631 | PostResetCommandBuffer(cmdBuffer, result); |
| 6632 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6633 | return result; |
| 6634 | } |
| 6635 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6636 | bool PostCmdBindPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6637 | VkCmdBuffer cmdBuffer, |
| 6638 | VkPipelineBindPoint pipelineBindPoint, |
| 6639 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6640 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6641 | |
| 6642 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6643 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6644 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6645 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6646 | "vkCmdBindPipeline parameter, VkPipelineBindPoint pipelineBindPoint, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6647 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6648 | } |
| 6649 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6650 | |
| 6651 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6652 | } |
| 6653 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6654 | VK_LAYER_EXPORT void VKAPI vkCmdBindPipeline( |
| 6655 | VkCmdBuffer cmdBuffer, |
| 6656 | VkPipelineBindPoint pipelineBindPoint, |
| 6657 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6658 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6659 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 6660 | |
| 6661 | PostCmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 6662 | } |
| 6663 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6664 | bool PostCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6665 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6666 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6667 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6668 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6669 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6670 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6671 | } |
| 6672 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6673 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6674 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6675 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6676 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6677 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6678 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6679 | PostCmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6680 | } |
| 6681 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6682 | bool PostCmdBindDynamicRasterState( |
| 6683 | VkCmdBuffer cmdBuffer, |
| 6684 | VkDynamicRasterState dynamicRasterState) |
| 6685 | { |
| 6686 | |
| 6687 | |
| 6688 | return true; |
| 6689 | } |
| 6690 | |
| 6691 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicRasterState( |
| 6692 | VkCmdBuffer cmdBuffer, |
| 6693 | VkDynamicRasterState dynamicRasterState) |
| 6694 | { |
| 6695 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicRasterState(cmdBuffer, dynamicRasterState); |
| 6696 | |
| 6697 | PostCmdBindDynamicRasterState(cmdBuffer, dynamicRasterState); |
| 6698 | } |
| 6699 | |
| 6700 | bool PostCmdBindDynamicColorBlendState( |
| 6701 | VkCmdBuffer cmdBuffer, |
| 6702 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6703 | { |
| 6704 | |
| 6705 | |
| 6706 | return true; |
| 6707 | } |
| 6708 | |
| 6709 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicColorBlendState( |
| 6710 | VkCmdBuffer cmdBuffer, |
| 6711 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6712 | { |
| 6713 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState); |
| 6714 | |
| 6715 | PostCmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState); |
| 6716 | } |
| 6717 | |
| 6718 | bool PostCmdBindDynamicDepthStencilState( |
| 6719 | VkCmdBuffer cmdBuffer, |
| 6720 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6721 | { |
| 6722 | |
| 6723 | |
| 6724 | return true; |
| 6725 | } |
| 6726 | |
| 6727 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicDepthStencilState( |
| 6728 | VkCmdBuffer cmdBuffer, |
| 6729 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6730 | { |
| 6731 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState); |
| 6732 | |
| 6733 | PostCmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState); |
| 6734 | } |
| 6735 | |
| 6736 | bool PreCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6737 | VkCmdBuffer cmdBuffer, |
| 6738 | const VkDescriptorSet* pDescriptorSets, |
| 6739 | const uint32_t* pDynamicOffsets) |
| 6740 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6741 | if(pDescriptorSets == nullptr) |
| 6742 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6743 | 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] | 6744 | "vkCmdBindDescriptorSets parameter, const VkDescriptorSet* pDescriptorSets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6745 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6746 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6747 | |
| 6748 | |
| 6749 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6750 | } |
| 6751 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6752 | bool PostCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6753 | VkCmdBuffer cmdBuffer, |
| 6754 | VkPipelineBindPoint pipelineBindPoint, |
| 6755 | VkPipelineLayout layout, |
| 6756 | uint32_t firstSet, |
| 6757 | uint32_t setCount, |
| 6758 | uint32_t dynamicOffsetCount) |
| 6759 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6760 | |
| 6761 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6762 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6763 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6764 | 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] | 6765 | "vkCmdBindDescriptorSets parameter, VkPipelineBindPoint pipelineBindPoint, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6766 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6767 | } |
| 6768 | |
| 6769 | |
| 6770 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6771 | |
| 6772 | |
| 6773 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6774 | } |
| 6775 | |
| 6776 | VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets( |
| 6777 | VkCmdBuffer cmdBuffer, |
| 6778 | VkPipelineBindPoint pipelineBindPoint, |
| 6779 | VkPipelineLayout layout, |
| 6780 | uint32_t firstSet, |
| 6781 | uint32_t setCount, |
| 6782 | const VkDescriptorSet* pDescriptorSets, |
| 6783 | uint32_t dynamicOffsetCount, |
| 6784 | const uint32_t* pDynamicOffsets) |
| 6785 | { |
| 6786 | PreCmdBindDescriptorSets(cmdBuffer, pDescriptorSets, pDynamicOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6787 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6788 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 6789 | |
| 6790 | PostCmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, dynamicOffsetCount); |
| 6791 | } |
| 6792 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6793 | bool PostCmdBindIndexBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6794 | VkCmdBuffer cmdBuffer, |
| 6795 | VkBuffer buffer, |
| 6796 | VkDeviceSize offset, |
| 6797 | VkIndexType indexType) |
| 6798 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6799 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6800 | |
| 6801 | |
| 6802 | if(indexType < VK_INDEX_TYPE_BEGIN_RANGE || |
| 6803 | indexType > VK_INDEX_TYPE_END_RANGE) |
| 6804 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6805 | 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] | 6806 | "vkCmdBindIndexBuffer parameter, VkIndexType indexType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6807 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6808 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6809 | |
| 6810 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6811 | } |
| 6812 | |
| 6813 | VK_LAYER_EXPORT void VKAPI vkCmdBindIndexBuffer( |
| 6814 | VkCmdBuffer cmdBuffer, |
| 6815 | VkBuffer buffer, |
| 6816 | VkDeviceSize offset, |
| 6817 | VkIndexType indexType) |
| 6818 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6819 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6820 | |
| 6821 | PostCmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6822 | } |
| 6823 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6824 | bool PreCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6825 | VkCmdBuffer cmdBuffer, |
| 6826 | const VkBuffer* pBuffers, |
| 6827 | const VkDeviceSize* pOffsets) |
| 6828 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6829 | if(pBuffers == nullptr) |
| 6830 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6831 | 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] | 6832 | "vkCmdBindVertexBuffers parameter, const VkBuffer* pBuffers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6833 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6834 | } |
| 6835 | |
| 6836 | if(pOffsets == nullptr) |
| 6837 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6838 | 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] | 6839 | "vkCmdBindVertexBuffers parameter, const VkDeviceSize* pOffsets, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6840 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6841 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6842 | |
| 6843 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6844 | } |
| 6845 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6846 | bool PostCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6847 | VkCmdBuffer cmdBuffer, |
| 6848 | uint32_t startBinding, |
| 6849 | uint32_t bindingCount) |
| 6850 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6851 | |
| 6852 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6853 | |
| 6854 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6855 | } |
| 6856 | |
Courtney Goeltzenleuchter | f68ad72 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 6857 | VK_LAYER_EXPORT void VKAPI vkCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6858 | VkCmdBuffer cmdBuffer, |
| 6859 | uint32_t startBinding, |
| 6860 | uint32_t bindingCount, |
| 6861 | const VkBuffer* pBuffers, |
| 6862 | const VkDeviceSize* pOffsets) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6863 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6864 | PreCmdBindVertexBuffers(cmdBuffer, pBuffers, pOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6865 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6866 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets); |
| 6867 | |
| 6868 | PostCmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6869 | } |
| 6870 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6871 | bool PostCmdDraw( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6872 | VkCmdBuffer cmdBuffer, |
| 6873 | uint32_t firstVertex, |
| 6874 | uint32_t vertexCount, |
| 6875 | uint32_t firstInstance, |
| 6876 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6877 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6878 | |
| 6879 | |
| 6880 | |
| 6881 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6882 | |
| 6883 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6884 | } |
| 6885 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6886 | VK_LAYER_EXPORT void VKAPI vkCmdDraw( |
| 6887 | VkCmdBuffer cmdBuffer, |
| 6888 | uint32_t firstVertex, |
| 6889 | uint32_t vertexCount, |
| 6890 | uint32_t firstInstance, |
| 6891 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6892 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6893 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 6894 | |
| 6895 | PostCmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6896 | } |
| 6897 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6898 | bool PostCmdDrawIndexed( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6899 | VkCmdBuffer cmdBuffer, |
| 6900 | uint32_t firstIndex, |
| 6901 | uint32_t indexCount, |
| 6902 | int32_t vertexOffset, |
| 6903 | uint32_t firstInstance, |
| 6904 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6905 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6906 | |
| 6907 | |
| 6908 | |
| 6909 | |
| 6910 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6911 | |
| 6912 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6913 | } |
| 6914 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6915 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed( |
| 6916 | VkCmdBuffer cmdBuffer, |
| 6917 | uint32_t firstIndex, |
| 6918 | uint32_t indexCount, |
| 6919 | int32_t vertexOffset, |
| 6920 | uint32_t firstInstance, |
| 6921 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6922 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6923 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 6924 | |
| 6925 | PostCmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 6926 | } |
| 6927 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6928 | bool PostCmdDrawIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6929 | VkCmdBuffer cmdBuffer, |
| 6930 | VkBuffer buffer, |
| 6931 | VkDeviceSize offset, |
| 6932 | uint32_t count, |
| 6933 | uint32_t stride) |
| 6934 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6935 | |
| 6936 | |
| 6937 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6938 | |
| 6939 | |
| 6940 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6941 | } |
| 6942 | |
| 6943 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndirect( |
| 6944 | VkCmdBuffer cmdBuffer, |
| 6945 | VkBuffer buffer, |
| 6946 | VkDeviceSize offset, |
| 6947 | uint32_t count, |
| 6948 | uint32_t stride) |
| 6949 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6950 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6951 | |
| 6952 | PostCmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6953 | } |
| 6954 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6955 | bool PostCmdDrawIndexedIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6956 | VkCmdBuffer cmdBuffer, |
| 6957 | VkBuffer buffer, |
| 6958 | VkDeviceSize offset, |
| 6959 | uint32_t count, |
| 6960 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6961 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6962 | |
| 6963 | |
| 6964 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6965 | |
| 6966 | |
| 6967 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6968 | } |
| 6969 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6970 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexedIndirect( |
| 6971 | VkCmdBuffer cmdBuffer, |
| 6972 | VkBuffer buffer, |
| 6973 | VkDeviceSize offset, |
| 6974 | uint32_t count, |
| 6975 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6976 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6977 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6978 | |
| 6979 | PostCmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 6980 | } |
| 6981 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6982 | bool PostCmdDispatch( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6983 | VkCmdBuffer cmdBuffer, |
| 6984 | uint32_t x, |
| 6985 | uint32_t y, |
| 6986 | uint32_t z) |
| 6987 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6988 | |
| 6989 | |
| 6990 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6991 | |
| 6992 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6993 | } |
| 6994 | |
| 6995 | VK_LAYER_EXPORT void VKAPI vkCmdDispatch( |
| 6996 | VkCmdBuffer cmdBuffer, |
| 6997 | uint32_t x, |
| 6998 | uint32_t y, |
| 6999 | uint32_t z) |
| 7000 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7001 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatch(cmdBuffer, x, y, z); |
| 7002 | |
| 7003 | PostCmdDispatch(cmdBuffer, x, y, z); |
| 7004 | } |
| 7005 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7006 | bool PostCmdDispatchIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7007 | VkCmdBuffer cmdBuffer, |
| 7008 | VkBuffer buffer, |
| 7009 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7010 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7011 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7012 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7013 | |
| 7014 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7015 | } |
| 7016 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7017 | VK_LAYER_EXPORT void VKAPI vkCmdDispatchIndirect( |
| 7018 | VkCmdBuffer cmdBuffer, |
| 7019 | VkBuffer buffer, |
| 7020 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7021 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7022 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatchIndirect(cmdBuffer, buffer, offset); |
| 7023 | |
| 7024 | PostCmdDispatchIndirect(cmdBuffer, buffer, offset); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7025 | } |
| 7026 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7027 | bool PreCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7028 | VkCmdBuffer cmdBuffer, |
| 7029 | const VkBufferCopy* pRegions) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7030 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7031 | if(pRegions == nullptr) |
| 7032 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7033 | 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] | 7034 | "vkCmdCopyBuffer parameter, const VkBufferCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7035 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7036 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7037 | |
| 7038 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7039 | } |
| 7040 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7041 | bool PostCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7042 | VkCmdBuffer cmdBuffer, |
| 7043 | VkBuffer srcBuffer, |
| 7044 | VkBuffer destBuffer, |
| 7045 | uint32_t regionCount) |
| 7046 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7047 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7048 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7049 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7050 | |
| 7051 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7052 | } |
| 7053 | |
| 7054 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBuffer( |
| 7055 | VkCmdBuffer cmdBuffer, |
| 7056 | VkBuffer srcBuffer, |
| 7057 | VkBuffer destBuffer, |
| 7058 | uint32_t regionCount, |
| 7059 | const VkBufferCopy* pRegions) |
| 7060 | { |
| 7061 | PreCmdCopyBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -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)->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); |
| 7064 | |
| 7065 | PostCmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount); |
| 7066 | } |
| 7067 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7068 | bool PreCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7069 | VkCmdBuffer cmdBuffer, |
| 7070 | const VkImageCopy* pRegions) |
| 7071 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7072 | if(pRegions == nullptr) |
| 7073 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7074 | 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] | 7075 | "vkCmdCopyImage parameter, const VkImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7076 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7077 | } |
| 7078 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7079 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7080 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7081 | 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] | 7082 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7083 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7084 | } |
| 7085 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7086 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7087 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7088 | 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] | 7089 | "vkCmdCopyImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7090 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7091 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7092 | |
| 7093 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7094 | } |
| 7095 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7096 | bool PostCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7097 | VkCmdBuffer cmdBuffer, |
| 7098 | VkImage srcImage, |
| 7099 | VkImageLayout srcImageLayout, |
| 7100 | VkImage destImage, |
| 7101 | VkImageLayout destImageLayout, |
| 7102 | uint32_t regionCount) |
| 7103 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7104 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7105 | |
| 7106 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7107 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7108 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7109 | 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] | 7110 | "vkCmdCopyImage parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7111 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7112 | } |
| 7113 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7114 | |
| 7115 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7116 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7117 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7118 | 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] | 7119 | "vkCmdCopyImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7120 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7121 | } |
| 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 | |
| 7127 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImage( |
| 7128 | VkCmdBuffer cmdBuffer, |
| 7129 | VkImage srcImage, |
| 7130 | VkImageLayout srcImageLayout, |
| 7131 | VkImage destImage, |
| 7132 | VkImageLayout destImageLayout, |
| 7133 | uint32_t regionCount, |
| 7134 | const VkImageCopy* pRegions) |
| 7135 | { |
| 7136 | PreCmdCopyImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7137 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7138 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 7139 | |
| 7140 | PostCmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 7141 | } |
| 7142 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7143 | bool PreCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7144 | VkCmdBuffer cmdBuffer, |
| 7145 | const VkImageBlit* pRegions) |
| 7146 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7147 | if(pRegions == nullptr) |
| 7148 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7149 | 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] | 7150 | "vkCmdBlitImage parameter, const VkImageBlit* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7151 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7152 | } |
| 7153 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7154 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7155 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7156 | 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] | 7157 | "vkCmdBlitImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7158 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7159 | } |
| 7160 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7161 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7162 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7163 | 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] | 7164 | "vkCmdBlitImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7165 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7166 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7167 | |
| 7168 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7169 | } |
| 7170 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7171 | bool PostCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7172 | VkCmdBuffer cmdBuffer, |
| 7173 | VkImage srcImage, |
| 7174 | VkImageLayout srcImageLayout, |
| 7175 | VkImage destImage, |
| 7176 | VkImageLayout destImageLayout, |
| 7177 | uint32_t regionCount, |
| 7178 | VkTexFilter filter) |
| 7179 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7180 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7181 | |
| 7182 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7183 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7184 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7185 | 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] | 7186 | "vkCmdBlitImage parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7187 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7188 | } |
| 7189 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7190 | |
| 7191 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7192 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7193 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7194 | 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] | 7195 | "vkCmdBlitImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7196 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7197 | } |
| 7198 | |
| 7199 | |
| 7200 | if(filter < VK_TEX_FILTER_BEGIN_RANGE || |
| 7201 | filter > VK_TEX_FILTER_END_RANGE) |
| 7202 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7203 | 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] | 7204 | "vkCmdBlitImage parameter, VkTexFilter filter, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7205 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7206 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7207 | |
| 7208 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7209 | } |
| 7210 | |
| 7211 | VK_LAYER_EXPORT void VKAPI vkCmdBlitImage( |
| 7212 | VkCmdBuffer cmdBuffer, |
| 7213 | VkImage srcImage, |
| 7214 | VkImageLayout srcImageLayout, |
| 7215 | VkImage destImage, |
| 7216 | VkImageLayout destImageLayout, |
| 7217 | uint32_t regionCount, |
| 7218 | const VkImageBlit* pRegions, |
| 7219 | VkTexFilter filter) |
| 7220 | { |
| 7221 | PreCmdBlitImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7222 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7223 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); |
| 7224 | |
| 7225 | PostCmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, filter); |
| 7226 | } |
| 7227 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7228 | bool PreCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7229 | VkCmdBuffer cmdBuffer, |
| 7230 | const VkBufferImageCopy* pRegions) |
| 7231 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7232 | if(pRegions == nullptr) |
| 7233 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7234 | 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] | 7235 | "vkCmdCopyBufferToImage parameter, const VkBufferImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7236 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7237 | } |
| 7238 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7239 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7240 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7241 | 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] | 7242 | "vkCmdCopyBufferToImage parameter, VkImageAspect pRegions->imageSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7243 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7244 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7245 | |
| 7246 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7247 | } |
| 7248 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7249 | bool PostCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7250 | VkCmdBuffer cmdBuffer, |
| 7251 | VkBuffer srcBuffer, |
| 7252 | VkImage destImage, |
| 7253 | VkImageLayout destImageLayout, |
| 7254 | uint32_t regionCount) |
| 7255 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7256 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7257 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7258 | |
| 7259 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7260 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7261 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7262 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7263 | "vkCmdCopyBufferToImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7264 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7265 | } |
| 7266 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7267 | |
| 7268 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7269 | } |
| 7270 | |
| 7271 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBufferToImage( |
| 7272 | VkCmdBuffer cmdBuffer, |
| 7273 | VkBuffer srcBuffer, |
| 7274 | VkImage destImage, |
| 7275 | VkImageLayout destImageLayout, |
| 7276 | uint32_t regionCount, |
| 7277 | const VkBufferImageCopy* pRegions) |
| 7278 | { |
| 7279 | PreCmdCopyBufferToImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7280 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7281 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); |
| 7282 | |
| 7283 | PostCmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount); |
| 7284 | } |
| 7285 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7286 | bool PreCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7287 | VkCmdBuffer cmdBuffer, |
| 7288 | const VkBufferImageCopy* pRegions) |
| 7289 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7290 | if(pRegions == nullptr) |
| 7291 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7292 | 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] | 7293 | "vkCmdCopyImageToBuffer parameter, const VkBufferImageCopy* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7294 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7295 | } |
| 7296 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7297 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7298 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7299 | 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] | 7300 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7301 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7302 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7303 | |
| 7304 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7305 | } |
| 7306 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7307 | bool PostCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7308 | VkCmdBuffer cmdBuffer, |
| 7309 | VkImage srcImage, |
| 7310 | VkImageLayout srcImageLayout, |
| 7311 | VkBuffer destBuffer, |
| 7312 | uint32_t regionCount) |
| 7313 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7314 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7315 | |
| 7316 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7317 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7318 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7319 | 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] | 7320 | "vkCmdCopyImageToBuffer parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7321 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7322 | } |
| 7323 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7324 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7325 | |
| 7326 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7327 | } |
| 7328 | |
| 7329 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImageToBuffer( |
| 7330 | VkCmdBuffer cmdBuffer, |
| 7331 | VkImage srcImage, |
| 7332 | VkImageLayout srcImageLayout, |
| 7333 | VkBuffer destBuffer, |
| 7334 | uint32_t regionCount, |
| 7335 | const VkBufferImageCopy* pRegions) |
| 7336 | { |
| 7337 | PreCmdCopyImageToBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7338 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7339 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); |
| 7340 | |
| 7341 | PostCmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount); |
| 7342 | } |
| 7343 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7344 | bool PreCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7345 | VkCmdBuffer cmdBuffer, |
| 7346 | const uint32_t* pData) |
| 7347 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7348 | if(pData == nullptr) |
| 7349 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7350 | 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] | 7351 | "vkCmdUpdateBuffer parameter, const uint32_t* pData, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7352 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7353 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7354 | |
| 7355 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7356 | } |
| 7357 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7358 | bool PostCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7359 | VkCmdBuffer cmdBuffer, |
| 7360 | VkBuffer destBuffer, |
| 7361 | VkDeviceSize destOffset, |
| 7362 | VkDeviceSize dataSize) |
| 7363 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7364 | |
| 7365 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7366 | |
| 7367 | |
| 7368 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7369 | } |
| 7370 | |
| 7371 | VK_LAYER_EXPORT void VKAPI vkCmdUpdateBuffer( |
| 7372 | VkCmdBuffer cmdBuffer, |
| 7373 | VkBuffer destBuffer, |
| 7374 | VkDeviceSize destOffset, |
| 7375 | VkDeviceSize dataSize, |
| 7376 | const uint32_t* pData) |
| 7377 | { |
| 7378 | PreCmdUpdateBuffer(cmdBuffer, pData); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7379 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7380 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData); |
| 7381 | |
| 7382 | PostCmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize); |
| 7383 | } |
| 7384 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7385 | bool PostCmdFillBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7386 | VkCmdBuffer cmdBuffer, |
| 7387 | VkBuffer destBuffer, |
| 7388 | VkDeviceSize destOffset, |
| 7389 | VkDeviceSize fillSize, |
| 7390 | uint32_t data) |
| 7391 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7392 | |
| 7393 | |
| 7394 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7395 | |
| 7396 | |
| 7397 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7398 | } |
| 7399 | |
| 7400 | VK_LAYER_EXPORT void VKAPI vkCmdFillBuffer( |
| 7401 | VkCmdBuffer cmdBuffer, |
| 7402 | VkBuffer destBuffer, |
| 7403 | VkDeviceSize destOffset, |
| 7404 | VkDeviceSize fillSize, |
| 7405 | uint32_t data) |
| 7406 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7407 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 7408 | |
| 7409 | PostCmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 7410 | } |
| 7411 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7412 | bool PreCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7413 | VkCmdBuffer cmdBuffer, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 7414 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7415 | const VkImageSubresourceRange* pRanges) |
| 7416 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7417 | if(pColor == nullptr) |
| 7418 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7419 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7420 | "vkCmdClearColorImage parameter, const VkClearColorValue* pColor, is null pointer"); |
| 7421 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7422 | } |
| 7423 | |
| 7424 | if(pRanges == nullptr) |
| 7425 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7426 | 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] | 7427 | "vkCmdClearColorImage parameter, const VkImageSubresourceRange* pRanges, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7428 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7429 | } |
| 7430 | if(pRanges->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7431 | pRanges->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7432 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7433 | 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] | 7434 | "vkCmdClearColorImage parameter, VkImageAspect pRanges->aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7435 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7436 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7437 | |
| 7438 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7439 | } |
| 7440 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7441 | bool PostCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7442 | VkCmdBuffer cmdBuffer, |
| 7443 | VkImage image, |
| 7444 | VkImageLayout imageLayout, |
| 7445 | uint32_t rangeCount) |
| 7446 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7447 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7448 | |
| 7449 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7450 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7451 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7452 | 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] | 7453 | "vkCmdClearColorImage parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7454 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7455 | } |
| 7456 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7457 | |
| 7458 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7459 | } |
| 7460 | |
| 7461 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage( |
| 7462 | VkCmdBuffer cmdBuffer, |
| 7463 | VkImage image, |
| 7464 | VkImageLayout imageLayout, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 7465 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7466 | uint32_t rangeCount, |
| 7467 | const VkImageSubresourceRange* pRanges) |
| 7468 | { |
| 7469 | PreCmdClearColorImage(cmdBuffer, pColor, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7470 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7471 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 7472 | |
| 7473 | PostCmdClearColorImage(cmdBuffer, image, imageLayout, rangeCount); |
| 7474 | } |
| 7475 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7476 | bool PreCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7477 | VkCmdBuffer cmdBuffer, |
| 7478 | const VkImageSubresourceRange* pRanges) |
| 7479 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7480 | if(pRanges == nullptr) |
| 7481 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7482 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7483 | "vkCmdClearDepthStencilImage parameter, const VkImageSubresourceRange* pRanges, is null pointer"); |
| 7484 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7485 | } |
| 7486 | if(pRanges->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7487 | pRanges->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7488 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7489 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7490 | "vkCmdClearDepthStencilImage parameter, VkImageAspect pRanges->aspect, is unrecognized enumerator"); |
| 7491 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7492 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7493 | |
| 7494 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7495 | } |
| 7496 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7497 | bool PostCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7498 | VkCmdBuffer cmdBuffer, |
| 7499 | VkImage image, |
| 7500 | VkImageLayout imageLayout, |
| 7501 | float depth, |
| 7502 | uint32_t stencil, |
| 7503 | uint32_t rangeCount) |
| 7504 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7505 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7506 | |
| 7507 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7508 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7509 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7510 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7511 | "vkCmdClearDepthStencilImage parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7512 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7513 | } |
| 7514 | |
| 7515 | |
| 7516 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7517 | |
| 7518 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7519 | } |
| 7520 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7521 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7522 | VkCmdBuffer cmdBuffer, |
| 7523 | VkImage image, |
| 7524 | VkImageLayout imageLayout, |
| 7525 | float depth, |
| 7526 | uint32_t stencil, |
| 7527 | uint32_t rangeCount, |
| 7528 | const VkImageSubresourceRange* pRanges) |
| 7529 | { |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7530 | PreCmdClearDepthStencilImage(cmdBuffer, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7531 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7532 | 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] | 7533 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7534 | PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7535 | } |
| 7536 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7537 | bool PreCmdClearColorAttachment( |
| 7538 | VkCmdBuffer cmdBuffer, |
| 7539 | const VkClearColorValue* pColor, |
| 7540 | const VkRect3D* pRects) |
| 7541 | { |
| 7542 | if(pColor == nullptr) |
| 7543 | { |
| 7544 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7545 | "vkCmdClearColorAttachment parameter, const VkClearColorValue* pColor, is null pointer"); |
| 7546 | return false; |
| 7547 | } |
| 7548 | |
| 7549 | if(pRects == nullptr) |
| 7550 | { |
| 7551 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7552 | "vkCmdClearColorAttachment parameter, const VkRect3D* pRects, is null pointer"); |
| 7553 | return false; |
| 7554 | } |
| 7555 | |
| 7556 | return true; |
| 7557 | } |
| 7558 | |
| 7559 | bool PostCmdClearColorAttachment( |
| 7560 | VkCmdBuffer cmdBuffer, |
| 7561 | uint32_t colorAttachment, |
| 7562 | VkImageLayout imageLayout, |
| 7563 | uint32_t rectCount) |
| 7564 | { |
| 7565 | |
| 7566 | |
| 7567 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7568 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7569 | { |
| 7570 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7571 | "vkCmdClearColorAttachment parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7572 | return false; |
| 7573 | } |
| 7574 | |
| 7575 | |
| 7576 | return true; |
| 7577 | } |
| 7578 | |
| 7579 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorAttachment( |
| 7580 | VkCmdBuffer cmdBuffer, |
| 7581 | uint32_t colorAttachment, |
| 7582 | VkImageLayout imageLayout, |
| 7583 | const VkClearColorValue* pColor, |
| 7584 | uint32_t rectCount, |
| 7585 | const VkRect3D* pRects) |
| 7586 | { |
| 7587 | PreCmdClearColorAttachment(cmdBuffer, pColor, pRects); |
| 7588 | |
| 7589 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects); |
| 7590 | |
| 7591 | PostCmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, rectCount); |
| 7592 | } |
| 7593 | |
| 7594 | bool PreCmdClearDepthStencilAttachment( |
| 7595 | VkCmdBuffer cmdBuffer, |
| 7596 | const VkRect3D* pRects) |
| 7597 | { |
| 7598 | if(pRects == nullptr) |
| 7599 | { |
| 7600 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7601 | "vkCmdClearDepthStencilAttachment parameter, const VkRect3D* pRects, is null pointer"); |
| 7602 | return false; |
| 7603 | } |
| 7604 | |
| 7605 | return true; |
| 7606 | } |
| 7607 | |
| 7608 | bool PostCmdClearDepthStencilAttachment( |
| 7609 | VkCmdBuffer cmdBuffer, |
| 7610 | VkImageAspectFlags imageAspectMask, |
| 7611 | VkImageLayout imageLayout, |
| 7612 | float depth, |
| 7613 | uint32_t stencil, |
| 7614 | uint32_t rectCount) |
| 7615 | { |
| 7616 | |
| 7617 | if(!ValidateEnumerator((VkImageAspectFlagBits)imageAspectMask)) |
| 7618 | { |
| 7619 | std::string reason = "vkCmdClearDepthStencilAttachment parameter, VkImageAspectFlags imageAspectMask, is " + EnumeratorString((VkImageAspectFlagBits)imageAspectMask); |
| 7620 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 7621 | return false; |
| 7622 | } |
| 7623 | |
| 7624 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7625 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7626 | { |
| 7627 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 7628 | "vkCmdClearDepthStencilAttachment parameter, VkImageLayout imageLayout, is unrecognized enumerator"); |
| 7629 | return false; |
| 7630 | } |
| 7631 | |
| 7632 | |
| 7633 | |
| 7634 | |
| 7635 | return true; |
| 7636 | } |
| 7637 | |
| 7638 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment( |
| 7639 | VkCmdBuffer cmdBuffer, |
| 7640 | VkImageAspectFlags imageAspectMask, |
| 7641 | VkImageLayout imageLayout, |
| 7642 | float depth, |
| 7643 | uint32_t stencil, |
| 7644 | uint32_t rectCount, |
| 7645 | const VkRect3D* pRects) |
| 7646 | { |
| 7647 | PreCmdClearDepthStencilAttachment(cmdBuffer, pRects); |
| 7648 | |
| 7649 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects); |
| 7650 | |
| 7651 | PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount); |
| 7652 | } |
| 7653 | |
| 7654 | bool PreCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7655 | VkCmdBuffer cmdBuffer, |
| 7656 | const VkImageResolve* pRegions) |
| 7657 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7658 | if(pRegions == nullptr) |
| 7659 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7660 | 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] | 7661 | "vkCmdResolveImage parameter, const VkImageResolve* pRegions, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7662 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7663 | } |
| 7664 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7665 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7666 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7667 | 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] | 7668 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7669 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7670 | } |
| 7671 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7672 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7673 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7674 | 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] | 7675 | "vkCmdResolveImage parameter, VkImageAspect pRegions->destSubresource.aspect, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7676 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7677 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7678 | |
| 7679 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7680 | } |
| 7681 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7682 | bool PostCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7683 | VkCmdBuffer cmdBuffer, |
| 7684 | VkImage srcImage, |
| 7685 | VkImageLayout srcImageLayout, |
| 7686 | VkImage destImage, |
| 7687 | VkImageLayout destImageLayout, |
| 7688 | uint32_t regionCount) |
| 7689 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7690 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7691 | |
| 7692 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7693 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7694 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7695 | 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] | 7696 | "vkCmdResolveImage parameter, VkImageLayout srcImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7697 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7698 | } |
| 7699 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7700 | |
| 7701 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7702 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7703 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7704 | 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] | 7705 | "vkCmdResolveImage parameter, VkImageLayout destImageLayout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7706 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7707 | } |
| 7708 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7709 | |
| 7710 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7711 | } |
| 7712 | |
| 7713 | VK_LAYER_EXPORT void VKAPI vkCmdResolveImage( |
| 7714 | VkCmdBuffer cmdBuffer, |
| 7715 | VkImage srcImage, |
| 7716 | VkImageLayout srcImageLayout, |
| 7717 | VkImage destImage, |
| 7718 | VkImageLayout destImageLayout, |
| 7719 | uint32_t regionCount, |
| 7720 | const VkImageResolve* pRegions) |
| 7721 | { |
| 7722 | PreCmdResolveImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7723 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7724 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 7725 | |
| 7726 | PostCmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 7727 | } |
| 7728 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7729 | bool PostCmdSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7730 | VkCmdBuffer cmdBuffer, |
| 7731 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7732 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7733 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7734 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7735 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7736 | |
| 7737 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7738 | } |
| 7739 | |
| 7740 | VK_LAYER_EXPORT void VKAPI vkCmdSetEvent( |
| 7741 | VkCmdBuffer cmdBuffer, |
| 7742 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7743 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7744 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7745 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7746 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7747 | PostCmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7748 | } |
| 7749 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7750 | bool PostCmdResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7751 | VkCmdBuffer cmdBuffer, |
| 7752 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7753 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7754 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7755 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7756 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7757 | |
| 7758 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7759 | } |
| 7760 | |
| 7761 | VK_LAYER_EXPORT void VKAPI vkCmdResetEvent( |
| 7762 | VkCmdBuffer cmdBuffer, |
| 7763 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7764 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7765 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7766 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7767 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7768 | PostCmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7769 | } |
| 7770 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7771 | bool PreCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7772 | VkCmdBuffer cmdBuffer, |
| 7773 | const VkEvent* pEvents, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 7774 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7775 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7776 | if(pEvents == nullptr) |
| 7777 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7778 | 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] | 7779 | "vkCmdWaitEvents parameter, const VkEvent* pEvents, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7780 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7781 | } |
| 7782 | |
| 7783 | if(ppMemBarriers == nullptr) |
| 7784 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7785 | 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] | 7786 | "vkCmdWaitEvents parameter, const void** ppMemBarriers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7787 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7788 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7789 | |
| 7790 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7791 | } |
| 7792 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7793 | bool PostCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7794 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7795 | uint32_t eventCount, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7796 | VkPipelineStageFlags sourceStageMask, |
| 7797 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7798 | uint32_t memBarrierCount) |
| 7799 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7800 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7801 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7802 | |
| 7803 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7804 | |
| 7805 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7806 | } |
| 7807 | |
| 7808 | VK_LAYER_EXPORT void VKAPI vkCmdWaitEvents( |
| 7809 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7810 | uint32_t eventCount, |
| 7811 | const VkEvent* pEvents, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7812 | VkPipelineStageFlags sourceStageMask, |
| 7813 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7814 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 7815 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7816 | { |
| 7817 | PreCmdWaitEvents(cmdBuffer, pEvents, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7818 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7819 | 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] | 7820 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7821 | PostCmdWaitEvents(cmdBuffer, eventCount, sourceStageMask, destStageMask, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7822 | } |
| 7823 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7824 | bool PreCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7825 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7826 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7827 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7828 | if(ppMemBarriers == nullptr) |
| 7829 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7830 | 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] | 7831 | "vkCmdPipelineBarrier parameter, const void** ppMemBarriers, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7832 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7833 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7834 | |
| 7835 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7836 | } |
| 7837 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7838 | bool PostCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7839 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7840 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7841 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7842 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7843 | uint32_t memBarrierCount) |
| 7844 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7845 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7846 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7847 | |
| 7848 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7849 | |
| 7850 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7851 | } |
| 7852 | |
| 7853 | VK_LAYER_EXPORT void VKAPI vkCmdPipelineBarrier( |
| 7854 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7855 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7856 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7857 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7858 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7859 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7860 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7861 | PreCmdPipelineBarrier(cmdBuffer, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7862 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7863 | 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] | 7864 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7865 | PostCmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7866 | } |
| 7867 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7868 | bool PostCmdBeginQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7869 | VkCmdBuffer cmdBuffer, |
| 7870 | VkQueryPool queryPool, |
| 7871 | uint32_t slot, |
| 7872 | VkQueryControlFlags flags) |
| 7873 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7874 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7875 | |
| 7876 | |
| 7877 | if(!ValidateEnumerator((VkQueryControlFlagBits)flags)) |
| 7878 | { |
| 7879 | std::string reason = "vkCmdBeginQuery parameter, VkQueryControlFlags flags, is " + EnumeratorString((VkQueryControlFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7880 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 7881 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7882 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7883 | |
| 7884 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7885 | } |
| 7886 | |
| 7887 | VK_LAYER_EXPORT void VKAPI vkCmdBeginQuery( |
| 7888 | VkCmdBuffer cmdBuffer, |
| 7889 | VkQueryPool queryPool, |
| 7890 | uint32_t slot, |
| 7891 | VkQueryControlFlags flags) |
| 7892 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7893 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7894 | |
| 7895 | PostCmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7896 | } |
| 7897 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7898 | bool PostCmdEndQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7899 | VkCmdBuffer cmdBuffer, |
| 7900 | VkQueryPool queryPool, |
| 7901 | uint32_t slot) |
| 7902 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7903 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7904 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7905 | |
| 7906 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7907 | } |
| 7908 | |
| 7909 | VK_LAYER_EXPORT void VKAPI vkCmdEndQuery( |
| 7910 | VkCmdBuffer cmdBuffer, |
| 7911 | VkQueryPool queryPool, |
| 7912 | uint32_t slot) |
| 7913 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7914 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndQuery(cmdBuffer, queryPool, slot); |
| 7915 | |
| 7916 | PostCmdEndQuery(cmdBuffer, queryPool, slot); |
| 7917 | } |
| 7918 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7919 | bool PostCmdResetQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7920 | VkCmdBuffer cmdBuffer, |
| 7921 | VkQueryPool queryPool, |
| 7922 | uint32_t startQuery, |
| 7923 | uint32_t queryCount) |
| 7924 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7925 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7926 | |
| 7927 | |
| 7928 | |
| 7929 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7930 | } |
| 7931 | |
| 7932 | VK_LAYER_EXPORT void VKAPI vkCmdResetQueryPool( |
| 7933 | VkCmdBuffer cmdBuffer, |
| 7934 | VkQueryPool queryPool, |
| 7935 | uint32_t startQuery, |
| 7936 | uint32_t queryCount) |
| 7937 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7938 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 7939 | |
| 7940 | PostCmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 7941 | } |
| 7942 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7943 | bool PostCmdWriteTimestamp( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7944 | VkCmdBuffer cmdBuffer, |
| 7945 | VkTimestampType timestampType, |
| 7946 | VkBuffer destBuffer, |
| 7947 | VkDeviceSize destOffset) |
| 7948 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7949 | |
| 7950 | if(timestampType < VK_TIMESTAMP_TYPE_BEGIN_RANGE || |
| 7951 | timestampType > VK_TIMESTAMP_TYPE_END_RANGE) |
| 7952 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7953 | 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] | 7954 | "vkCmdWriteTimestamp parameter, VkTimestampType timestampType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7955 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7956 | } |
| 7957 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7958 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7959 | |
| 7960 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7961 | } |
| 7962 | |
| 7963 | VK_LAYER_EXPORT void VKAPI vkCmdWriteTimestamp( |
| 7964 | VkCmdBuffer cmdBuffer, |
| 7965 | VkTimestampType timestampType, |
| 7966 | VkBuffer destBuffer, |
| 7967 | VkDeviceSize destOffset) |
| 7968 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7969 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 7970 | |
| 7971 | PostCmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 7972 | } |
| 7973 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7974 | bool PostCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7975 | VkCmdBuffer cmdBuffer, |
| 7976 | VkQueryPool queryPool, |
| 7977 | uint32_t startQuery, |
| 7978 | uint32_t queryCount, |
| 7979 | VkBuffer destBuffer, |
| 7980 | VkDeviceSize destOffset, |
| 7981 | VkDeviceSize destStride, |
| 7982 | VkQueryResultFlags flags) |
| 7983 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7984 | |
| 7985 | |
| 7986 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7987 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7988 | |
| 7989 | |
| 7990 | |
| 7991 | if(!ValidateEnumerator((VkQueryResultFlagBits)flags)) |
| 7992 | { |
| 7993 | std::string reason = "vkCmdCopyQueryPoolResults parameter, VkQueryResultFlags flags, is " + EnumeratorString((VkQueryResultFlagBits)flags); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7994 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 7995 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7996 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7997 | |
| 7998 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7999 | } |
| 8000 | |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8001 | VK_LAYER_EXPORT void VKAPI vkCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8002 | VkCmdBuffer cmdBuffer, |
| 8003 | VkQueryPool queryPool, |
| 8004 | uint32_t startQuery, |
| 8005 | uint32_t queryCount, |
| 8006 | VkBuffer destBuffer, |
| 8007 | VkDeviceSize destOffset, |
| 8008 | VkDeviceSize destStride, |
| 8009 | VkQueryResultFlags flags) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8010 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8011 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
| 8012 | |
| 8013 | PostCmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8014 | } |
| 8015 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8016 | bool PreCreateFramebuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8017 | VkDevice device, |
| 8018 | const VkFramebufferCreateInfo* pCreateInfo) |
| 8019 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8020 | if(pCreateInfo == nullptr) |
| 8021 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8022 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8023 | "vkCreateFramebuffer parameter, const VkFramebufferCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8024 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8025 | } |
| 8026 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 8027 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
| 8028 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8029 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8030 | "vkCreateFramebuffer parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8031 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8032 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8033 | if(pCreateInfo->pAttachments == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8034 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8035 | 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] | 8036 | "vkCreateFramebuffer parameter, const VkAttachmentBindInfo* pCreateInfo->pAttachments, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8037 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8038 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8039 | if(pCreateInfo->pAttachments->view.handle == 0) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8040 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8041 | 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] | 8042 | "vkCreateFramebuffer parameter, VkAttachmentView pCreateInfo->pAttachments->view, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8043 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8044 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8045 | if(pCreateInfo->pAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 8046 | pCreateInfo->pAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8047 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8048 | 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] | 8049 | "vkCreateFramebuffer parameter, VkImageLayout pCreateInfo->pAttachments->layout, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8050 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8051 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8052 | |
| 8053 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8054 | } |
| 8055 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8056 | bool PostCreateFramebuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8057 | VkDevice device, |
| 8058 | VkFramebuffer* pFramebuffer, |
| 8059 | VkResult result) |
| 8060 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8061 | |
| 8062 | if(pFramebuffer == nullptr) |
| 8063 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8064 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8065 | "vkCreateFramebuffer parameter, VkFramebuffer* pFramebuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8066 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8067 | } |
| 8068 | |
| 8069 | if(result != VK_SUCCESS) |
| 8070 | { |
| 8071 | std::string reason = "vkCreateFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8072 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8073 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8074 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8075 | |
| 8076 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8077 | } |
| 8078 | |
| 8079 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFramebuffer( |
| 8080 | VkDevice device, |
| 8081 | const VkFramebufferCreateInfo* pCreateInfo, |
| 8082 | VkFramebuffer* pFramebuffer) |
| 8083 | { |
| 8084 | PreCreateFramebuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8085 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8086 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pFramebuffer); |
| 8087 | |
| 8088 | PostCreateFramebuffer(device, pFramebuffer, result); |
| 8089 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8090 | return result; |
| 8091 | } |
| 8092 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8093 | bool PostDestroyFramebuffer( |
| 8094 | VkDevice device, |
| 8095 | VkFramebuffer framebuffer, |
| 8096 | VkResult result) |
| 8097 | { |
| 8098 | |
| 8099 | if(result != VK_SUCCESS) |
| 8100 | { |
| 8101 | std::string reason = "vkDestroyFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 8102 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8103 | return false; |
| 8104 | } |
| 8105 | |
| 8106 | return true; |
| 8107 | } |
| 8108 | |
| 8109 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyFramebuffer( |
| 8110 | VkDevice device, |
| 8111 | VkFramebuffer framebuffer) |
| 8112 | { |
| 8113 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyFramebuffer(device, framebuffer); |
| 8114 | |
| 8115 | PostDestroyFramebuffer(device, framebuffer, result); |
| 8116 | |
| 8117 | return result; |
| 8118 | } |
| 8119 | |
| 8120 | bool PreCreateRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8121 | VkDevice device, |
| 8122 | const VkRenderPassCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8123 | { |
| 8124 | if(pCreateInfo == nullptr) |
| 8125 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8126 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8127 | "vkCreateRenderPass parameter, const VkRenderPassCreateInfo* pCreateInfo, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8128 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8129 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8130 | if(pCreateInfo->sType < VK_STRUCTURE_TYPE_BEGIN_RANGE || |
| 8131 | pCreateInfo->sType > VK_STRUCTURE_TYPE_END_RANGE) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8132 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8133 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8134 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->sType, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8135 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8136 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8137 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8138 | for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8139 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8140 | const VkAttachmentDescription *att = &pCreateInfo->pAttachments[i]; |
| 8141 | |
| 8142 | if(att->format < VK_FORMAT_BEGIN_RANGE || att->format > VK_FORMAT_END_RANGE) |
| 8143 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8144 | 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] | 8145 | "vkCreateRenderPass parameter, VkFormat in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8146 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8147 | } |
| 8148 | if(att->initialLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || att->initialLayout > VK_IMAGE_LAYOUT_END_RANGE || |
| 8149 | att->finalLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || att->finalLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 8150 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8151 | 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] | 8152 | "vkCreateRenderPass parameter, VkImageLayout in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8153 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8154 | } |
| 8155 | if(att->loadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || att->loadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 8156 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8157 | 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] | 8158 | "vkCreateRenderPass parameter, VkAttachmentLoadOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8159 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8160 | } |
| 8161 | if(att->storeOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || att->storeOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 8162 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8163 | 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] | 8164 | "vkCreateRenderPass parameter, VkAttachmentStoreOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8165 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8166 | } |
| 8167 | if(att->stencilLoadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || att->stencilLoadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 8168 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8169 | 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] | 8170 | "vkCreateRenderPass parameter, VkAttachmentLoadOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8171 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8172 | } |
| 8173 | if(att->stencilStoreOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || att->stencilStoreOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 8174 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8175 | 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] | 8176 | "vkCreateRenderPass parameter, VkAttachmentStoreOp in pCreateInfo->pAttachments, is unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8177 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8178 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8179 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8180 | |
| 8181 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8182 | } |
| 8183 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8184 | bool PostCreateRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8185 | VkDevice device, |
| 8186 | VkRenderPass* pRenderPass, |
| 8187 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8188 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8189 | |
| 8190 | if(pRenderPass == nullptr) |
| 8191 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8192 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8193 | "vkCreateRenderPass parameter, VkRenderPass* pRenderPass, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8194 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8195 | } |
| 8196 | |
| 8197 | if(result != VK_SUCCESS) |
| 8198 | { |
| 8199 | std::string reason = "vkCreateRenderPass parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8200 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 8201 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8202 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8203 | |
| 8204 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8205 | } |
| 8206 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8207 | VK_LAYER_EXPORT VkResult VKAPI vkCreateRenderPass( |
| 8208 | VkDevice device, |
| 8209 | const VkRenderPassCreateInfo* pCreateInfo, |
| 8210 | VkRenderPass* pRenderPass) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8211 | { |
| 8212 | PreCreateRenderPass(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8213 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8214 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pRenderPass); |
| 8215 | |
| 8216 | PostCreateRenderPass(device, pRenderPass, result); |
| 8217 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8218 | return result; |
| 8219 | } |
| 8220 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8221 | bool PreCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8222 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8223 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8224 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8225 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8226 | if(pRenderPassBegin == nullptr) |
| 8227 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8228 | 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] | 8229 | "vkCmdBeginRenderPass parameter, const VkRenderPassBegin* pRenderPassBegin, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8230 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 8231 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8232 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 8233 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8234 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8235 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 8236 | "vkCmdBeginRenderPass parameter, VkRenderPassContents pRenderPassBegin->contents, is unrecognized enumerator"); |
| 8237 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 8238 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8239 | |
| 8240 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8241 | } |
| 8242 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8243 | bool PostCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8244 | VkCmdBuffer cmdBuffer) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8245 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8246 | |
| 8247 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8248 | } |
| 8249 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8250 | VK_LAYER_EXPORT void VKAPI vkCmdBeginRenderPass( |
| 8251 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8252 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8253 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8254 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8255 | PreCmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
| 8256 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8257 | |
| 8258 | PostCmdBeginRenderPass(cmdBuffer); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8259 | } |
| 8260 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8261 | void PreCmdNextSubpass( |
| 8262 | VkCmdBuffer cmdBuffer, |
| 8263 | VkRenderPassContents contents) |
| 8264 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8265 | |
| 8266 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 8267 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8268 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8269 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 8270 | "vkCmdBeginRenderPass parameter, VkRenderPassContents pRenderPassBegin->contents, is unrecognized enumerator"); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8271 | return; |
| 8272 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8273 | |
| 8274 | return; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8275 | } |
| 8276 | |
| 8277 | void PostCmdNextSubpass( |
| 8278 | VkCmdBuffer cmdBuffer) |
| 8279 | { |
| 8280 | if(cmdBuffer == nullptr) |
| 8281 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8282 | 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] | 8283 | "vkCmdNextSubpass parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
| 8284 | return; |
| 8285 | } |
| 8286 | } |
| 8287 | |
| 8288 | VK_LAYER_EXPORT void VKAPI vkCmdNextSubpass( |
| 8289 | VkCmdBuffer cmdBuffer, |
| 8290 | VkRenderPassContents contents) |
| 8291 | { |
| 8292 | PreCmdNextSubpass(cmdBuffer, contents); |
| 8293 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdNextSubpass(cmdBuffer, contents); |
| 8294 | |
| 8295 | PostCmdNextSubpass(cmdBuffer); |
| 8296 | } |
| 8297 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8298 | bool PreCmdExecuteCommands( |
| 8299 | VkCmdBuffer cmdBuffer, |
| 8300 | const VkCmdBuffer* pCmdBuffers) |
| 8301 | { |
| 8302 | if(pCmdBuffers == nullptr) |
| 8303 | { |
| 8304 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | 346583c | 2015-07-13 15:21:40 -0600 | [diff] [blame] | 8305 | "vkCmdExecuteCommands parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8306 | return false; |
| 8307 | } |
| 8308 | |
| 8309 | return true; |
| 8310 | } |
| 8311 | |
| 8312 | bool PostCmdExecuteCommands( |
| 8313 | VkCmdBuffer cmdBuffer, |
| 8314 | uint32_t cmdBuffersCount) |
| 8315 | { |
| 8316 | |
| 8317 | |
| 8318 | return true; |
| 8319 | } |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8320 | void PreCmdExecuteCommands( |
| 8321 | VkCmdBuffer cmdBuffer) |
| 8322 | { |
| 8323 | if(cmdBuffer == nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8324 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8325 | 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] | 8326 | "vkCmdExecuteCommands parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
| 8327 | return; |
| 8328 | } |
| 8329 | } |
| 8330 | |
| 8331 | void PostCmdExecuteCommands( |
| 8332 | VkCmdBuffer cmdBuffer) |
| 8333 | { |
| 8334 | if(cmdBuffer == nullptr) |
| 8335 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8336 | 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] | 8337 | "vkCmdExecuteCommands parameter, VkCmdBuffer cmdBuffer, is null pointer"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8338 | return; |
| 8339 | } |
Chia-I Wu | f869338 | 2015-04-16 22:02:10 +0800 | [diff] [blame] | 8340 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8341 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8342 | VK_LAYER_EXPORT void VKAPI vkCmdExecuteCommands( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8343 | VkCmdBuffer cmdBuffer, |
| 8344 | uint32_t cmdBuffersCount, |
| 8345 | const VkCmdBuffer* pCmdBuffers) |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8346 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8347 | PreCmdExecuteCommands(cmdBuffer, pCmdBuffers); |
| 8348 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8349 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers); |
| 8350 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8351 | PostCmdExecuteCommands(cmdBuffer, cmdBuffersCount); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8352 | } |
| 8353 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8354 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr(VkDevice device, const char* funcName) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8355 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8356 | if (device == NULL) { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8357 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8358 | } |
| 8359 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8360 | /* loader uses this to force layer initialization; device object is wrapped */ |
| 8361 | if (!strcmp(funcName, "vkGetDeviceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8362 | initDeviceTable(pc_device_table_map, (const VkBaseLayerObject *) device); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8363 | return (PFN_vkVoidFunction) vkGetDeviceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8364 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8365 | |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 8366 | if (!strcmp(funcName, "vkCreateDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8367 | return (PFN_vkVoidFunction) vkCreateDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8368 | if (!strcmp(funcName, "vkDestroyDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8369 | return (PFN_vkVoidFunction) vkDestroyDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8370 | if (!strcmp(funcName, "vkGetDeviceQueue")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8371 | return (PFN_vkVoidFunction) vkGetDeviceQueue; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8372 | if (!strcmp(funcName, "vkQueueSubmit")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8373 | return (PFN_vkVoidFunction) vkQueueSubmit; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8374 | if (!strcmp(funcName, "vkQueueWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8375 | return (PFN_vkVoidFunction) vkQueueWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8376 | if (!strcmp(funcName, "vkDeviceWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8377 | return (PFN_vkVoidFunction) vkDeviceWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8378 | if (!strcmp(funcName, "vkAllocMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8379 | return (PFN_vkVoidFunction) vkAllocMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8380 | if (!strcmp(funcName, "vkFreeMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8381 | return (PFN_vkVoidFunction) vkFreeMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8382 | if (!strcmp(funcName, "vkMapMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8383 | return (PFN_vkVoidFunction) vkMapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8384 | if (!strcmp(funcName, "vkUnmapMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8385 | return (PFN_vkVoidFunction) vkUnmapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8386 | if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8387 | return (PFN_vkVoidFunction) vkFlushMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8388 | if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8389 | return (PFN_vkVoidFunction) vkInvalidateMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8390 | if (!strcmp(funcName, "vkCreateFence")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8391 | return (PFN_vkVoidFunction) vkCreateFence; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8392 | if (!strcmp(funcName, "vkResetFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8393 | return (PFN_vkVoidFunction) vkResetFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8394 | if (!strcmp(funcName, "vkGetFenceStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8395 | return (PFN_vkVoidFunction) vkGetFenceStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8396 | if (!strcmp(funcName, "vkWaitForFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8397 | return (PFN_vkVoidFunction) vkWaitForFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8398 | if (!strcmp(funcName, "vkCreateSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8399 | return (PFN_vkVoidFunction) vkCreateSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8400 | if (!strcmp(funcName, "vkQueueSignalSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8401 | return (PFN_vkVoidFunction) vkQueueSignalSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8402 | if (!strcmp(funcName, "vkQueueWaitSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8403 | return (PFN_vkVoidFunction) vkQueueWaitSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8404 | if (!strcmp(funcName, "vkCreateEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8405 | return (PFN_vkVoidFunction) vkCreateEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8406 | if (!strcmp(funcName, "vkGetEventStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8407 | return (PFN_vkVoidFunction) vkGetEventStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8408 | if (!strcmp(funcName, "vkSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8409 | return (PFN_vkVoidFunction) vkSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8410 | if (!strcmp(funcName, "vkResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8411 | return (PFN_vkVoidFunction) vkResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8412 | if (!strcmp(funcName, "vkCreateQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8413 | return (PFN_vkVoidFunction) vkCreateQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8414 | if (!strcmp(funcName, "vkGetQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8415 | return (PFN_vkVoidFunction) vkGetQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8416 | if (!strcmp(funcName, "vkCreateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8417 | return (PFN_vkVoidFunction) vkCreateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8418 | if (!strcmp(funcName, "vkCreateBufferView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8419 | return (PFN_vkVoidFunction) vkCreateBufferView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8420 | if (!strcmp(funcName, "vkCreateImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8421 | return (PFN_vkVoidFunction) vkCreateImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8422 | if (!strcmp(funcName, "vkGetImageSubresourceLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8423 | return (PFN_vkVoidFunction) vkGetImageSubresourceLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8424 | if (!strcmp(funcName, "vkCreateImageView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8425 | return (PFN_vkVoidFunction) vkCreateImageView; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8426 | if (!strcmp(funcName, "vkCreateAttachmentView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8427 | return (PFN_vkVoidFunction) vkCreateAttachmentView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8428 | if (!strcmp(funcName, "vkCreateShader")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8429 | return (PFN_vkVoidFunction) vkCreateShader; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 8430 | if (!strcmp(funcName, "vkCreateGraphicsPipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8431 | return (PFN_vkVoidFunction) vkCreateGraphicsPipelines; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 8432 | if (!strcmp(funcName, "vkCreateComputePipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8433 | return (PFN_vkVoidFunction) vkCreateComputePipelines; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8434 | if (!strcmp(funcName, "vkCreatePipelineLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8435 | return (PFN_vkVoidFunction) vkCreatePipelineLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8436 | if (!strcmp(funcName, "vkCreateSampler")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8437 | return (PFN_vkVoidFunction) vkCreateSampler; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8438 | if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8439 | return (PFN_vkVoidFunction) vkCreateDescriptorSetLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8440 | if (!strcmp(funcName, "vkCreateDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8441 | return (PFN_vkVoidFunction) vkCreateDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8442 | if (!strcmp(funcName, "vkResetDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8443 | return (PFN_vkVoidFunction) vkResetDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8444 | if (!strcmp(funcName, "vkAllocDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8445 | return (PFN_vkVoidFunction) vkAllocDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8446 | if (!strcmp(funcName, "vkCreateDynamicViewportState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8447 | return (PFN_vkVoidFunction) vkCreateDynamicViewportState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8448 | if (!strcmp(funcName, "vkCreateDynamicRasterState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8449 | return (PFN_vkVoidFunction) vkCreateDynamicRasterState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8450 | if (!strcmp(funcName, "vkCreateDynamicColorBlendState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8451 | return (PFN_vkVoidFunction) vkCreateDynamicColorBlendState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8452 | if (!strcmp(funcName, "vkCreateDynamicDepthStencilState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8453 | return (PFN_vkVoidFunction) vkCreateDynamicDepthStencilState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8454 | if (!strcmp(funcName, "vkCreateCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8455 | return (PFN_vkVoidFunction) vkCreateCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8456 | if (!strcmp(funcName, "vkBeginCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8457 | return (PFN_vkVoidFunction) vkBeginCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8458 | if (!strcmp(funcName, "vkEndCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8459 | return (PFN_vkVoidFunction) vkEndCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8460 | if (!strcmp(funcName, "vkResetCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8461 | return (PFN_vkVoidFunction) vkResetCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8462 | if (!strcmp(funcName, "vkCmdBindPipeline")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8463 | return (PFN_vkVoidFunction) vkCmdBindPipeline; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8464 | if (!strcmp(funcName, "vkCmdBindDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8465 | return (PFN_vkVoidFunction) vkCmdBindDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8466 | if (!strcmp(funcName, "vkCmdBindVertexBuffers")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8467 | return (PFN_vkVoidFunction) vkCmdBindVertexBuffers; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8468 | if (!strcmp(funcName, "vkCmdBindIndexBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8469 | return (PFN_vkVoidFunction) vkCmdBindIndexBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8470 | if (!strcmp(funcName, "vkCmdDraw")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8471 | return (PFN_vkVoidFunction) vkCmdDraw; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8472 | if (!strcmp(funcName, "vkCmdDrawIndexed")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8473 | return (PFN_vkVoidFunction) vkCmdDrawIndexed; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8474 | if (!strcmp(funcName, "vkCmdDrawIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8475 | return (PFN_vkVoidFunction) vkCmdDrawIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8476 | if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8477 | return (PFN_vkVoidFunction) vkCmdDrawIndexedIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8478 | if (!strcmp(funcName, "vkCmdDispatch")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8479 | return (PFN_vkVoidFunction) vkCmdDispatch; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8480 | if (!strcmp(funcName, "vkCmdDispatchIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8481 | return (PFN_vkVoidFunction) vkCmdDispatchIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8482 | if (!strcmp(funcName, "vkCmdCopyBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8483 | return (PFN_vkVoidFunction) vkCmdCopyBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8484 | if (!strcmp(funcName, "vkCmdCopyImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8485 | return (PFN_vkVoidFunction) vkCmdCopyImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8486 | if (!strcmp(funcName, "vkCmdBlitImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8487 | return (PFN_vkVoidFunction) vkCmdBlitImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8488 | if (!strcmp(funcName, "vkCmdCopyBufferToImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8489 | return (PFN_vkVoidFunction) vkCmdCopyBufferToImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8490 | if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8491 | return (PFN_vkVoidFunction) vkCmdCopyImageToBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8492 | if (!strcmp(funcName, "vkCmdUpdateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8493 | return (PFN_vkVoidFunction) vkCmdUpdateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8494 | if (!strcmp(funcName, "vkCmdFillBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8495 | return (PFN_vkVoidFunction) vkCmdFillBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8496 | if (!strcmp(funcName, "vkCmdClearColorImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8497 | return (PFN_vkVoidFunction) vkCmdClearColorImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8498 | if (!strcmp(funcName, "vkCmdResolveImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8499 | return (PFN_vkVoidFunction) vkCmdResolveImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8500 | if (!strcmp(funcName, "vkCmdSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8501 | return (PFN_vkVoidFunction) vkCmdSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8502 | if (!strcmp(funcName, "vkCmdResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8503 | return (PFN_vkVoidFunction) vkCmdResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8504 | if (!strcmp(funcName, "vkCmdWaitEvents")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8505 | return (PFN_vkVoidFunction) vkCmdWaitEvents; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8506 | if (!strcmp(funcName, "vkCmdPipelineBarrier")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8507 | return (PFN_vkVoidFunction) vkCmdPipelineBarrier; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8508 | if (!strcmp(funcName, "vkCmdBeginQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8509 | return (PFN_vkVoidFunction) vkCmdBeginQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8510 | if (!strcmp(funcName, "vkCmdEndQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8511 | return (PFN_vkVoidFunction) vkCmdEndQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8512 | if (!strcmp(funcName, "vkCmdResetQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8513 | return (PFN_vkVoidFunction) vkCmdResetQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8514 | if (!strcmp(funcName, "vkCmdWriteTimestamp")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8515 | return (PFN_vkVoidFunction) vkCmdWriteTimestamp; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8516 | if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8517 | return (PFN_vkVoidFunction) vkCmdCopyQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8518 | if (!strcmp(funcName, "vkCreateFramebuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8519 | return (PFN_vkVoidFunction) vkCreateFramebuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8520 | if (!strcmp(funcName, "vkCreateRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8521 | return (PFN_vkVoidFunction) vkCreateRenderPass; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8522 | if (!strcmp(funcName, "vkCmdBeginRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8523 | return (PFN_vkVoidFunction) vkCmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8524 | if (!strcmp(funcName, "vkCmdNextSubpass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8525 | return (PFN_vkVoidFunction) vkCmdNextSubpass; |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 8526 | |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 8527 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8528 | if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8529 | return NULL; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8530 | return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8531 | } |
| 8532 | } |
| 8533 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8534 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetInstanceProcAddr(VkInstance instance, const char* funcName) |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8535 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8536 | if (instance == NULL) { |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8537 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8538 | } |
| 8539 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8540 | /* loader uses this to force layer initialization; instance object is wrapped */ |
| 8541 | if (!strcmp(funcName, "vkGetInstanceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8542 | initInstanceTable(pc_instance_table_map, (const VkBaseLayerObject *) instance); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8543 | return (PFN_vkVoidFunction) vkGetInstanceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8544 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8545 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8546 | if (!strcmp(funcName, "vkCreateInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8547 | return (PFN_vkVoidFunction) vkCreateInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8548 | if (!strcmp(funcName, "vkDestroyInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8549 | return (PFN_vkVoidFunction) vkDestroyInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8550 | if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8551 | return (PFN_vkVoidFunction) vkEnumeratePhysicalDevices; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8552 | if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8553 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8554 | if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8555 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 8556 | if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8557 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFormatProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8558 | if (!strcmp(funcName, "vkGetPhysicalDeviceLimits")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8559 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceLimits; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8560 | if (!strcmp(funcName, "vkGetGlobalLayerProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8561 | return (PFN_vkVoidFunction) vkGetGlobalLayerProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8562 | if (!strcmp(funcName, "vkGetGlobalExtensionProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8563 | return (PFN_vkVoidFunction) vkGetGlobalExtensionProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8564 | if (!strcmp(funcName, "vkGetPhysicalDeviceLayerProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8565 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceLayerProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8566 | if (!strcmp(funcName, "vkGetPhysicalDeviceExtensionProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8567 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 8568 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8569 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8570 | PFN_vkVoidFunction fptr = debug_report_get_instance_proc_addr(data->report_data, funcName); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8571 | if(fptr) |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 8572 | return fptr; |
| 8573 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8574 | { |
| 8575 | if (get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr == NULL) |
| 8576 | return NULL; |
| 8577 | return get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr(instance, funcName); |
| 8578 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8579 | } |