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); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 79 | return data->report_data; |
| 80 | } |
| 81 | |
| 82 | static void InitParamChecker(layer_data *data) |
| 83 | { |
| 84 | uint32_t report_flags = getLayerOptionFlags("ParamCheckerReportFlags", 0); |
| 85 | |
| 86 | uint32_t debug_action = 0; |
| 87 | getLayerOptionEnum("ParamCheckerDebugAction", (uint32_t *) &debug_action); |
| 88 | if(debug_action & VK_DBG_LAYER_ACTION_LOG_MSG) |
| 89 | { |
| 90 | FILE *log_output = NULL; |
| 91 | const char* option_str = getLayerOption("ParamCheckerLogFilename"); |
| 92 | if(option_str) |
| 93 | { |
| 94 | log_output = fopen(option_str, "w"); |
| 95 | } |
| 96 | if(log_output == NULL) |
| 97 | { |
| 98 | log_output = stdout; |
| 99 | } |
| 100 | |
| 101 | layer_create_msg_callback(data->report_data, report_flags, log_callback, (void*)log_output, &data->logging_callback); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | VK_LAYER_EXPORT VkResult VKAPI vkDbgCreateMsgCallback( |
| 106 | VkInstance instance, |
| 107 | VkFlags msgFlags, |
| 108 | const PFN_vkDbgMsgCallback pfnMsgCallback, |
| 109 | void* pUserData, |
| 110 | VkDbgMsgCallback* pMsgCallback) |
| 111 | { |
| 112 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 113 | VkResult result = pTable->DbgCreateMsgCallback(instance, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 114 | |
| 115 | if (result == VK_SUCCESS) |
| 116 | { |
| 117 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 118 | result = layer_create_msg_callback(data->report_data, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 119 | } |
| 120 | |
| 121 | return result; |
| 122 | } |
| 123 | |
| 124 | VK_LAYER_EXPORT VkResult VKAPI vkDbgDestroyMsgCallback( |
| 125 | VkInstance instance, |
| 126 | VkDbgMsgCallback msgCallback) |
| 127 | { |
| 128 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 129 | VkResult result = pTable->DbgDestroyMsgCallback(instance, msgCallback); |
| 130 | |
| 131 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 132 | layer_destroy_msg_callback(data->report_data, msgCallback); |
| 133 | |
| 134 | return result; |
| 135 | } |
| 136 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 137 | static const VkLayerProperties pc_global_layers[] = { |
| 138 | { |
| 139 | "ParamChecker", |
| 140 | VK_API_VERSION, |
| 141 | VK_MAKE_VERSION(0, 1, 0), |
| 142 | "Validation layer: ParamChecker", |
| 143 | } |
| 144 | }; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 145 | |
| 146 | VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 147 | const char *pLayerName, |
| 148 | uint32_t *pCount, |
| 149 | VkExtensionProperties* pProperties) |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 150 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 151 | /* ParamChecker does not have any global extensions */ |
| 152 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 153 | } |
| 154 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 155 | VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalLayerProperties( |
| 156 | uint32_t *pCount, |
| 157 | VkLayerProperties* pProperties) |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 158 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 159 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), |
| 160 | pc_global_layers, |
| 161 | pCount, pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 162 | } |
| 163 | |
| 164 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 165 | VkPhysicalDevice physicalDevice, |
| 166 | const char* pLayerName, |
| 167 | uint32_t* pCount, |
| 168 | VkExtensionProperties* pProperties) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 169 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 170 | /* ParamChecker does not have any physical device extensions */ |
| 171 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 172 | } |
| 173 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 174 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLayerProperties( |
| 175 | VkPhysicalDevice physicalDevice, |
| 176 | uint32_t* pCount, |
| 177 | VkLayerProperties* pProperties) |
| 178 | { |
| 179 | /* ParamChecker's physical device layers are the same as global */ |
| 180 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, |
| 181 | pCount, pProperties); |
| 182 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 183 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 184 | // Version: 0.138.2 |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 185 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 186 | static |
| 187 | std::string EnumeratorString(VkResult const& enumerator) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 188 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 189 | switch(enumerator) |
| 190 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 191 | case VK_RESULT_MAX_ENUM: |
| 192 | { |
| 193 | return "VK_RESULT_MAX_ENUM"; |
| 194 | break; |
| 195 | } |
| 196 | case VK_ERROR_INVALID_LAYER: |
| 197 | { |
| 198 | return "VK_ERROR_INVALID_LAYER"; |
| 199 | break; |
| 200 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 201 | case VK_ERROR_MEMORY_NOT_BOUND: |
| 202 | { |
| 203 | return "VK_ERROR_MEMORY_NOT_BOUND"; |
| 204 | break; |
| 205 | } |
| 206 | case VK_ERROR_BUILDING_COMMAND_BUFFER: |
| 207 | { |
| 208 | return "VK_ERROR_BUILDING_COMMAND_BUFFER"; |
| 209 | break; |
| 210 | } |
| 211 | case VK_ERROR_INCOMPATIBLE_DRIVER: |
| 212 | { |
| 213 | return "VK_ERROR_INCOMPATIBLE_DRIVER"; |
| 214 | break; |
| 215 | } |
| 216 | case VK_ERROR_MEMORY_UNMAP_FAILED: |
| 217 | { |
| 218 | return "VK_ERROR_MEMORY_UNMAP_FAILED"; |
| 219 | break; |
| 220 | } |
| 221 | case VK_ERROR_MEMORY_MAP_FAILED: |
| 222 | { |
| 223 | return "VK_ERROR_MEMORY_MAP_FAILED"; |
| 224 | break; |
| 225 | } |
| 226 | case VK_ERROR_BAD_PIPELINE_DATA: |
| 227 | { |
| 228 | return "VK_ERROR_BAD_PIPELINE_DATA"; |
| 229 | break; |
| 230 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 231 | case VK_ERROR_INVALID_QUEUE_TYPE: |
| 232 | { |
| 233 | return "VK_ERROR_INVALID_QUEUE_TYPE"; |
| 234 | break; |
| 235 | } |
| 236 | case VK_ERROR_BAD_SHADER_CODE: |
| 237 | { |
| 238 | return "VK_ERROR_BAD_SHADER_CODE"; |
| 239 | break; |
| 240 | } |
| 241 | case VK_ERROR_INVALID_IMAGE: |
| 242 | { |
| 243 | return "VK_ERROR_INVALID_IMAGE"; |
| 244 | break; |
| 245 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 246 | case VK_ERROR_INVALID_FORMAT: |
| 247 | { |
| 248 | return "VK_ERROR_INVALID_FORMAT"; |
| 249 | break; |
| 250 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 251 | case VK_ERROR_UNAVAILABLE: |
| 252 | { |
| 253 | return "VK_ERROR_UNAVAILABLE"; |
| 254 | break; |
| 255 | } |
| 256 | case VK_INCOMPLETE: |
| 257 | { |
| 258 | return "VK_INCOMPLETE"; |
| 259 | break; |
| 260 | } |
| 261 | case VK_ERROR_OUT_OF_HOST_MEMORY: |
| 262 | { |
| 263 | return "VK_ERROR_OUT_OF_HOST_MEMORY"; |
| 264 | break; |
| 265 | } |
| 266 | case VK_ERROR_UNKNOWN: |
| 267 | { |
| 268 | return "VK_ERROR_UNKNOWN"; |
| 269 | break; |
| 270 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 271 | case VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION: |
| 272 | { |
| 273 | return "VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION"; |
| 274 | break; |
| 275 | } |
| 276 | case VK_ERROR_INITIALIZATION_FAILED: |
| 277 | { |
| 278 | return "VK_ERROR_INITIALIZATION_FAILED"; |
| 279 | break; |
| 280 | } |
| 281 | case VK_NOT_READY: |
| 282 | { |
| 283 | return "VK_NOT_READY"; |
| 284 | break; |
| 285 | } |
| 286 | case VK_ERROR_INVALID_POINTER: |
| 287 | { |
| 288 | return "VK_ERROR_INVALID_POINTER"; |
| 289 | break; |
| 290 | } |
| 291 | case VK_ERROR_INVALID_VALUE: |
| 292 | { |
| 293 | return "VK_ERROR_INVALID_VALUE"; |
| 294 | break; |
| 295 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 296 | case VK_ERROR_NOT_MAPPABLE: |
| 297 | { |
| 298 | return "VK_ERROR_NOT_MAPPABLE"; |
| 299 | break; |
| 300 | } |
| 301 | case VK_ERROR_OUT_OF_DEVICE_MEMORY: |
| 302 | { |
| 303 | return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; |
| 304 | break; |
| 305 | } |
| 306 | case VK_EVENT_SET: |
| 307 | { |
| 308 | return "VK_EVENT_SET"; |
| 309 | break; |
| 310 | } |
| 311 | case VK_TIMEOUT: |
| 312 | { |
| 313 | return "VK_TIMEOUT"; |
| 314 | break; |
| 315 | } |
| 316 | case VK_ERROR_INVALID_FLAGS: |
| 317 | { |
| 318 | return "VK_ERROR_INVALID_FLAGS"; |
| 319 | break; |
| 320 | } |
| 321 | case VK_EVENT_RESET: |
| 322 | { |
| 323 | return "VK_EVENT_RESET"; |
| 324 | break; |
| 325 | } |
| 326 | case VK_ERROR_INVALID_DESCRIPTOR_SET_DATA: |
| 327 | { |
| 328 | return "VK_ERROR_INVALID_DESCRIPTOR_SET_DATA"; |
| 329 | break; |
| 330 | } |
| 331 | case VK_UNSUPPORTED: |
| 332 | { |
| 333 | return "VK_UNSUPPORTED"; |
| 334 | break; |
| 335 | } |
| 336 | case VK_ERROR_INVALID_HANDLE: |
| 337 | { |
| 338 | return "VK_ERROR_INVALID_HANDLE"; |
| 339 | break; |
| 340 | } |
| 341 | case VK_ERROR_INCOMPATIBLE_DEVICE: |
| 342 | { |
| 343 | return "VK_ERROR_INCOMPATIBLE_DEVICE"; |
| 344 | break; |
| 345 | } |
| 346 | case VK_SUCCESS: |
| 347 | { |
| 348 | return "VK_SUCCESS"; |
| 349 | break; |
| 350 | } |
| 351 | case VK_ERROR_INCOMPATIBLE_QUEUE: |
| 352 | { |
| 353 | return "VK_ERROR_INCOMPATIBLE_QUEUE"; |
| 354 | break; |
| 355 | } |
| 356 | case VK_ERROR_INVALID_EXTENSION: |
| 357 | { |
| 358 | return "VK_ERROR_INVALID_EXTENSION"; |
| 359 | break; |
| 360 | } |
| 361 | case VK_ERROR_DEVICE_ALREADY_CREATED: |
| 362 | { |
| 363 | return "VK_ERROR_DEVICE_ALREADY_CREATED"; |
| 364 | break; |
| 365 | } |
| 366 | case VK_ERROR_DEVICE_LOST: |
| 367 | { |
| 368 | return "VK_ERROR_DEVICE_LOST"; |
| 369 | break; |
| 370 | } |
| 371 | case VK_ERROR_INVALID_ORDINAL: |
| 372 | { |
| 373 | return "VK_ERROR_INVALID_ORDINAL"; |
| 374 | break; |
| 375 | } |
| 376 | case VK_ERROR_INVALID_MEMORY_SIZE: |
| 377 | { |
| 378 | return "VK_ERROR_INVALID_MEMORY_SIZE"; |
| 379 | break; |
| 380 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 381 | case VK_ERROR_INCOMPLETE_COMMAND_BUFFER: |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 382 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 383 | return "VK_ERROR_INCOMPLETE_COMMAND_BUFFER"; |
| 384 | break; |
| 385 | } |
| 386 | case VK_ERROR_INVALID_ALIGNMENT: |
| 387 | { |
| 388 | return "VK_ERROR_INVALID_ALIGNMENT"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 389 | break; |
| 390 | } |
| 391 | default: |
| 392 | { |
| 393 | return "unrecognized enumerator"; |
| 394 | break; |
| 395 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 396 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 397 | } |
| 398 | |
| 399 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 400 | bool ValidateEnumerator(VkFormatFeatureFlagBits const& enumerator) |
| 401 | { |
| 402 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)(VK_FORMAT_FEATURE_CONVERSION_BIT | |
| 403 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | |
| 404 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 405 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | |
| 406 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 407 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | |
| 408 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | |
| 409 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 410 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | |
| 411 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
| 412 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT); |
| 413 | if(enumerator & (~allFlags)) |
| 414 | { |
| 415 | return false; |
| 416 | } |
| 417 | |
| 418 | return true; |
| 419 | } |
| 420 | |
| 421 | static |
| 422 | std::string EnumeratorString(VkFormatFeatureFlagBits const& enumerator) |
| 423 | { |
| 424 | if(!ValidateEnumerator(enumerator)) |
| 425 | { |
| 426 | return "unrecognized enumerator"; |
| 427 | } |
| 428 | |
| 429 | std::vector<std::string> strings; |
| 430 | if(enumerator & VK_FORMAT_FEATURE_CONVERSION_BIT) |
| 431 | { |
| 432 | strings.push_back("VK_FORMAT_FEATURE_CONVERSION_BIT"); |
| 433 | } |
| 434 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) |
| 435 | { |
| 436 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 437 | } |
| 438 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) |
| 439 | { |
| 440 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 441 | } |
| 442 | if(enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) |
| 443 | { |
| 444 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 445 | } |
| 446 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) |
| 447 | { |
| 448 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 449 | } |
| 450 | if(enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) |
| 451 | { |
| 452 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 453 | } |
| 454 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) |
| 455 | { |
| 456 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 457 | } |
| 458 | if(enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) |
| 459 | { |
| 460 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 461 | } |
| 462 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) |
| 463 | { |
| 464 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 465 | } |
| 466 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 467 | { |
| 468 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 469 | } |
| 470 | if(enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 471 | { |
| 472 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 473 | } |
| 474 | |
| 475 | std::string enumeratorString; |
| 476 | for(auto const& string : strings) |
| 477 | { |
| 478 | enumeratorString += string; |
| 479 | |
| 480 | if(string != strings.back()) |
| 481 | { |
| 482 | enumeratorString += '|'; |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | return enumeratorString; |
| 487 | } |
| 488 | |
| 489 | static |
| 490 | bool ValidateEnumerator(VkImageUsageFlagBits const& enumerator) |
| 491 | { |
| 492 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)(VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | |
| 493 | VK_IMAGE_USAGE_DEPTH_STENCIL_BIT | |
| 494 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 495 | VK_IMAGE_USAGE_STORAGE_BIT | |
| 496 | VK_IMAGE_USAGE_SAMPLED_BIT | |
| 497 | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT | |
| 498 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | |
| 499 | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT | |
| 500 | VK_IMAGE_USAGE_GENERAL); |
| 501 | if(enumerator & (~allFlags)) |
| 502 | { |
| 503 | return false; |
| 504 | } |
| 505 | |
| 506 | return true; |
| 507 | } |
| 508 | |
| 509 | static |
| 510 | std::string EnumeratorString(VkImageUsageFlagBits const& enumerator) |
| 511 | { |
| 512 | if(!ValidateEnumerator(enumerator)) |
| 513 | { |
| 514 | return "unrecognized enumerator"; |
| 515 | } |
| 516 | |
| 517 | std::vector<std::string> strings; |
| 518 | if(enumerator & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) |
| 519 | { |
| 520 | strings.push_back("VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT"); |
| 521 | } |
| 522 | if(enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_BIT) |
| 523 | { |
| 524 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_BIT"); |
| 525 | } |
| 526 | if(enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) |
| 527 | { |
| 528 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 529 | } |
| 530 | if(enumerator & VK_IMAGE_USAGE_STORAGE_BIT) |
| 531 | { |
| 532 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 533 | } |
| 534 | if(enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) |
| 535 | { |
| 536 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 537 | } |
| 538 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) |
| 539 | { |
| 540 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT"); |
| 541 | } |
| 542 | if(enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) |
| 543 | { |
| 544 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 545 | } |
| 546 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) |
| 547 | { |
| 548 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT"); |
| 549 | } |
| 550 | if(enumerator & VK_IMAGE_USAGE_GENERAL) |
| 551 | { |
| 552 | strings.push_back("VK_IMAGE_USAGE_GENERAL"); |
| 553 | } |
| 554 | |
| 555 | std::string enumeratorString; |
| 556 | for(auto const& string : strings) |
| 557 | { |
| 558 | enumeratorString += string; |
| 559 | |
| 560 | if(string != strings.back()) |
| 561 | { |
| 562 | enumeratorString += '|'; |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | return enumeratorString; |
| 567 | } |
| 568 | |
| 569 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 570 | bool ValidateEnumerator(VkQueueFlagBits const& enumerator) |
| 571 | { |
| 572 | VkQueueFlagBits allFlags = (VkQueueFlagBits)(VK_QUEUE_EXTENDED_BIT | |
| 573 | VK_QUEUE_DMA_BIT | |
| 574 | VK_QUEUE_COMPUTE_BIT | |
| 575 | VK_QUEUE_SPARSE_MEMMGR_BIT | |
| 576 | VK_QUEUE_GRAPHICS_BIT); |
| 577 | if(enumerator & (~allFlags)) |
| 578 | { |
| 579 | return false; |
| 580 | } |
| 581 | |
| 582 | return true; |
| 583 | } |
| 584 | |
| 585 | static |
| 586 | std::string EnumeratorString(VkQueueFlagBits const& enumerator) |
| 587 | { |
| 588 | if(!ValidateEnumerator(enumerator)) |
| 589 | { |
| 590 | return "unrecognized enumerator"; |
| 591 | } |
| 592 | |
| 593 | std::vector<std::string> strings; |
| 594 | if(enumerator & VK_QUEUE_EXTENDED_BIT) |
| 595 | { |
| 596 | strings.push_back("VK_QUEUE_EXTENDED_BIT"); |
| 597 | } |
| 598 | if(enumerator & VK_QUEUE_DMA_BIT) |
| 599 | { |
| 600 | strings.push_back("VK_QUEUE_DMA_BIT"); |
| 601 | } |
| 602 | if(enumerator & VK_QUEUE_COMPUTE_BIT) |
| 603 | { |
| 604 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 605 | } |
| 606 | if(enumerator & VK_QUEUE_SPARSE_MEMMGR_BIT) |
| 607 | { |
| 608 | strings.push_back("VK_QUEUE_SPARSE_MEMMGR_BIT"); |
| 609 | } |
| 610 | if(enumerator & VK_QUEUE_GRAPHICS_BIT) |
| 611 | { |
| 612 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 613 | } |
| 614 | |
| 615 | std::string enumeratorString; |
| 616 | for(auto const& string : strings) |
| 617 | { |
| 618 | enumeratorString += string; |
| 619 | |
| 620 | if(string != strings.back()) |
| 621 | { |
| 622 | enumeratorString += '|'; |
| 623 | } |
| 624 | } |
| 625 | |
| 626 | return enumeratorString; |
| 627 | } |
| 628 | |
| 629 | static |
| 630 | bool ValidateEnumerator(VkMemoryPropertyFlagBits const& enumerator) |
| 631 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 632 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)(VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT | |
| 633 | VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 634 | VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT | |
| 635 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 636 | VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT | |
| 637 | VK_MEMORY_PROPERTY_DEVICE_ONLY); |
| 638 | if(enumerator & (~allFlags)) |
| 639 | { |
| 640 | return false; |
| 641 | } |
| 642 | |
| 643 | return true; |
| 644 | } |
| 645 | |
| 646 | static |
| 647 | std::string EnumeratorString(VkMemoryPropertyFlagBits const& enumerator) |
| 648 | { |
| 649 | if(!ValidateEnumerator(enumerator)) |
| 650 | { |
| 651 | return "unrecognized enumerator"; |
| 652 | } |
| 653 | |
| 654 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 655 | if(enumerator & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) |
| 656 | { |
| 657 | strings.push_back("VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT"); |
| 658 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 659 | if(enumerator & VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT) |
| 660 | { |
| 661 | strings.push_back("VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT"); |
| 662 | } |
| 663 | if(enumerator & VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT) |
| 664 | { |
| 665 | strings.push_back("VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT"); |
| 666 | } |
| 667 | if(enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) |
| 668 | { |
| 669 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 670 | } |
| 671 | if(enumerator & VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT) |
| 672 | { |
| 673 | strings.push_back("VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT"); |
| 674 | } |
| 675 | if(enumerator & VK_MEMORY_PROPERTY_DEVICE_ONLY) |
| 676 | { |
| 677 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_ONLY"); |
| 678 | } |
| 679 | |
| 680 | std::string enumeratorString; |
| 681 | for(auto const& string : strings) |
| 682 | { |
| 683 | enumeratorString += string; |
| 684 | |
| 685 | if(string != strings.back()) |
| 686 | { |
| 687 | enumeratorString += '|'; |
| 688 | } |
| 689 | } |
| 690 | |
| 691 | return enumeratorString; |
| 692 | } |
| 693 | |
| 694 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 695 | bool ValidateEnumerator(VkMemoryHeapFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 696 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 697 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_HOST_LOCAL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 698 | if(enumerator & (~allFlags)) |
| 699 | { |
| 700 | return false; |
| 701 | } |
| 702 | |
| 703 | return true; |
| 704 | } |
| 705 | |
| 706 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 707 | std::string EnumeratorString(VkMemoryHeapFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 708 | { |
| 709 | if(!ValidateEnumerator(enumerator)) |
| 710 | { |
| 711 | return "unrecognized enumerator"; |
| 712 | } |
| 713 | |
| 714 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 715 | if(enumerator & VK_MEMORY_HEAP_HOST_LOCAL) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 716 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 717 | strings.push_back("VK_MEMORY_HEAP_HOST_LOCAL"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 718 | } |
| 719 | |
| 720 | std::string enumeratorString; |
| 721 | for(auto const& string : strings) |
| 722 | { |
| 723 | enumeratorString += string; |
| 724 | |
| 725 | if(string != strings.back()) |
| 726 | { |
| 727 | enumeratorString += '|'; |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | return enumeratorString; |
| 732 | } |
| 733 | |
| 734 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 735 | bool ValidateEnumerator(VkDeviceCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 736 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 737 | VkDeviceCreateFlagBits allFlags = (VkDeviceCreateFlagBits)(VK_DEVICE_CREATE_VALIDATION_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 738 | if(enumerator & (~allFlags)) |
| 739 | { |
| 740 | return false; |
| 741 | } |
| 742 | |
| 743 | return true; |
| 744 | } |
| 745 | |
| 746 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 747 | std::string EnumeratorString(VkDeviceCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 748 | { |
| 749 | if(!ValidateEnumerator(enumerator)) |
| 750 | { |
| 751 | return "unrecognized enumerator"; |
| 752 | } |
| 753 | |
| 754 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 755 | if(enumerator & VK_DEVICE_CREATE_VALIDATION_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 756 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 757 | strings.push_back("VK_DEVICE_CREATE_VALIDATION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 758 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 759 | |
| 760 | std::string enumeratorString; |
| 761 | for(auto const& string : strings) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 762 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 763 | enumeratorString += string; |
| 764 | |
| 765 | if(string != strings.back()) |
| 766 | { |
| 767 | enumeratorString += '|'; |
| 768 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 769 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 770 | |
| 771 | return enumeratorString; |
| 772 | } |
| 773 | |
| 774 | static |
| 775 | bool ValidateEnumerator(VkSparseImageFormatFlagBits const& enumerator) |
| 776 | { |
| 777 | VkSparseImageFormatFlagBits allFlags = (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT | |
| 778 | VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT | |
| 779 | VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT); |
| 780 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 781 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 782 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 783 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 784 | |
| 785 | return true; |
| 786 | } |
| 787 | |
| 788 | static |
| 789 | std::string EnumeratorString(VkSparseImageFormatFlagBits const& enumerator) |
| 790 | { |
| 791 | if(!ValidateEnumerator(enumerator)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 792 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 793 | return "unrecognized enumerator"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 794 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 795 | |
| 796 | std::vector<std::string> strings; |
| 797 | if(enumerator & VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 798 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 799 | strings.push_back("VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 800 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 801 | if(enumerator & VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 802 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 803 | strings.push_back("VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 804 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 805 | if(enumerator & VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 806 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 807 | strings.push_back("VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 808 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 809 | |
| 810 | std::string enumeratorString; |
| 811 | for(auto const& string : strings) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 812 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 813 | enumeratorString += string; |
| 814 | |
| 815 | if(string != strings.back()) |
| 816 | { |
| 817 | enumeratorString += '|'; |
| 818 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 819 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 820 | |
| 821 | return enumeratorString; |
| 822 | } |
| 823 | |
| 824 | static |
| 825 | bool ValidateEnumerator(VkSparseMemoryBindFlagBits const& enumerator) |
| 826 | { |
| 827 | VkSparseMemoryBindFlagBits allFlags = (VkSparseMemoryBindFlagBits)(VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT); |
| 828 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 829 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 830 | return false; |
| 831 | } |
| 832 | |
| 833 | return true; |
| 834 | } |
| 835 | |
| 836 | static |
| 837 | std::string EnumeratorString(VkSparseMemoryBindFlagBits const& enumerator) |
| 838 | { |
| 839 | if(!ValidateEnumerator(enumerator)) |
| 840 | { |
| 841 | return "unrecognized enumerator"; |
| 842 | } |
| 843 | |
| 844 | std::vector<std::string> strings; |
| 845 | if(enumerator & VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT) |
| 846 | { |
| 847 | strings.push_back("VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT"); |
| 848 | } |
| 849 | |
| 850 | std::string enumeratorString; |
| 851 | for(auto const& string : strings) |
| 852 | { |
| 853 | enumeratorString += string; |
| 854 | |
| 855 | if(string != strings.back()) |
| 856 | { |
| 857 | enumeratorString += '|'; |
| 858 | } |
| 859 | } |
| 860 | |
| 861 | return enumeratorString; |
| 862 | } |
| 863 | |
| 864 | static |
| 865 | bool ValidateEnumerator(VkFenceCreateFlagBits const& enumerator) |
| 866 | { |
| 867 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
| 868 | if(enumerator & (~allFlags)) |
| 869 | { |
| 870 | return false; |
| 871 | } |
| 872 | |
| 873 | return true; |
| 874 | } |
| 875 | |
| 876 | static |
| 877 | std::string EnumeratorString(VkFenceCreateFlagBits const& enumerator) |
| 878 | { |
| 879 | if(!ValidateEnumerator(enumerator)) |
| 880 | { |
| 881 | return "unrecognized enumerator"; |
| 882 | } |
| 883 | |
| 884 | std::vector<std::string> strings; |
| 885 | if(enumerator & VK_FENCE_CREATE_SIGNALED_BIT) |
| 886 | { |
| 887 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 888 | } |
| 889 | |
| 890 | std::string enumeratorString; |
| 891 | for(auto const& string : strings) |
| 892 | { |
| 893 | enumeratorString += string; |
| 894 | |
| 895 | if(string != strings.back()) |
| 896 | { |
| 897 | enumeratorString += '|'; |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | return enumeratorString; |
| 902 | } |
| 903 | |
| 904 | static |
| 905 | bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 906 | { |
| 907 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)(VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT | |
| 908 | VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT | |
| 909 | VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT | |
| 910 | VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT | |
| 911 | VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT | |
| 912 | VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT | |
| 913 | VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT | |
| 914 | VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT | |
| 915 | VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT | |
| 916 | VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT | |
| 917 | VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT); |
| 918 | if(enumerator & (~allFlags)) |
| 919 | { |
| 920 | return false; |
| 921 | } |
| 922 | |
| 923 | return true; |
| 924 | } |
| 925 | |
| 926 | static |
| 927 | std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 928 | { |
| 929 | if(!ValidateEnumerator(enumerator)) |
| 930 | { |
| 931 | return "unrecognized enumerator"; |
| 932 | } |
| 933 | |
| 934 | std::vector<std::string> strings; |
| 935 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT) |
| 936 | { |
| 937 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT"); |
| 938 | } |
| 939 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT) |
| 940 | { |
| 941 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT"); |
| 942 | } |
| 943 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT) |
| 944 | { |
| 945 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT"); |
| 946 | } |
| 947 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT) |
| 948 | { |
| 949 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT"); |
| 950 | } |
| 951 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT) |
| 952 | { |
| 953 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT"); |
| 954 | } |
| 955 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT) |
| 956 | { |
| 957 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT"); |
| 958 | } |
| 959 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT) |
| 960 | { |
| 961 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT"); |
| 962 | } |
| 963 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT) |
| 964 | { |
| 965 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT"); |
| 966 | } |
| 967 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT) |
| 968 | { |
| 969 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT"); |
| 970 | } |
| 971 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT) |
| 972 | { |
| 973 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT"); |
| 974 | } |
| 975 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT) |
| 976 | { |
| 977 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT"); |
| 978 | } |
| 979 | |
| 980 | std::string enumeratorString; |
| 981 | for(auto const& string : strings) |
| 982 | { |
| 983 | enumeratorString += string; |
| 984 | |
| 985 | if(string != strings.back()) |
| 986 | { |
| 987 | enumeratorString += '|'; |
| 988 | } |
| 989 | } |
| 990 | |
| 991 | return enumeratorString; |
| 992 | } |
| 993 | |
| 994 | static |
| 995 | bool ValidateEnumerator(VkQueryResultFlagBits const& enumerator) |
| 996 | { |
| 997 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | |
| 998 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 999 | VK_QUERY_RESULT_WAIT_BIT | |
| 1000 | VK_QUERY_RESULT_64_BIT | |
| 1001 | VK_QUERY_RESULT_DEFAULT); |
| 1002 | if(enumerator & (~allFlags)) |
| 1003 | { |
| 1004 | return false; |
| 1005 | } |
| 1006 | |
| 1007 | return true; |
| 1008 | } |
| 1009 | |
| 1010 | static |
| 1011 | std::string EnumeratorString(VkQueryResultFlagBits const& enumerator) |
| 1012 | { |
| 1013 | if(!ValidateEnumerator(enumerator)) |
| 1014 | { |
| 1015 | return "unrecognized enumerator"; |
| 1016 | } |
| 1017 | |
| 1018 | std::vector<std::string> strings; |
| 1019 | if(enumerator & VK_QUERY_RESULT_PARTIAL_BIT) |
| 1020 | { |
| 1021 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 1022 | } |
| 1023 | if(enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) |
| 1024 | { |
| 1025 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 1026 | } |
| 1027 | if(enumerator & VK_QUERY_RESULT_WAIT_BIT) |
| 1028 | { |
| 1029 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 1030 | } |
| 1031 | if(enumerator & VK_QUERY_RESULT_64_BIT) |
| 1032 | { |
| 1033 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 1034 | } |
| 1035 | if(enumerator & VK_QUERY_RESULT_DEFAULT) |
| 1036 | { |
| 1037 | strings.push_back("VK_QUERY_RESULT_DEFAULT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1038 | } |
| 1039 | |
| 1040 | std::string enumeratorString; |
| 1041 | for(auto const& string : strings) |
| 1042 | { |
| 1043 | enumeratorString += string; |
| 1044 | |
| 1045 | if(string != strings.back()) |
| 1046 | { |
| 1047 | enumeratorString += '|'; |
| 1048 | } |
| 1049 | } |
| 1050 | |
| 1051 | return enumeratorString; |
| 1052 | } |
| 1053 | |
| 1054 | static |
| 1055 | bool ValidateEnumerator(VkBufferUsageFlagBits const& enumerator) |
| 1056 | { |
| 1057 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | |
| 1058 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | |
| 1059 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 1060 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | |
| 1061 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | |
| 1062 | VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT | |
| 1063 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | |
| 1064 | VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT | |
| 1065 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | |
| 1066 | VK_BUFFER_USAGE_GENERAL); |
| 1067 | if(enumerator & (~allFlags)) |
| 1068 | { |
| 1069 | return false; |
| 1070 | } |
| 1071 | |
| 1072 | return true; |
| 1073 | } |
| 1074 | |
| 1075 | static |
| 1076 | std::string EnumeratorString(VkBufferUsageFlagBits const& enumerator) |
| 1077 | { |
| 1078 | if(!ValidateEnumerator(enumerator)) |
| 1079 | { |
| 1080 | return "unrecognized enumerator"; |
| 1081 | } |
| 1082 | |
| 1083 | std::vector<std::string> strings; |
| 1084 | if(enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) |
| 1085 | { |
| 1086 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 1087 | } |
| 1088 | if(enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) |
| 1089 | { |
| 1090 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 1091 | } |
| 1092 | if(enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) |
| 1093 | { |
| 1094 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 1095 | } |
| 1096 | if(enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) |
| 1097 | { |
| 1098 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 1099 | } |
| 1100 | if(enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) |
| 1101 | { |
| 1102 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 1103 | } |
| 1104 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT) |
| 1105 | { |
| 1106 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT"); |
| 1107 | } |
| 1108 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) |
| 1109 | { |
| 1110 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 1111 | } |
| 1112 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT) |
| 1113 | { |
| 1114 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT"); |
| 1115 | } |
| 1116 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) |
| 1117 | { |
| 1118 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 1119 | } |
| 1120 | if(enumerator & VK_BUFFER_USAGE_GENERAL) |
| 1121 | { |
| 1122 | strings.push_back("VK_BUFFER_USAGE_GENERAL"); |
| 1123 | } |
| 1124 | |
| 1125 | std::string enumeratorString; |
| 1126 | for(auto const& string : strings) |
| 1127 | { |
| 1128 | enumeratorString += string; |
| 1129 | |
| 1130 | if(string != strings.back()) |
| 1131 | { |
| 1132 | enumeratorString += '|'; |
| 1133 | } |
| 1134 | } |
| 1135 | |
| 1136 | return enumeratorString; |
| 1137 | } |
| 1138 | |
| 1139 | static |
| 1140 | bool ValidateEnumerator(VkBufferCreateFlagBits const& enumerator) |
| 1141 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1142 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)(VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | |
| 1143 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | |
| 1144 | VK_BUFFER_CREATE_SPARSE_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1145 | if(enumerator & (~allFlags)) |
| 1146 | { |
| 1147 | return false; |
| 1148 | } |
| 1149 | |
| 1150 | return true; |
| 1151 | } |
| 1152 | |
| 1153 | static |
| 1154 | std::string EnumeratorString(VkBufferCreateFlagBits const& enumerator) |
| 1155 | { |
| 1156 | if(!ValidateEnumerator(enumerator)) |
| 1157 | { |
| 1158 | return "unrecognized enumerator"; |
| 1159 | } |
| 1160 | |
| 1161 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1162 | if(enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) |
| 1163 | { |
| 1164 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 1165 | } |
| 1166 | if(enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) |
| 1167 | { |
| 1168 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 1169 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1170 | if(enumerator & VK_BUFFER_CREATE_SPARSE_BIT) |
| 1171 | { |
| 1172 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BIT"); |
| 1173 | } |
| 1174 | |
| 1175 | std::string enumeratorString; |
| 1176 | for(auto const& string : strings) |
| 1177 | { |
| 1178 | enumeratorString += string; |
| 1179 | |
| 1180 | if(string != strings.back()) |
| 1181 | { |
| 1182 | enumeratorString += '|'; |
| 1183 | } |
| 1184 | } |
| 1185 | |
| 1186 | return enumeratorString; |
| 1187 | } |
| 1188 | |
| 1189 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1190 | bool ValidateEnumerator(VkImageCreateFlagBits const& enumerator) |
| 1191 | { |
| 1192 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)(VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1193 | VK_IMAGE_CREATE_INVARIANT_DATA_BIT | |
| 1194 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | |
| 1195 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1196 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1197 | VK_IMAGE_CREATE_SPARSE_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1198 | if(enumerator & (~allFlags)) |
| 1199 | { |
| 1200 | return false; |
| 1201 | } |
| 1202 | |
| 1203 | return true; |
| 1204 | } |
| 1205 | |
| 1206 | static |
| 1207 | std::string EnumeratorString(VkImageCreateFlagBits const& enumerator) |
| 1208 | { |
| 1209 | if(!ValidateEnumerator(enumerator)) |
| 1210 | { |
| 1211 | return "unrecognized enumerator"; |
| 1212 | } |
| 1213 | |
| 1214 | std::vector<std::string> strings; |
| 1215 | if(enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) |
| 1216 | { |
| 1217 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 1218 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1219 | if(enumerator & VK_IMAGE_CREATE_INVARIANT_DATA_BIT) |
| 1220 | { |
| 1221 | strings.push_back("VK_IMAGE_CREATE_INVARIANT_DATA_BIT"); |
| 1222 | } |
| 1223 | if(enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) |
| 1224 | { |
| 1225 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 1226 | } |
| 1227 | if(enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) |
| 1228 | { |
| 1229 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 1230 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1231 | if(enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) |
| 1232 | { |
| 1233 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 1234 | } |
| 1235 | if(enumerator & VK_IMAGE_CREATE_SPARSE_BIT) |
| 1236 | { |
| 1237 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BIT"); |
| 1238 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1239 | |
| 1240 | std::string enumeratorString; |
| 1241 | for(auto const& string : strings) |
| 1242 | { |
| 1243 | enumeratorString += string; |
| 1244 | |
| 1245 | if(string != strings.back()) |
| 1246 | { |
| 1247 | enumeratorString += '|'; |
| 1248 | } |
| 1249 | } |
| 1250 | |
| 1251 | return enumeratorString; |
| 1252 | } |
| 1253 | |
| 1254 | static |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1255 | bool ValidateEnumerator(VkAttachmentViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1256 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1257 | VkAttachmentViewCreateFlagBits allFlags = (VkAttachmentViewCreateFlagBits)(VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT | |
| 1258 | VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1259 | if(enumerator & (~allFlags)) |
| 1260 | { |
| 1261 | return false; |
| 1262 | } |
| 1263 | |
| 1264 | return true; |
| 1265 | } |
| 1266 | |
| 1267 | static |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1268 | std::string EnumeratorString(VkAttachmentViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1269 | { |
| 1270 | if(!ValidateEnumerator(enumerator)) |
| 1271 | { |
| 1272 | return "unrecognized enumerator"; |
| 1273 | } |
| 1274 | |
| 1275 | std::vector<std::string> strings; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1276 | if(enumerator & VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1277 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1278 | strings.push_back("VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1279 | } |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1280 | if(enumerator & VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1281 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 1282 | strings.push_back("VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1283 | } |
| 1284 | |
| 1285 | std::string enumeratorString; |
| 1286 | for(auto const& string : strings) |
| 1287 | { |
| 1288 | enumeratorString += string; |
| 1289 | |
| 1290 | if(string != strings.back()) |
| 1291 | { |
| 1292 | enumeratorString += '|'; |
| 1293 | } |
| 1294 | } |
| 1295 | |
| 1296 | return enumeratorString; |
| 1297 | } |
| 1298 | |
| 1299 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1300 | bool ValidateEnumerator(VkChannelFlagBits const& enumerator) |
| 1301 | { |
| 1302 | VkChannelFlagBits allFlags = (VkChannelFlagBits)(VK_CHANNEL_A_BIT | |
| 1303 | VK_CHANNEL_B_BIT | |
| 1304 | VK_CHANNEL_G_BIT | |
| 1305 | VK_CHANNEL_R_BIT); |
| 1306 | if(enumerator & (~allFlags)) |
| 1307 | { |
| 1308 | return false; |
| 1309 | } |
| 1310 | |
| 1311 | return true; |
| 1312 | } |
| 1313 | |
| 1314 | static |
| 1315 | std::string EnumeratorString(VkChannelFlagBits const& enumerator) |
| 1316 | { |
| 1317 | if(!ValidateEnumerator(enumerator)) |
| 1318 | { |
| 1319 | return "unrecognized enumerator"; |
| 1320 | } |
| 1321 | |
| 1322 | std::vector<std::string> strings; |
| 1323 | if(enumerator & VK_CHANNEL_A_BIT) |
| 1324 | { |
| 1325 | strings.push_back("VK_CHANNEL_A_BIT"); |
| 1326 | } |
| 1327 | if(enumerator & VK_CHANNEL_B_BIT) |
| 1328 | { |
| 1329 | strings.push_back("VK_CHANNEL_B_BIT"); |
| 1330 | } |
| 1331 | if(enumerator & VK_CHANNEL_G_BIT) |
| 1332 | { |
| 1333 | strings.push_back("VK_CHANNEL_G_BIT"); |
| 1334 | } |
| 1335 | if(enumerator & VK_CHANNEL_R_BIT) |
| 1336 | { |
| 1337 | strings.push_back("VK_CHANNEL_R_BIT"); |
| 1338 | } |
| 1339 | |
| 1340 | std::string enumeratorString; |
| 1341 | for(auto const& string : strings) |
| 1342 | { |
| 1343 | enumeratorString += string; |
| 1344 | |
| 1345 | if(string != strings.back()) |
| 1346 | { |
| 1347 | enumeratorString += '|'; |
| 1348 | } |
| 1349 | } |
| 1350 | |
| 1351 | return enumeratorString; |
| 1352 | } |
| 1353 | |
| 1354 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1355 | bool ValidateEnumerator(VkPipelineCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1356 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1357 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)(VK_PIPELINE_CREATE_DERIVATIVE_BIT | |
| 1358 | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | |
| 1359 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1360 | if(enumerator & (~allFlags)) |
| 1361 | { |
| 1362 | return false; |
| 1363 | } |
| 1364 | |
| 1365 | return true; |
| 1366 | } |
| 1367 | |
| 1368 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1369 | std::string EnumeratorString(VkPipelineCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1370 | { |
| 1371 | if(!ValidateEnumerator(enumerator)) |
| 1372 | { |
| 1373 | return "unrecognized enumerator"; |
| 1374 | } |
| 1375 | |
| 1376 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1377 | if(enumerator & VK_PIPELINE_CREATE_DERIVATIVE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1378 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1379 | strings.push_back("VK_PIPELINE_CREATE_DERIVATIVE_BIT"); |
| 1380 | } |
| 1381 | if(enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) |
| 1382 | { |
| 1383 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 1384 | } |
| 1385 | if(enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) |
| 1386 | { |
| 1387 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1388 | } |
| 1389 | |
| 1390 | std::string enumeratorString; |
| 1391 | for(auto const& string : strings) |
| 1392 | { |
| 1393 | enumeratorString += string; |
| 1394 | |
| 1395 | if(string != strings.back()) |
| 1396 | { |
| 1397 | enumeratorString += '|'; |
| 1398 | } |
| 1399 | } |
| 1400 | |
| 1401 | return enumeratorString; |
| 1402 | } |
| 1403 | |
| 1404 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1405 | bool ValidateEnumerator(VkShaderStageFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1406 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1407 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)(VK_SHADER_STAGE_ALL | |
| 1408 | VK_SHADER_STAGE_FRAGMENT_BIT | |
| 1409 | VK_SHADER_STAGE_GEOMETRY_BIT | |
| 1410 | VK_SHADER_STAGE_COMPUTE_BIT | |
| 1411 | VK_SHADER_STAGE_TESS_EVALUATION_BIT | |
| 1412 | VK_SHADER_STAGE_TESS_CONTROL_BIT | |
| 1413 | VK_SHADER_STAGE_VERTEX_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1414 | if(enumerator & (~allFlags)) |
| 1415 | { |
| 1416 | return false; |
| 1417 | } |
| 1418 | |
| 1419 | return true; |
| 1420 | } |
| 1421 | |
| 1422 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1423 | std::string EnumeratorString(VkShaderStageFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1424 | { |
| 1425 | if(!ValidateEnumerator(enumerator)) |
| 1426 | { |
| 1427 | return "unrecognized enumerator"; |
| 1428 | } |
| 1429 | |
| 1430 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1431 | if(enumerator & VK_SHADER_STAGE_ALL) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1432 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1433 | strings.push_back("VK_SHADER_STAGE_ALL"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1434 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1435 | if(enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1436 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1437 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1438 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1439 | if(enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1440 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1441 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 1442 | } |
| 1443 | if(enumerator & VK_SHADER_STAGE_COMPUTE_BIT) |
| 1444 | { |
| 1445 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 1446 | } |
| 1447 | if(enumerator & VK_SHADER_STAGE_TESS_EVALUATION_BIT) |
| 1448 | { |
| 1449 | strings.push_back("VK_SHADER_STAGE_TESS_EVALUATION_BIT"); |
| 1450 | } |
| 1451 | if(enumerator & VK_SHADER_STAGE_TESS_CONTROL_BIT) |
| 1452 | { |
| 1453 | strings.push_back("VK_SHADER_STAGE_TESS_CONTROL_BIT"); |
| 1454 | } |
| 1455 | if(enumerator & VK_SHADER_STAGE_VERTEX_BIT) |
| 1456 | { |
| 1457 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1458 | } |
| 1459 | |
| 1460 | std::string enumeratorString; |
| 1461 | for(auto const& string : strings) |
| 1462 | { |
| 1463 | enumeratorString += string; |
| 1464 | |
| 1465 | if(string != strings.back()) |
| 1466 | { |
| 1467 | enumeratorString += '|'; |
| 1468 | } |
| 1469 | } |
| 1470 | |
| 1471 | return enumeratorString; |
| 1472 | } |
| 1473 | |
| 1474 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1475 | bool ValidateEnumerator(VkSubpassDescriptionFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1476 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1477 | VkSubpassDescriptionFlagBits allFlags = (VkSubpassDescriptionFlagBits)(VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1478 | if(enumerator & (~allFlags)) |
| 1479 | { |
| 1480 | return false; |
| 1481 | } |
| 1482 | |
| 1483 | return true; |
| 1484 | } |
| 1485 | |
| 1486 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1487 | std::string EnumeratorString(VkSubpassDescriptionFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1488 | { |
| 1489 | if(!ValidateEnumerator(enumerator)) |
| 1490 | { |
| 1491 | return "unrecognized enumerator"; |
| 1492 | } |
| 1493 | |
| 1494 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1495 | if(enumerator & VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1496 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1497 | strings.push_back("VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1498 | } |
| 1499 | |
| 1500 | std::string enumeratorString; |
| 1501 | for(auto const& string : strings) |
| 1502 | { |
| 1503 | enumeratorString += string; |
| 1504 | |
| 1505 | if(string != strings.back()) |
| 1506 | { |
| 1507 | enumeratorString += '|'; |
| 1508 | } |
| 1509 | } |
| 1510 | |
| 1511 | return enumeratorString; |
| 1512 | } |
| 1513 | |
| 1514 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1515 | bool ValidateEnumerator(VkPipelineStageFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1516 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1517 | VkPipelineStageFlagBits allFlags = (VkPipelineStageFlagBits)(VK_PIPELINE_STAGE_ALL_GRAPHICS | |
| 1518 | VK_PIPELINE_STAGE_HOST_BIT | |
| 1519 | VK_PIPELINE_STAGE_TRANSFER_BIT | |
| 1520 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | |
| 1521 | VK_PIPELINE_STAGE_ALL_GPU_COMMANDS | |
| 1522 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT | |
| 1523 | VK_PIPELINE_STAGE_TRANSITION_BIT | |
| 1524 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | |
| 1525 | VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT | |
| 1526 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | |
| 1527 | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT | |
| 1528 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | |
| 1529 | VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT | |
| 1530 | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | |
| 1531 | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | |
| 1532 | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | |
| 1533 | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1534 | if(enumerator & (~allFlags)) |
| 1535 | { |
| 1536 | return false; |
| 1537 | } |
| 1538 | |
| 1539 | return true; |
| 1540 | } |
| 1541 | |
| 1542 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1543 | std::string EnumeratorString(VkPipelineStageFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1544 | { |
| 1545 | if(!ValidateEnumerator(enumerator)) |
| 1546 | { |
| 1547 | return "unrecognized enumerator"; |
| 1548 | } |
| 1549 | |
| 1550 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1551 | if(enumerator & VK_PIPELINE_STAGE_ALL_GRAPHICS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1552 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1553 | strings.push_back("VK_PIPELINE_STAGE_ALL_GRAPHICS"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1554 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1555 | if(enumerator & VK_PIPELINE_STAGE_HOST_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1556 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1557 | strings.push_back("VK_PIPELINE_STAGE_HOST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1558 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1559 | if(enumerator & VK_PIPELINE_STAGE_TRANSFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1560 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1561 | strings.push_back("VK_PIPELINE_STAGE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1562 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1563 | if(enumerator & VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1564 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1565 | strings.push_back("VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1566 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1567 | if(enumerator & VK_PIPELINE_STAGE_ALL_GPU_COMMANDS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1568 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1569 | strings.push_back("VK_PIPELINE_STAGE_ALL_GPU_COMMANDS"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1570 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1571 | if(enumerator & VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1572 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1573 | strings.push_back("VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1574 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1575 | if(enumerator & VK_PIPELINE_STAGE_TRANSITION_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1576 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1577 | strings.push_back("VK_PIPELINE_STAGE_TRANSITION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1578 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1579 | if(enumerator & VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1580 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1581 | strings.push_back("VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1582 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1583 | if(enumerator & VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1584 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1585 | strings.push_back("VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1586 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1587 | if(enumerator & VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1588 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1589 | strings.push_back("VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1590 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1591 | if(enumerator & VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1592 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1593 | strings.push_back("VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT"); |
| 1594 | } |
| 1595 | if(enumerator & VK_PIPELINE_STAGE_VERTEX_SHADER_BIT) |
| 1596 | { |
| 1597 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_SHADER_BIT"); |
| 1598 | } |
| 1599 | if(enumerator & VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT) |
| 1600 | { |
| 1601 | strings.push_back("VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT"); |
| 1602 | } |
| 1603 | if(enumerator & VK_PIPELINE_STAGE_VERTEX_INPUT_BIT) |
| 1604 | { |
| 1605 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_INPUT_BIT"); |
| 1606 | } |
| 1607 | if(enumerator & VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT) |
| 1608 | { |
| 1609 | strings.push_back("VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT"); |
| 1610 | } |
| 1611 | if(enumerator & VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT) |
| 1612 | { |
| 1613 | strings.push_back("VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT"); |
| 1614 | } |
| 1615 | if(enumerator & VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) |
| 1616 | { |
| 1617 | strings.push_back("VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1618 | } |
| 1619 | |
| 1620 | std::string enumeratorString; |
| 1621 | for(auto const& string : strings) |
| 1622 | { |
| 1623 | enumeratorString += string; |
| 1624 | |
| 1625 | if(string != strings.back()) |
| 1626 | { |
| 1627 | enumeratorString += '|'; |
| 1628 | } |
| 1629 | } |
| 1630 | |
| 1631 | return enumeratorString; |
| 1632 | } |
| 1633 | |
| 1634 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1635 | bool ValidateEnumerator(VkMemoryOutputFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1636 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1637 | VkMemoryOutputFlagBits allFlags = (VkMemoryOutputFlagBits)(VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 1638 | VK_MEMORY_OUTPUT_TRANSFER_BIT | |
| 1639 | VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT | |
| 1640 | VK_MEMORY_OUTPUT_SHADER_WRITE_BIT | |
| 1641 | VK_MEMORY_OUTPUT_HOST_WRITE_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1642 | if(enumerator & (~allFlags)) |
| 1643 | { |
| 1644 | return false; |
| 1645 | } |
| 1646 | |
| 1647 | return true; |
| 1648 | } |
| 1649 | |
| 1650 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1651 | std::string EnumeratorString(VkMemoryOutputFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1652 | { |
| 1653 | if(!ValidateEnumerator(enumerator)) |
| 1654 | { |
| 1655 | return "unrecognized enumerator"; |
| 1656 | } |
| 1657 | |
| 1658 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1659 | if(enumerator & VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1660 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1661 | strings.push_back("VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1662 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1663 | if(enumerator & VK_MEMORY_OUTPUT_TRANSFER_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1664 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1665 | strings.push_back("VK_MEMORY_OUTPUT_TRANSFER_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1666 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1667 | if(enumerator & VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1668 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1669 | strings.push_back("VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT"); |
| 1670 | } |
| 1671 | if(enumerator & VK_MEMORY_OUTPUT_SHADER_WRITE_BIT) |
| 1672 | { |
| 1673 | strings.push_back("VK_MEMORY_OUTPUT_SHADER_WRITE_BIT"); |
| 1674 | } |
| 1675 | if(enumerator & VK_MEMORY_OUTPUT_HOST_WRITE_BIT) |
| 1676 | { |
| 1677 | strings.push_back("VK_MEMORY_OUTPUT_HOST_WRITE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1678 | } |
| 1679 | |
| 1680 | std::string enumeratorString; |
| 1681 | for(auto const& string : strings) |
| 1682 | { |
| 1683 | enumeratorString += string; |
| 1684 | |
| 1685 | if(string != strings.back()) |
| 1686 | { |
| 1687 | enumeratorString += '|'; |
| 1688 | } |
| 1689 | } |
| 1690 | |
| 1691 | return enumeratorString; |
| 1692 | } |
| 1693 | |
| 1694 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1695 | bool ValidateEnumerator(VkMemoryInputFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1696 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1697 | VkMemoryInputFlagBits allFlags = (VkMemoryInputFlagBits)(VK_MEMORY_INPUT_TRANSFER_BIT | |
| 1698 | VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 1699 | VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT | |
| 1700 | VK_MEMORY_INPUT_SHADER_READ_BIT | |
| 1701 | VK_MEMORY_INPUT_UNIFORM_READ_BIT | |
| 1702 | VK_MEMORY_INPUT_INDEX_FETCH_BIT | |
| 1703 | VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT | |
| 1704 | VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT | |
| 1705 | VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT | |
| 1706 | VK_MEMORY_INPUT_HOST_READ_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1707 | if(enumerator & (~allFlags)) |
| 1708 | { |
| 1709 | return false; |
| 1710 | } |
| 1711 | |
| 1712 | return true; |
| 1713 | } |
| 1714 | |
| 1715 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1716 | std::string EnumeratorString(VkMemoryInputFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1717 | { |
| 1718 | if(!ValidateEnumerator(enumerator)) |
| 1719 | { |
| 1720 | return "unrecognized enumerator"; |
| 1721 | } |
| 1722 | |
| 1723 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1724 | if(enumerator & VK_MEMORY_INPUT_TRANSFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1725 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1726 | strings.push_back("VK_MEMORY_INPUT_TRANSFER_BIT"); |
| 1727 | } |
| 1728 | if(enumerator & VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 1729 | { |
| 1730 | strings.push_back("VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 1731 | } |
| 1732 | if(enumerator & VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT) |
| 1733 | { |
| 1734 | strings.push_back("VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT"); |
| 1735 | } |
| 1736 | if(enumerator & VK_MEMORY_INPUT_SHADER_READ_BIT) |
| 1737 | { |
| 1738 | strings.push_back("VK_MEMORY_INPUT_SHADER_READ_BIT"); |
| 1739 | } |
| 1740 | if(enumerator & VK_MEMORY_INPUT_UNIFORM_READ_BIT) |
| 1741 | { |
| 1742 | strings.push_back("VK_MEMORY_INPUT_UNIFORM_READ_BIT"); |
| 1743 | } |
| 1744 | if(enumerator & VK_MEMORY_INPUT_INDEX_FETCH_BIT) |
| 1745 | { |
| 1746 | strings.push_back("VK_MEMORY_INPUT_INDEX_FETCH_BIT"); |
| 1747 | } |
| 1748 | if(enumerator & VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT) |
| 1749 | { |
| 1750 | strings.push_back("VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT"); |
| 1751 | } |
| 1752 | if(enumerator & VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT) |
| 1753 | { |
| 1754 | strings.push_back("VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT"); |
| 1755 | } |
| 1756 | if(enumerator & VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT) |
| 1757 | { |
| 1758 | strings.push_back("VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT"); |
| 1759 | } |
| 1760 | if(enumerator & VK_MEMORY_INPUT_HOST_READ_BIT) |
| 1761 | { |
| 1762 | strings.push_back("VK_MEMORY_INPUT_HOST_READ_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1763 | } |
| 1764 | |
| 1765 | std::string enumeratorString; |
| 1766 | for(auto const& string : strings) |
| 1767 | { |
| 1768 | enumeratorString += string; |
| 1769 | |
| 1770 | if(string != strings.back()) |
| 1771 | { |
| 1772 | enumeratorString += '|'; |
| 1773 | } |
| 1774 | } |
| 1775 | |
| 1776 | return enumeratorString; |
| 1777 | } |
| 1778 | |
| 1779 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1780 | bool ValidateEnumerator(VkCmdPoolCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1781 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1782 | VkCmdPoolCreateFlagBits allFlags = (VkCmdPoolCreateFlagBits)(VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | |
| 1783 | VK_CMD_POOL_CREATE_TRANSIENT_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1784 | if(enumerator & (~allFlags)) |
| 1785 | { |
| 1786 | return false; |
| 1787 | } |
| 1788 | |
| 1789 | return true; |
| 1790 | } |
| 1791 | |
| 1792 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1793 | std::string EnumeratorString(VkCmdPoolCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1794 | { |
| 1795 | if(!ValidateEnumerator(enumerator)) |
| 1796 | { |
| 1797 | return "unrecognized enumerator"; |
| 1798 | } |
| 1799 | |
| 1800 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1801 | if(enumerator & VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1802 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1803 | strings.push_back("VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1804 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1805 | if(enumerator & VK_CMD_POOL_CREATE_TRANSIENT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1806 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1807 | strings.push_back("VK_CMD_POOL_CREATE_TRANSIENT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1808 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1809 | |
| 1810 | std::string enumeratorString; |
| 1811 | for(auto const& string : strings) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1812 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1813 | enumeratorString += string; |
| 1814 | |
| 1815 | if(string != strings.back()) |
| 1816 | { |
| 1817 | enumeratorString += '|'; |
| 1818 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1819 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1820 | |
| 1821 | return enumeratorString; |
| 1822 | } |
| 1823 | |
| 1824 | static |
| 1825 | bool ValidateEnumerator(VkCmdPoolResetFlagBits const& enumerator) |
| 1826 | { |
| 1827 | VkCmdPoolResetFlagBits allFlags = (VkCmdPoolResetFlagBits)(VK_CMD_POOL_RESET_RELEASE_RESOURCES); |
| 1828 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1829 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1830 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1831 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1832 | |
| 1833 | return true; |
| 1834 | } |
| 1835 | |
| 1836 | static |
| 1837 | std::string EnumeratorString(VkCmdPoolResetFlagBits const& enumerator) |
| 1838 | { |
| 1839 | if(!ValidateEnumerator(enumerator)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1840 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1841 | return "unrecognized enumerator"; |
| 1842 | } |
| 1843 | |
| 1844 | std::vector<std::string> strings; |
| 1845 | if(enumerator & VK_CMD_POOL_RESET_RELEASE_RESOURCES) |
| 1846 | { |
| 1847 | strings.push_back("VK_CMD_POOL_RESET_RELEASE_RESOURCES"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1848 | } |
| 1849 | |
| 1850 | std::string enumeratorString; |
| 1851 | for(auto const& string : strings) |
| 1852 | { |
| 1853 | enumeratorString += string; |
| 1854 | |
| 1855 | if(string != strings.back()) |
| 1856 | { |
| 1857 | enumeratorString += '|'; |
| 1858 | } |
| 1859 | } |
| 1860 | |
| 1861 | return enumeratorString; |
| 1862 | } |
| 1863 | |
| 1864 | static |
| 1865 | bool ValidateEnumerator(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1866 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1867 | VkCmdBufferOptimizeFlagBits allFlags = (VkCmdBufferOptimizeFlagBits)(VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT | |
| 1868 | VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1869 | VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT | |
| 1870 | VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT | |
| 1871 | VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT); |
| 1872 | if(enumerator & (~allFlags)) |
| 1873 | { |
| 1874 | return false; |
| 1875 | } |
| 1876 | |
| 1877 | return true; |
| 1878 | } |
| 1879 | |
| 1880 | static |
| 1881 | std::string EnumeratorString(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1882 | { |
| 1883 | if(!ValidateEnumerator(enumerator)) |
| 1884 | { |
| 1885 | return "unrecognized enumerator"; |
| 1886 | } |
| 1887 | |
| 1888 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1889 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT) |
| 1890 | { |
| 1891 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT"); |
| 1892 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1893 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT) |
| 1894 | { |
| 1895 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT"); |
| 1896 | } |
| 1897 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT) |
| 1898 | { |
| 1899 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT"); |
| 1900 | } |
| 1901 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT) |
| 1902 | { |
| 1903 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT"); |
| 1904 | } |
| 1905 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT) |
| 1906 | { |
| 1907 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT"); |
| 1908 | } |
| 1909 | |
| 1910 | std::string enumeratorString; |
| 1911 | for(auto const& string : strings) |
| 1912 | { |
| 1913 | enumeratorString += string; |
| 1914 | |
| 1915 | if(string != strings.back()) |
| 1916 | { |
| 1917 | enumeratorString += '|'; |
| 1918 | } |
| 1919 | } |
| 1920 | |
| 1921 | return enumeratorString; |
| 1922 | } |
| 1923 | |
| 1924 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1925 | bool ValidateEnumerator(VkCmdBufferResetFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1926 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1927 | VkCmdBufferResetFlagBits allFlags = (VkCmdBufferResetFlagBits)(VK_CMD_BUFFER_RESET_RELEASE_RESOURCES); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1928 | if(enumerator & (~allFlags)) |
| 1929 | { |
| 1930 | return false; |
| 1931 | } |
| 1932 | |
| 1933 | return true; |
| 1934 | } |
| 1935 | |
| 1936 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1937 | std::string EnumeratorString(VkCmdBufferResetFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1938 | { |
| 1939 | if(!ValidateEnumerator(enumerator)) |
| 1940 | { |
| 1941 | return "unrecognized enumerator"; |
| 1942 | } |
| 1943 | |
| 1944 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1945 | if(enumerator & VK_CMD_BUFFER_RESET_RELEASE_RESOURCES) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1946 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1947 | strings.push_back("VK_CMD_BUFFER_RESET_RELEASE_RESOURCES"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1948 | } |
| 1949 | |
| 1950 | std::string enumeratorString; |
| 1951 | for(auto const& string : strings) |
| 1952 | { |
| 1953 | enumeratorString += string; |
| 1954 | |
| 1955 | if(string != strings.back()) |
| 1956 | { |
| 1957 | enumeratorString += '|'; |
| 1958 | } |
| 1959 | } |
| 1960 | |
| 1961 | return enumeratorString; |
| 1962 | } |
| 1963 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1964 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1965 | bool ValidateEnumerator(VkImageAspectFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1966 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1967 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_METADATA_BIT | |
| 1968 | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1969 | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 1970 | VK_IMAGE_ASPECT_COLOR_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1971 | if(enumerator & (~allFlags)) |
| 1972 | { |
| 1973 | return false; |
| 1974 | } |
| 1975 | |
| 1976 | return true; |
| 1977 | } |
| 1978 | |
| 1979 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1980 | std::string EnumeratorString(VkImageAspectFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1981 | { |
| 1982 | if(!ValidateEnumerator(enumerator)) |
| 1983 | { |
| 1984 | return "unrecognized enumerator"; |
| 1985 | } |
| 1986 | |
| 1987 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1988 | if(enumerator & VK_IMAGE_ASPECT_METADATA_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1989 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1990 | strings.push_back("VK_IMAGE_ASPECT_METADATA_BIT"); |
| 1991 | } |
| 1992 | if(enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) |
| 1993 | { |
| 1994 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1995 | } |
| 1996 | if(enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) |
| 1997 | { |
| 1998 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1999 | } |
| 2000 | if(enumerator & VK_IMAGE_ASPECT_COLOR_BIT) |
| 2001 | { |
| 2002 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 2003 | } |
| 2004 | |
| 2005 | std::string enumeratorString; |
| 2006 | for(auto const& string : strings) |
| 2007 | { |
| 2008 | enumeratorString += string; |
| 2009 | |
| 2010 | if(string != strings.back()) |
| 2011 | { |
| 2012 | enumeratorString += '|'; |
| 2013 | } |
| 2014 | } |
| 2015 | |
| 2016 | return enumeratorString; |
| 2017 | } |
| 2018 | |
| 2019 | static |
| 2020 | bool ValidateEnumerator(VkQueryControlFlagBits const& enumerator) |
| 2021 | { |
| 2022 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_CONSERVATIVE_BIT); |
| 2023 | if(enumerator & (~allFlags)) |
| 2024 | { |
| 2025 | return false; |
| 2026 | } |
| 2027 | |
| 2028 | return true; |
| 2029 | } |
| 2030 | |
| 2031 | static |
| 2032 | std::string EnumeratorString(VkQueryControlFlagBits const& enumerator) |
| 2033 | { |
| 2034 | if(!ValidateEnumerator(enumerator)) |
| 2035 | { |
| 2036 | return "unrecognized enumerator"; |
| 2037 | } |
| 2038 | |
| 2039 | std::vector<std::string> strings; |
| 2040 | if(enumerator & VK_QUERY_CONTROL_CONSERVATIVE_BIT) |
| 2041 | { |
| 2042 | strings.push_back("VK_QUERY_CONTROL_CONSERVATIVE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2043 | } |
| 2044 | |
| 2045 | std::string enumeratorString; |
| 2046 | for(auto const& string : strings) |
| 2047 | { |
| 2048 | enumeratorString += string; |
| 2049 | |
| 2050 | if(string != strings.back()) |
| 2051 | { |
| 2052 | enumeratorString += '|'; |
| 2053 | } |
| 2054 | } |
| 2055 | |
| 2056 | return enumeratorString; |
| 2057 | } |
| 2058 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2059 | VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance( |
| 2060 | const VkInstanceCreateInfo* pCreateInfo, |
| 2061 | VkInstance* pInstance) |
| 2062 | { |
| 2063 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, *pInstance); |
| 2064 | VkResult result = pTable->CreateInstance(pCreateInfo, pInstance); |
| 2065 | |
| 2066 | if (result == VK_SUCCESS) { |
| 2067 | layer_data *data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); |
| 2068 | data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->extensionCount, |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 2069 | pCreateInfo->ppEnabledExtensionNames); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2070 | |
| 2071 | InitParamChecker(data); |
| 2072 | } |
| 2073 | |
| 2074 | return result; |
| 2075 | } |
| 2076 | |
| 2077 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance( |
| 2078 | VkInstance instance) |
| 2079 | { |
| 2080 | // Grab the key before the instance is destroyed. |
| 2081 | dispatch_key key = get_dispatch_key(instance); |
| 2082 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 2083 | VkResult result = pTable->DestroyInstance(instance); |
| 2084 | |
| 2085 | // Clean up logging callback, if any |
| 2086 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 2087 | if(data->logging_callback) |
| 2088 | { |
| 2089 | layer_destroy_msg_callback(data->report_data, data->logging_callback); |
| 2090 | } |
| 2091 | |
| 2092 | layer_debug_report_destroy_instance(mid(instance)); |
| 2093 | layer_data_map.erase(pTable); |
| 2094 | |
| 2095 | pc_instance_table_map.erase(key); |
| 2096 | assert(pc_instance_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
| 2097 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2098 | return result; |
| 2099 | } |
| 2100 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2101 | bool PostEnumeratePhysicalDevices( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2102 | VkInstance instance, |
| 2103 | uint32_t* pPhysicalDeviceCount, |
| 2104 | VkPhysicalDevice* pPhysicalDevices, |
| 2105 | VkResult result) |
| 2106 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2107 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2108 | if(pPhysicalDeviceCount != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2109 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2110 | } |
| 2111 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2112 | if(pPhysicalDevices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2113 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2114 | } |
| 2115 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2116 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2117 | { |
| 2118 | std::string reason = "vkEnumeratePhysicalDevices parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2119 | log_msg(mid(instance), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2120 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2121 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2122 | |
| 2123 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2124 | } |
| 2125 | |
| 2126 | VK_LAYER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
| 2127 | VkInstance instance, |
| 2128 | uint32_t* pPhysicalDeviceCount, |
| 2129 | VkPhysicalDevice* pPhysicalDevices) |
| 2130 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2131 | VkResult result = get_dispatch_table(pc_instance_table_map, instance)->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
| 2132 | |
| 2133 | PostEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices, result); |
| 2134 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2135 | return result; |
| 2136 | } |
| 2137 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2138 | bool PostGetPhysicalDeviceFeatures( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2139 | VkPhysicalDevice physicalDevice, |
| 2140 | VkPhysicalDeviceFeatures* pFeatures, |
| 2141 | VkResult result) |
| 2142 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2143 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2144 | if(pFeatures != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2145 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2146 | } |
| 2147 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2148 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2149 | { |
| 2150 | std::string reason = "vkGetPhysicalDeviceFeatures parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2151 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2152 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2153 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2154 | |
| 2155 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2156 | } |
| 2157 | |
| 2158 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures( |
| 2159 | VkPhysicalDevice physicalDevice, |
| 2160 | VkPhysicalDeviceFeatures* pFeatures) |
| 2161 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2162 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
| 2163 | |
| 2164 | PostGetPhysicalDeviceFeatures(physicalDevice, pFeatures, result); |
| 2165 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2166 | return result; |
| 2167 | } |
| 2168 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 2169 | bool PostGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2170 | VkPhysicalDevice physicalDevice, |
| 2171 | VkFormat format, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2172 | VkFormatProperties* pFormatProperties, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2173 | VkResult result) |
| 2174 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2175 | |
| 2176 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2177 | format > VK_FORMAT_END_RANGE) |
| 2178 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2179 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2180 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2181 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2182 | } |
| 2183 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2184 | if(pFormatProperties != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2185 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2186 | } |
| 2187 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2188 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2189 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 2190 | std::string reason = "vkGetPhysicalDeviceFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2191 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2192 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2193 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2194 | |
| 2195 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2196 | } |
| 2197 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 2198 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2199 | VkPhysicalDevice physicalDevice, |
| 2200 | VkFormat format, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2201 | VkFormatProperties* pFormatProperties) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2202 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2203 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2204 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2205 | PostGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties, result); |
| 2206 | |
| 2207 | return result; |
| 2208 | } |
| 2209 | |
| 2210 | bool PostGetPhysicalDeviceImageFormatProperties( |
| 2211 | VkPhysicalDevice physicalDevice, |
| 2212 | VkFormat format, |
| 2213 | VkImageType type, |
| 2214 | VkImageTiling tiling, |
| 2215 | VkImageUsageFlags usage, |
| 2216 | VkImageFormatProperties* pImageFormatProperties, |
| 2217 | VkResult result) |
| 2218 | { |
| 2219 | |
| 2220 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2221 | format > VK_FORMAT_END_RANGE) |
| 2222 | { |
| 2223 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2224 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
| 2225 | return false; |
| 2226 | } |
| 2227 | |
| 2228 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 2229 | type > VK_IMAGE_TYPE_END_RANGE) |
| 2230 | { |
| 2231 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2232 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkImageType type, is an unrecognized enumerator"); |
| 2233 | return false; |
| 2234 | } |
| 2235 | |
| 2236 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 2237 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 2238 | { |
| 2239 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2240 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkImageTiling tiling, is an unrecognized enumerator"); |
| 2241 | return false; |
| 2242 | } |
| 2243 | |
| 2244 | |
| 2245 | if(pImageFormatProperties != nullptr) |
| 2246 | { |
| 2247 | } |
| 2248 | |
| 2249 | if(result < VK_SUCCESS) |
| 2250 | { |
| 2251 | std::string reason = "vkGetPhysicalDeviceImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2252 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2253 | return false; |
| 2254 | } |
| 2255 | |
| 2256 | return true; |
| 2257 | } |
| 2258 | |
| 2259 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties( |
| 2260 | VkPhysicalDevice physicalDevice, |
| 2261 | VkFormat format, |
| 2262 | VkImageType type, |
| 2263 | VkImageTiling tiling, |
| 2264 | VkImageUsageFlags usage, |
| 2265 | VkImageFormatProperties* pImageFormatProperties) |
| 2266 | { |
| 2267 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, pImageFormatProperties); |
| 2268 | |
| 2269 | PostGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, pImageFormatProperties, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2270 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2271 | return result; |
| 2272 | } |
| 2273 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2274 | bool PostGetPhysicalDeviceLimits( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2275 | VkPhysicalDevice physicalDevice, |
| 2276 | VkPhysicalDeviceLimits* pLimits, |
| 2277 | VkResult result) |
| 2278 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2279 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2280 | if(pLimits != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2281 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2282 | } |
| 2283 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2284 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2285 | { |
| 2286 | std::string reason = "vkGetPhysicalDeviceLimits parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2287 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2288 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2289 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2290 | |
| 2291 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2292 | } |
| 2293 | |
| 2294 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceLimits( |
| 2295 | VkPhysicalDevice physicalDevice, |
| 2296 | VkPhysicalDeviceLimits* pLimits) |
| 2297 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2298 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceLimits(physicalDevice, pLimits); |
| 2299 | |
| 2300 | PostGetPhysicalDeviceLimits(physicalDevice, pLimits, result); |
| 2301 | |
| 2302 | return result; |
| 2303 | } |
| 2304 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2305 | bool PostGetPhysicalDeviceProperties( |
| 2306 | VkPhysicalDevice physicalDevice, |
| 2307 | VkPhysicalDeviceProperties* pProperties, |
| 2308 | VkResult result) |
| 2309 | { |
| 2310 | |
| 2311 | if(pProperties != nullptr) |
| 2312 | { |
| 2313 | if(pProperties->deviceType < VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE || |
| 2314 | pProperties->deviceType > VK_PHYSICAL_DEVICE_TYPE_END_RANGE) |
| 2315 | { |
| 2316 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2317 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceType pProperties->deviceType, is an unrecognized enumerator"); |
| 2318 | return false; |
| 2319 | } |
| 2320 | } |
| 2321 | |
| 2322 | if(result < VK_SUCCESS) |
| 2323 | { |
| 2324 | std::string reason = "vkGetPhysicalDeviceProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2325 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2326 | return false; |
| 2327 | } |
| 2328 | |
| 2329 | return true; |
| 2330 | } |
| 2331 | |
| 2332 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties( |
| 2333 | VkPhysicalDevice physicalDevice, |
| 2334 | VkPhysicalDeviceProperties* pProperties) |
| 2335 | { |
| 2336 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties(physicalDevice, pProperties); |
| 2337 | |
| 2338 | PostGetPhysicalDeviceProperties(physicalDevice, pProperties, result); |
| 2339 | |
| 2340 | return result; |
| 2341 | } |
| 2342 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame^] | 2343 | bool PostGetPhysicalDeviceQueueFamilyProperties( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2344 | VkPhysicalDevice physicalDevice, |
| 2345 | uint32_t* pCount, |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame^] | 2346 | VkQueueFamilyProperties* pQueueProperties, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2347 | VkResult result) |
| 2348 | { |
| 2349 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame^] | 2350 | if(pQueueProperties == nullptr && pCount != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2351 | { |
| 2352 | } |
| 2353 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2354 | if(pQueueProperties != nullptr) |
| 2355 | { |
| 2356 | } |
| 2357 | |
| 2358 | if(result < VK_SUCCESS) |
| 2359 | { |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame^] | 2360 | std::string reason = "vkGetPhysicalDeviceQueueFamilyProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2361 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2362 | return false; |
| 2363 | } |
| 2364 | |
| 2365 | return true; |
| 2366 | } |
| 2367 | |
| 2368 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties( |
| 2369 | VkPhysicalDevice physicalDevice, |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame^] | 2370 | uint32_t* pCount, |
| 2371 | VkQueueFamilyProperties* pQueueProperties) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2372 | { |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame^] | 2373 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pCount, pQueueProperties); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2374 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame^] | 2375 | PostGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pCount, pQueueProperties, result); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2376 | |
| 2377 | return result; |
| 2378 | } |
| 2379 | |
| 2380 | bool PostGetPhysicalDeviceMemoryProperties( |
| 2381 | VkPhysicalDevice physicalDevice, |
| 2382 | VkPhysicalDeviceMemoryProperties* pMemoryProperties, |
| 2383 | VkResult result) |
| 2384 | { |
| 2385 | |
| 2386 | if(pMemoryProperties != nullptr) |
| 2387 | { |
| 2388 | } |
| 2389 | |
| 2390 | if(result < VK_SUCCESS) |
| 2391 | { |
| 2392 | std::string reason = "vkGetPhysicalDeviceMemoryProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2393 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2394 | return false; |
| 2395 | } |
| 2396 | |
| 2397 | return true; |
| 2398 | } |
| 2399 | |
| 2400 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( |
| 2401 | VkPhysicalDevice physicalDevice, |
| 2402 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 2403 | { |
| 2404 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); |
| 2405 | |
| 2406 | PostGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties, result); |
| 2407 | |
| 2408 | return result; |
| 2409 | } |
| 2410 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2411 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice( |
| 2412 | VkPhysicalDevice physicalDevice, |
| 2413 | const VkDeviceCreateInfo* pCreateInfo, |
| 2414 | VkDevice* pDevice) |
| 2415 | { |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 2416 | VkLayerDispatchTable *pTable = get_dispatch_table(pc_device_table_map, *pDevice); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2417 | VkResult result = pTable->CreateDevice(physicalDevice, pCreateInfo, pDevice); |
| 2418 | if(result == VK_SUCCESS) |
| 2419 | { |
| 2420 | layer_data *instance_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2421 | layer_data *device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); |
| 2422 | device_data->report_data = layer_debug_report_create_device(instance_data->report_data, *pDevice); |
| 2423 | } |
| 2424 | |
| 2425 | return result; |
| 2426 | } |
| 2427 | |
| 2428 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice( |
| 2429 | VkDevice device) |
| 2430 | { |
| 2431 | layer_debug_report_destroy_device(device); |
| 2432 | |
| 2433 | dispatch_key key = get_dispatch_key(device); |
| 2434 | #if DISPATCH_MAP_DEBUG |
| 2435 | fprintf(stderr, "Device: %p, key: %p\n", device, key); |
| 2436 | #endif |
| 2437 | |
| 2438 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device); |
| 2439 | pc_device_table_map.erase(key); |
| 2440 | assert(pc_device_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
| 2441 | |
| 2442 | return result; |
| 2443 | } |
| 2444 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2445 | bool PostGetDeviceQueue( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2446 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2447 | uint32_t queueFamilyIndex, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2448 | uint32_t queueIndex, |
| 2449 | VkQueue* pQueue, |
| 2450 | VkResult result) |
| 2451 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2452 | |
| 2453 | |
| 2454 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2455 | if(pQueue != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2456 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2457 | } |
| 2458 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2459 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2460 | { |
| 2461 | std::string reason = "vkGetDeviceQueue parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2462 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2463 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2464 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2465 | |
| 2466 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2467 | } |
| 2468 | |
| 2469 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceQueue( |
| 2470 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2471 | uint32_t queueFamilyIndex, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2472 | uint32_t queueIndex, |
| 2473 | VkQueue* pQueue) |
| 2474 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2475 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2476 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2477 | PostGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2478 | |
| 2479 | return result; |
| 2480 | } |
| 2481 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2482 | bool PreQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2483 | VkQueue queue, |
| 2484 | const VkCmdBuffer* pCmdBuffers) |
| 2485 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2486 | if(pCmdBuffers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2487 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2488 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2489 | |
| 2490 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2491 | } |
| 2492 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2493 | bool PostQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2494 | VkQueue queue, |
| 2495 | uint32_t cmdBufferCount, |
| 2496 | VkFence fence, |
| 2497 | VkResult result) |
| 2498 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2499 | |
| 2500 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2501 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2502 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2503 | { |
| 2504 | std::string reason = "vkQueueSubmit parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2505 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2506 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2507 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2508 | |
| 2509 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2510 | } |
| 2511 | |
| 2512 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( |
| 2513 | VkQueue queue, |
| 2514 | uint32_t cmdBufferCount, |
| 2515 | const VkCmdBuffer* pCmdBuffers, |
| 2516 | VkFence fence) |
| 2517 | { |
| 2518 | PreQueueSubmit(queue, pCmdBuffers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2519 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2520 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence); |
| 2521 | |
| 2522 | PostQueueSubmit(queue, cmdBufferCount, fence, result); |
| 2523 | |
| 2524 | return result; |
| 2525 | } |
| 2526 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2527 | bool PostQueueWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2528 | VkQueue queue, |
| 2529 | VkResult result) |
| 2530 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2531 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2532 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2533 | { |
| 2534 | std::string reason = "vkQueueWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2535 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2536 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2537 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2538 | |
| 2539 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2540 | } |
| 2541 | |
| 2542 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitIdle( |
| 2543 | VkQueue queue) |
| 2544 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2545 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue); |
| 2546 | |
| 2547 | PostQueueWaitIdle(queue, result); |
| 2548 | |
| 2549 | return result; |
| 2550 | } |
| 2551 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2552 | bool PostDeviceWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2553 | VkDevice device, |
| 2554 | VkResult result) |
| 2555 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2556 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2557 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2558 | { |
| 2559 | std::string reason = "vkDeviceWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 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 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2563 | |
| 2564 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2565 | } |
| 2566 | |
| 2567 | VK_LAYER_EXPORT VkResult VKAPI vkDeviceWaitIdle( |
| 2568 | VkDevice device) |
| 2569 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2570 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device); |
| 2571 | |
| 2572 | PostDeviceWaitIdle(device, result); |
| 2573 | |
| 2574 | return result; |
| 2575 | } |
| 2576 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2577 | bool PreAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2578 | VkDevice device, |
| 2579 | const VkMemoryAllocInfo* pAllocInfo) |
| 2580 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2581 | if(pAllocInfo != nullptr) |
| 2582 | { |
| 2583 | if(pAllocInfo->sType != VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2584 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2585 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2586 | "vkAllocMemory parameter, VkStructureType pAllocInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2587 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2588 | } |
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 | |
| 2591 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2592 | } |
| 2593 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2594 | bool PostAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2595 | VkDevice device, |
| 2596 | VkDeviceMemory* pMem, |
| 2597 | VkResult result) |
| 2598 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2599 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2600 | if(pMem != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2601 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2602 | } |
| 2603 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2604 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2605 | { |
| 2606 | std::string reason = "vkAllocMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2607 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2608 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2609 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2610 | |
| 2611 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2612 | } |
| 2613 | |
| 2614 | VK_LAYER_EXPORT VkResult VKAPI vkAllocMemory( |
| 2615 | VkDevice device, |
| 2616 | const VkMemoryAllocInfo* pAllocInfo, |
| 2617 | VkDeviceMemory* pMem) |
| 2618 | { |
| 2619 | PreAllocMemory(device, pAllocInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2620 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2621 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocMemory(device, pAllocInfo, pMem); |
| 2622 | |
| 2623 | PostAllocMemory(device, pMem, result); |
| 2624 | |
| 2625 | return result; |
| 2626 | } |
| 2627 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2628 | bool PostFreeMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2629 | VkDevice device, |
| 2630 | VkDeviceMemory mem, |
| 2631 | VkResult result) |
| 2632 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2633 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2634 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2635 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2636 | { |
| 2637 | std::string reason = "vkFreeMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2638 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2639 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2640 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2641 | |
| 2642 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2643 | } |
| 2644 | |
| 2645 | VK_LAYER_EXPORT VkResult VKAPI vkFreeMemory( |
| 2646 | VkDevice device, |
| 2647 | VkDeviceMemory mem) |
| 2648 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2649 | VkResult result = get_dispatch_table(pc_device_table_map, device)->FreeMemory(device, mem); |
| 2650 | |
| 2651 | PostFreeMemory(device, mem, result); |
| 2652 | |
| 2653 | return result; |
| 2654 | } |
| 2655 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2656 | bool PostMapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2657 | VkDevice device, |
| 2658 | VkDeviceMemory mem, |
| 2659 | VkDeviceSize offset, |
| 2660 | VkDeviceSize size, |
| 2661 | VkMemoryMapFlags flags, |
| 2662 | void** ppData, |
| 2663 | VkResult result) |
| 2664 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2665 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2666 | |
| 2667 | |
| 2668 | |
| 2669 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2670 | if(ppData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2671 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2672 | } |
| 2673 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2674 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2675 | { |
| 2676 | std::string reason = "vkMapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2677 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2678 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2679 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2680 | |
| 2681 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2682 | } |
| 2683 | |
| 2684 | VK_LAYER_EXPORT VkResult VKAPI vkMapMemory( |
| 2685 | VkDevice device, |
| 2686 | VkDeviceMemory mem, |
| 2687 | VkDeviceSize offset, |
| 2688 | VkDeviceSize size, |
| 2689 | VkMemoryMapFlags flags, |
| 2690 | void** ppData) |
| 2691 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2692 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, mem, offset, size, flags, ppData); |
| 2693 | |
| 2694 | PostMapMemory(device, mem, offset, size, flags, ppData, result); |
| 2695 | |
| 2696 | return result; |
| 2697 | } |
| 2698 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2699 | bool PostUnmapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2700 | VkDevice device, |
| 2701 | VkDeviceMemory mem, |
| 2702 | VkResult result) |
| 2703 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2704 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2705 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2706 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2707 | { |
| 2708 | std::string reason = "vkUnmapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2709 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2710 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2711 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2712 | |
| 2713 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2714 | } |
| 2715 | |
| 2716 | VK_LAYER_EXPORT VkResult VKAPI vkUnmapMemory( |
| 2717 | VkDevice device, |
| 2718 | VkDeviceMemory mem) |
| 2719 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2720 | VkResult result = get_dispatch_table(pc_device_table_map, device)->UnmapMemory(device, mem); |
| 2721 | |
| 2722 | PostUnmapMemory(device, mem, result); |
| 2723 | |
| 2724 | return result; |
| 2725 | } |
| 2726 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2727 | bool PreFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2728 | VkDevice device, |
| 2729 | const VkMappedMemoryRange* pMemRanges) |
| 2730 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2731 | if(pMemRanges != nullptr) |
| 2732 | { |
| 2733 | if(pMemRanges->sType != VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2734 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2735 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2736 | "vkFlushMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2737 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2738 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2739 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2740 | |
| 2741 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2742 | } |
| 2743 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2744 | bool PostFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2745 | VkDevice device, |
| 2746 | uint32_t memRangeCount, |
| 2747 | VkResult result) |
| 2748 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2749 | |
| 2750 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2751 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2752 | { |
| 2753 | std::string reason = "vkFlushMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2754 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2755 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2756 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2757 | |
| 2758 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2759 | } |
| 2760 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2761 | VK_LAYER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2762 | VkDevice device, |
| 2763 | uint32_t memRangeCount, |
| 2764 | const VkMappedMemoryRange* pMemRanges) |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2765 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2766 | PreFlushMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2767 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2768 | 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] | 2769 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2770 | PostFlushMappedMemoryRanges(device, memRangeCount, result); |
| 2771 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2772 | return result; |
| 2773 | } |
| 2774 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2775 | bool PreInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2776 | VkDevice device, |
| 2777 | const VkMappedMemoryRange* pMemRanges) |
| 2778 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2779 | if(pMemRanges != nullptr) |
| 2780 | { |
| 2781 | if(pMemRanges->sType != VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2782 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2783 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2784 | "vkInvalidateMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2785 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2786 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2787 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2788 | |
| 2789 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2790 | } |
| 2791 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2792 | bool PostInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2793 | VkDevice device, |
| 2794 | uint32_t memRangeCount, |
| 2795 | VkResult result) |
| 2796 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2797 | |
| 2798 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2799 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2800 | { |
| 2801 | std::string reason = "vkInvalidateMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2802 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2803 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2804 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2805 | |
| 2806 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2807 | } |
| 2808 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2809 | VK_LAYER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2810 | VkDevice device, |
| 2811 | uint32_t memRangeCount, |
| 2812 | const VkMappedMemoryRange* pMemRanges) |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2813 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2814 | PreInvalidateMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2815 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2816 | 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] | 2817 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2818 | PostInvalidateMappedMemoryRanges(device, memRangeCount, result); |
| 2819 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2820 | return result; |
| 2821 | } |
| 2822 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2823 | bool PostGetDeviceMemoryCommitment( |
| 2824 | VkDevice device, |
| 2825 | VkDeviceMemory memory, |
| 2826 | VkDeviceSize* pCommittedMemoryInBytes, |
| 2827 | VkResult result) |
| 2828 | { |
| 2829 | |
| 2830 | |
| 2831 | if(pCommittedMemoryInBytes != nullptr) |
| 2832 | { |
| 2833 | } |
| 2834 | |
| 2835 | if(result < VK_SUCCESS) |
| 2836 | { |
| 2837 | std::string reason = "vkGetDeviceMemoryCommitment parameter, VkResult result, is " + EnumeratorString(result); |
| 2838 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2839 | return false; |
| 2840 | } |
| 2841 | |
| 2842 | return true; |
| 2843 | } |
| 2844 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2845 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2846 | VkDevice device, |
| 2847 | VkDeviceMemory memory, |
| 2848 | VkDeviceSize* pCommittedMemoryInBytes) |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2849 | { |
| 2850 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
| 2851 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2852 | PostGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes, result); |
| 2853 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2854 | return result; |
| 2855 | } |
| 2856 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2857 | bool PostBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2858 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2859 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2860 | VkDeviceMemory mem, |
| 2861 | VkDeviceSize memOffset, |
| 2862 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2863 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2864 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2865 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2866 | |
| 2867 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2868 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2869 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2870 | std::string reason = "vkBindBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2871 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2872 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2873 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2874 | |
| 2875 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2876 | } |
| 2877 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2878 | VK_LAYER_EXPORT VkResult VKAPI vkBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2879 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2880 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2881 | VkDeviceMemory mem, |
| 2882 | VkDeviceSize memOffset) |
| 2883 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2884 | 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] | 2885 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2886 | PostBindBufferMemory(device, buffer, mem, memOffset, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2887 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2888 | return result; |
| 2889 | } |
| 2890 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2891 | bool PostBindImageMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2892 | VkDevice device, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2893 | VkImage image, |
| 2894 | VkDeviceMemory mem, |
| 2895 | VkDeviceSize memOffset, |
| 2896 | VkResult result) |
| 2897 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2898 | |
| 2899 | |
| 2900 | |
| 2901 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2902 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2903 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2904 | std::string reason = "vkBindImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2905 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2906 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2907 | } |
| 2908 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2909 | return true; |
| 2910 | } |
| 2911 | |
| 2912 | VK_LAYER_EXPORT VkResult VKAPI vkBindImageMemory( |
| 2913 | VkDevice device, |
| 2914 | VkImage image, |
| 2915 | VkDeviceMemory mem, |
| 2916 | VkDeviceSize memOffset) |
| 2917 | { |
| 2918 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, mem, memOffset); |
| 2919 | |
| 2920 | PostBindImageMemory(device, image, mem, memOffset, result); |
| 2921 | |
| 2922 | return result; |
| 2923 | } |
| 2924 | |
| 2925 | bool PostGetBufferMemoryRequirements( |
| 2926 | VkDevice device, |
| 2927 | VkBuffer buffer, |
| 2928 | VkMemoryRequirements* pMemoryRequirements, |
| 2929 | VkResult result) |
| 2930 | { |
| 2931 | |
| 2932 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2933 | if(pMemoryRequirements != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2934 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2935 | } |
| 2936 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2937 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2938 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2939 | std::string reason = "vkGetBufferMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2940 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2941 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2942 | } |
| 2943 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2944 | return true; |
| 2945 | } |
| 2946 | |
| 2947 | VK_LAYER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements( |
| 2948 | VkDevice device, |
| 2949 | VkBuffer buffer, |
| 2950 | VkMemoryRequirements* pMemoryRequirements) |
| 2951 | { |
| 2952 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
| 2953 | |
| 2954 | PostGetBufferMemoryRequirements(device, buffer, pMemoryRequirements, result); |
| 2955 | |
| 2956 | return result; |
| 2957 | } |
| 2958 | |
| 2959 | bool PostGetImageMemoryRequirements( |
| 2960 | VkDevice device, |
| 2961 | VkImage image, |
| 2962 | VkMemoryRequirements* pMemoryRequirements, |
| 2963 | VkResult result) |
| 2964 | { |
| 2965 | |
| 2966 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2967 | if(pMemoryRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2968 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2969 | } |
| 2970 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2971 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2972 | { |
| 2973 | std::string reason = "vkGetImageMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2974 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2975 | return false; |
| 2976 | } |
| 2977 | |
| 2978 | return true; |
| 2979 | } |
| 2980 | |
| 2981 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageMemoryRequirements( |
| 2982 | VkDevice device, |
| 2983 | VkImage image, |
| 2984 | VkMemoryRequirements* pMemoryRequirements) |
| 2985 | { |
| 2986 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
| 2987 | |
| 2988 | PostGetImageMemoryRequirements(device, image, pMemoryRequirements, result); |
| 2989 | |
| 2990 | return result; |
| 2991 | } |
| 2992 | |
| 2993 | bool PostGetImageSparseMemoryRequirements( |
| 2994 | VkDevice device, |
| 2995 | VkImage image, |
| 2996 | uint32_t* pNumRequirements, |
| 2997 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements, |
| 2998 | VkResult result) |
| 2999 | { |
| 3000 | |
| 3001 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3002 | if(pNumRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3003 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3004 | } |
| 3005 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3006 | if(pSparseMemoryRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3007 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3008 | if(pSparseMemoryRequirements->formatProps.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 3009 | pSparseMemoryRequirements->formatProps.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 3010 | { |
| 3011 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3012 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect pSparseMemoryRequirements->formatProps.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3013 | return false; |
| 3014 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3015 | } |
| 3016 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3017 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3018 | { |
| 3019 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 3020 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3021 | return false; |
| 3022 | } |
| 3023 | |
| 3024 | return true; |
| 3025 | } |
| 3026 | |
| 3027 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements( |
| 3028 | VkDevice device, |
| 3029 | VkImage image, |
| 3030 | uint32_t* pNumRequirements, |
| 3031 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 3032 | { |
| 3033 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements); |
| 3034 | |
| 3035 | PostGetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements, result); |
| 3036 | |
| 3037 | return result; |
| 3038 | } |
| 3039 | |
| 3040 | bool PostGetPhysicalDeviceSparseImageFormatProperties( |
| 3041 | VkPhysicalDevice physicalDevice, |
| 3042 | VkFormat format, |
| 3043 | VkImageType type, |
| 3044 | uint32_t samples, |
| 3045 | VkImageUsageFlags usage, |
| 3046 | VkImageTiling tiling, |
| 3047 | uint32_t* pNumProperties, |
| 3048 | VkSparseImageFormatProperties* pProperties, |
| 3049 | VkResult result) |
| 3050 | { |
| 3051 | |
| 3052 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 3053 | format > VK_FORMAT_END_RANGE) |
| 3054 | { |
| 3055 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3056 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3057 | return false; |
| 3058 | } |
| 3059 | |
| 3060 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 3061 | type > VK_IMAGE_TYPE_END_RANGE) |
| 3062 | { |
| 3063 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3064 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageType type, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3065 | return false; |
| 3066 | } |
| 3067 | |
| 3068 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3069 | |
| 3070 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 3071 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 3072 | { |
| 3073 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3074 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageTiling tiling, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3075 | return false; |
| 3076 | } |
| 3077 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3078 | if(pNumProperties != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3079 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3080 | } |
| 3081 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3082 | if(pProperties != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3083 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3084 | if(pProperties->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 3085 | pProperties->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 3086 | { |
| 3087 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3088 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3089 | return false; |
| 3090 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3091 | } |
| 3092 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3093 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3094 | { |
| 3095 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 3096 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3097 | return false; |
| 3098 | } |
| 3099 | |
| 3100 | return true; |
| 3101 | } |
| 3102 | |
| 3103 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties( |
| 3104 | VkPhysicalDevice physicalDevice, |
| 3105 | VkFormat format, |
| 3106 | VkImageType type, |
| 3107 | uint32_t samples, |
| 3108 | VkImageUsageFlags usage, |
| 3109 | VkImageTiling tiling, |
| 3110 | uint32_t* pNumProperties, |
| 3111 | VkSparseImageFormatProperties* pProperties) |
| 3112 | { |
| 3113 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties); |
| 3114 | |
| 3115 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties, result); |
| 3116 | |
| 3117 | return result; |
| 3118 | } |
| 3119 | |
| 3120 | bool PreQueueBindSparseBufferMemory( |
| 3121 | VkQueue queue, |
| 3122 | const VkSparseMemoryBindInfo* pBindInfo) |
| 3123 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3124 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3125 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3126 | } |
| 3127 | |
| 3128 | return true; |
| 3129 | } |
| 3130 | |
| 3131 | bool PostQueueBindSparseBufferMemory( |
| 3132 | VkQueue queue, |
| 3133 | VkBuffer buffer, |
| 3134 | uint32_t numBindings, |
| 3135 | VkResult result) |
| 3136 | { |
| 3137 | |
| 3138 | |
| 3139 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3140 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3141 | { |
| 3142 | std::string reason = "vkQueueBindSparseBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 3143 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3144 | return false; |
| 3145 | } |
| 3146 | |
| 3147 | return true; |
| 3148 | } |
| 3149 | |
| 3150 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory( |
| 3151 | VkQueue queue, |
| 3152 | VkBuffer buffer, |
| 3153 | uint32_t numBindings, |
| 3154 | const VkSparseMemoryBindInfo* pBindInfo) |
| 3155 | { |
| 3156 | PreQueueBindSparseBufferMemory(queue, pBindInfo); |
| 3157 | |
| 3158 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo); |
| 3159 | |
| 3160 | PostQueueBindSparseBufferMemory(queue, buffer, numBindings, result); |
| 3161 | |
| 3162 | return result; |
| 3163 | } |
| 3164 | |
| 3165 | bool PreQueueBindSparseImageOpaqueMemory( |
| 3166 | VkQueue queue, |
| 3167 | const VkSparseMemoryBindInfo* pBindInfo) |
| 3168 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3169 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3170 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3171 | } |
| 3172 | |
| 3173 | return true; |
| 3174 | } |
| 3175 | |
| 3176 | bool PostQueueBindSparseImageOpaqueMemory( |
| 3177 | VkQueue queue, |
| 3178 | VkImage image, |
| 3179 | uint32_t numBindings, |
| 3180 | VkResult result) |
| 3181 | { |
| 3182 | |
| 3183 | |
| 3184 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3185 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3186 | { |
| 3187 | std::string reason = "vkQueueBindSparseImageOpaqueMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 3188 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3189 | return false; |
| 3190 | } |
| 3191 | |
| 3192 | return true; |
| 3193 | } |
| 3194 | |
| 3195 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory( |
| 3196 | VkQueue queue, |
| 3197 | VkImage image, |
| 3198 | uint32_t numBindings, |
| 3199 | const VkSparseMemoryBindInfo* pBindInfo) |
| 3200 | { |
| 3201 | PreQueueBindSparseImageOpaqueMemory(queue, pBindInfo); |
| 3202 | |
| 3203 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo); |
| 3204 | |
| 3205 | PostQueueBindSparseImageOpaqueMemory(queue, image, numBindings, result); |
| 3206 | |
| 3207 | return result; |
| 3208 | } |
| 3209 | |
| 3210 | bool PreQueueBindSparseImageMemory( |
| 3211 | VkQueue queue, |
| 3212 | const VkSparseImageMemoryBindInfo* pBindInfo) |
| 3213 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3214 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3215 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3216 | if(pBindInfo->subresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 3217 | pBindInfo->subresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 3218 | { |
| 3219 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3220 | "vkQueueBindSparseImageMemory parameter, VkImageAspect pBindInfo->subresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3221 | return false; |
| 3222 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3223 | } |
| 3224 | |
| 3225 | return true; |
| 3226 | } |
| 3227 | |
| 3228 | bool PostQueueBindSparseImageMemory( |
| 3229 | VkQueue queue, |
| 3230 | VkImage image, |
| 3231 | uint32_t numBindings, |
| 3232 | VkResult result) |
| 3233 | { |
| 3234 | |
| 3235 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3236 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3237 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3238 | { |
| 3239 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3240 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3241 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3242 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3243 | |
| 3244 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3245 | } |
| 3246 | |
| 3247 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3248 | VkQueue queue, |
| 3249 | VkImage image, |
| 3250 | uint32_t numBindings, |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 3251 | const VkSparseImageMemoryBindInfo* pBindInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3252 | { |
| 3253 | PreQueueBindSparseImageMemory(queue, pBindInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3254 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 3255 | 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] | 3256 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3257 | PostQueueBindSparseImageMemory(queue, image, numBindings, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3258 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3259 | return result; |
| 3260 | } |
| 3261 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3262 | bool PreCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3263 | VkDevice device, |
| 3264 | const VkFenceCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3265 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3266 | if(pCreateInfo != nullptr) |
| 3267 | { |
| 3268 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_FENCE_CREATE_INFO) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3269 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3270 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3271 | "vkCreateFence parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3272 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3273 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3274 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3275 | |
| 3276 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3277 | } |
| 3278 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3279 | bool PostCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3280 | VkDevice device, |
| 3281 | VkFence* pFence, |
| 3282 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3283 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3284 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3285 | if(pFence != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3286 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3287 | } |
| 3288 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3289 | if(result < VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3290 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3291 | std::string reason = "vkCreateFence parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3292 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3293 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3294 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3295 | |
| 3296 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3297 | } |
| 3298 | |
| 3299 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFence( |
| 3300 | VkDevice device, |
| 3301 | const VkFenceCreateInfo* pCreateInfo, |
| 3302 | VkFence* pFence) |
| 3303 | { |
| 3304 | PreCreateFence(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3305 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3306 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pFence); |
| 3307 | |
| 3308 | PostCreateFence(device, pFence, result); |
| 3309 | |
| 3310 | return result; |
| 3311 | } |
| 3312 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3313 | bool PostDestroyFence( |
| 3314 | VkDevice device, |
| 3315 | VkFence fence, |
| 3316 | VkResult result) |
| 3317 | { |
| 3318 | |
| 3319 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3320 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3321 | { |
| 3322 | std::string reason = "vkDestroyFence parameter, VkResult result, is " + EnumeratorString(result); |
| 3323 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3324 | return false; |
| 3325 | } |
| 3326 | |
| 3327 | return true; |
| 3328 | } |
| 3329 | |
| 3330 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyFence( |
| 3331 | VkDevice device, |
| 3332 | VkFence fence) |
| 3333 | { |
| 3334 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyFence(device, fence); |
| 3335 | |
| 3336 | PostDestroyFence(device, fence, result); |
| 3337 | |
| 3338 | return result; |
| 3339 | } |
| 3340 | |
| 3341 | bool PreResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3342 | VkDevice device, |
| 3343 | const VkFence* pFences) |
| 3344 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3345 | if(pFences != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3346 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3347 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3348 | |
| 3349 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3350 | } |
| 3351 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3352 | bool PostResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3353 | VkDevice device, |
| 3354 | uint32_t fenceCount, |
| 3355 | VkResult result) |
| 3356 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3357 | |
| 3358 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3359 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3360 | { |
| 3361 | std::string reason = "vkResetFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3362 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3363 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3364 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3365 | |
| 3366 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3367 | } |
| 3368 | |
| 3369 | VK_LAYER_EXPORT VkResult VKAPI vkResetFences( |
| 3370 | VkDevice device, |
| 3371 | uint32_t fenceCount, |
| 3372 | const VkFence* pFences) |
| 3373 | { |
| 3374 | PreResetFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3375 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3376 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences); |
| 3377 | |
| 3378 | PostResetFences(device, fenceCount, result); |
| 3379 | |
| 3380 | return result; |
| 3381 | } |
| 3382 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3383 | bool PostGetFenceStatus( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3384 | VkDevice device, |
| 3385 | VkFence fence, |
| 3386 | VkResult result) |
| 3387 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3388 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3389 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3390 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3391 | { |
| 3392 | std::string reason = "vkGetFenceStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3393 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3394 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3395 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3396 | |
| 3397 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3398 | } |
| 3399 | |
| 3400 | VK_LAYER_EXPORT VkResult VKAPI vkGetFenceStatus( |
| 3401 | VkDevice device, |
| 3402 | VkFence fence) |
| 3403 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3404 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence); |
| 3405 | |
| 3406 | PostGetFenceStatus(device, fence, result); |
| 3407 | |
| 3408 | return result; |
| 3409 | } |
| 3410 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3411 | bool PreWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3412 | VkDevice device, |
| 3413 | const VkFence* pFences) |
| 3414 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3415 | if(pFences != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3416 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3417 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3418 | |
| 3419 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3420 | } |
| 3421 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3422 | bool PostWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3423 | VkDevice device, |
| 3424 | uint32_t fenceCount, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3425 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3426 | uint64_t timeout, |
| 3427 | VkResult result) |
| 3428 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3429 | |
| 3430 | |
| 3431 | |
| 3432 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3433 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3434 | { |
| 3435 | std::string reason = "vkWaitForFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3436 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3437 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3438 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3439 | |
| 3440 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3441 | } |
| 3442 | |
| 3443 | VK_LAYER_EXPORT VkResult VKAPI vkWaitForFences( |
| 3444 | VkDevice device, |
| 3445 | uint32_t fenceCount, |
| 3446 | const VkFence* pFences, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3447 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3448 | uint64_t timeout) |
| 3449 | { |
| 3450 | PreWaitForFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3451 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3452 | VkResult result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 3453 | |
| 3454 | PostWaitForFences(device, fenceCount, waitAll, timeout, result); |
| 3455 | |
| 3456 | return result; |
| 3457 | } |
| 3458 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3459 | bool PreCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3460 | VkDevice device, |
| 3461 | const VkSemaphoreCreateInfo* pCreateInfo) |
| 3462 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3463 | if(pCreateInfo != nullptr) |
| 3464 | { |
| 3465 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3466 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3467 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3468 | "vkCreateSemaphore parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3469 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3470 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3471 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3472 | |
| 3473 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3474 | } |
| 3475 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3476 | bool PostCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3477 | VkDevice device, |
| 3478 | VkSemaphore* pSemaphore, |
| 3479 | VkResult result) |
| 3480 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3481 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3482 | if(pSemaphore != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3483 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3484 | } |
| 3485 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3486 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3487 | { |
| 3488 | std::string reason = "vkCreateSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3489 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3490 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3491 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3492 | |
| 3493 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3494 | } |
| 3495 | |
| 3496 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSemaphore( |
| 3497 | VkDevice device, |
| 3498 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 3499 | VkSemaphore* pSemaphore) |
| 3500 | { |
| 3501 | PreCreateSemaphore(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3502 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3503 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pSemaphore); |
| 3504 | |
| 3505 | PostCreateSemaphore(device, pSemaphore, result); |
| 3506 | |
| 3507 | return result; |
| 3508 | } |
| 3509 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3510 | bool PostDestroySemaphore( |
| 3511 | VkDevice device, |
| 3512 | VkSemaphore semaphore, |
| 3513 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3514 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3515 | |
| 3516 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3517 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3518 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3519 | std::string reason = "vkDestroySemaphore parameter, VkResult result, is " + EnumeratorString(result); |
| 3520 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3521 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3522 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3523 | |
| 3524 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3525 | } |
| 3526 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3527 | VK_LAYER_EXPORT VkResult VKAPI vkDestroySemaphore( |
| 3528 | VkDevice device, |
| 3529 | VkSemaphore semaphore) |
| 3530 | { |
| 3531 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroySemaphore(device, semaphore); |
| 3532 | |
| 3533 | PostDestroySemaphore(device, semaphore, result); |
| 3534 | |
| 3535 | return result; |
| 3536 | } |
| 3537 | |
| 3538 | bool PostQueueSignalSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3539 | VkQueue queue, |
| 3540 | VkSemaphore semaphore, |
| 3541 | VkResult result) |
| 3542 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3543 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3544 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3545 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3546 | { |
| 3547 | std::string reason = "vkQueueSignalSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3548 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3549 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3550 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3551 | |
| 3552 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3553 | } |
| 3554 | |
| 3555 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSignalSemaphore( |
| 3556 | VkQueue queue, |
| 3557 | VkSemaphore semaphore) |
| 3558 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3559 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSignalSemaphore(queue, semaphore); |
| 3560 | |
| 3561 | PostQueueSignalSemaphore(queue, semaphore, result); |
| 3562 | |
| 3563 | return result; |
| 3564 | } |
| 3565 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3566 | bool PostQueueWaitSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3567 | VkQueue queue, |
| 3568 | VkSemaphore semaphore, |
| 3569 | VkResult result) |
| 3570 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3571 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3572 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3573 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3574 | { |
| 3575 | std::string reason = "vkQueueWaitSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3576 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3577 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3578 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3579 | |
| 3580 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3581 | } |
| 3582 | |
| 3583 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitSemaphore( |
| 3584 | VkQueue queue, |
| 3585 | VkSemaphore semaphore) |
| 3586 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3587 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitSemaphore(queue, semaphore); |
| 3588 | |
| 3589 | PostQueueWaitSemaphore(queue, semaphore, result); |
| 3590 | |
| 3591 | return result; |
| 3592 | } |
| 3593 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3594 | bool PreCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3595 | VkDevice device, |
| 3596 | const VkEventCreateInfo* pCreateInfo) |
| 3597 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3598 | if(pCreateInfo != nullptr) |
| 3599 | { |
| 3600 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_EVENT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3601 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3602 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3603 | "vkCreateEvent parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3604 | return false; |
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 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3607 | |
| 3608 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3609 | } |
| 3610 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3611 | bool PostCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3612 | VkDevice device, |
| 3613 | VkEvent* pEvent, |
| 3614 | VkResult result) |
| 3615 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3616 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3617 | if(pEvent != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3618 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3619 | } |
| 3620 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3621 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3622 | { |
| 3623 | std::string reason = "vkCreateEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3624 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3625 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3626 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3627 | |
| 3628 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3629 | } |
| 3630 | |
| 3631 | VK_LAYER_EXPORT VkResult VKAPI vkCreateEvent( |
| 3632 | VkDevice device, |
| 3633 | const VkEventCreateInfo* pCreateInfo, |
| 3634 | VkEvent* pEvent) |
| 3635 | { |
| 3636 | PreCreateEvent(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3637 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3638 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pEvent); |
| 3639 | |
| 3640 | PostCreateEvent(device, pEvent, result); |
| 3641 | |
| 3642 | return result; |
| 3643 | } |
| 3644 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3645 | bool PostDestroyEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3646 | VkDevice device, |
| 3647 | VkEvent event, |
| 3648 | VkResult result) |
| 3649 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3650 | |
| 3651 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3652 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3653 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3654 | std::string reason = "vkDestroyEvent parameter, VkResult result, is " + EnumeratorString(result); |
| 3655 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3656 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3657 | } |
| 3658 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3659 | return true; |
| 3660 | } |
| 3661 | |
| 3662 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyEvent( |
| 3663 | VkDevice device, |
| 3664 | VkEvent event) |
| 3665 | { |
| 3666 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyEvent(device, event); |
| 3667 | |
| 3668 | PostDestroyEvent(device, event, result); |
| 3669 | |
| 3670 | return result; |
| 3671 | } |
| 3672 | |
| 3673 | bool PostGetEventStatus( |
| 3674 | VkDevice device, |
| 3675 | VkEvent event, |
| 3676 | VkResult result) |
| 3677 | { |
| 3678 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3679 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3680 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3681 | { |
| 3682 | std::string reason = "vkGetEventStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3683 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3684 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3685 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3686 | |
| 3687 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3688 | } |
| 3689 | |
| 3690 | VK_LAYER_EXPORT VkResult VKAPI vkGetEventStatus( |
| 3691 | VkDevice device, |
| 3692 | VkEvent event) |
| 3693 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3694 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event); |
| 3695 | |
| 3696 | PostGetEventStatus(device, event, result); |
| 3697 | |
| 3698 | return result; |
| 3699 | } |
| 3700 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3701 | bool PostSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3702 | VkDevice device, |
| 3703 | VkEvent event, |
| 3704 | VkResult result) |
| 3705 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3706 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3707 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3708 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3709 | { |
| 3710 | std::string reason = "vkSetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3711 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3712 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3713 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3714 | |
| 3715 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3716 | } |
| 3717 | |
| 3718 | VK_LAYER_EXPORT VkResult VKAPI vkSetEvent( |
| 3719 | VkDevice device, |
| 3720 | VkEvent event) |
| 3721 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3722 | VkResult result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event); |
| 3723 | |
| 3724 | PostSetEvent(device, event, result); |
| 3725 | |
| 3726 | return result; |
| 3727 | } |
| 3728 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3729 | bool PostResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3730 | VkDevice device, |
| 3731 | VkEvent event, |
| 3732 | VkResult result) |
| 3733 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3734 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3735 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3736 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3737 | { |
| 3738 | std::string reason = "vkResetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3739 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3740 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3741 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3742 | |
| 3743 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3744 | } |
| 3745 | |
| 3746 | VK_LAYER_EXPORT VkResult VKAPI vkResetEvent( |
| 3747 | VkDevice device, |
| 3748 | VkEvent event) |
| 3749 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3750 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event); |
| 3751 | |
| 3752 | PostResetEvent(device, event, result); |
| 3753 | |
| 3754 | return result; |
| 3755 | } |
| 3756 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3757 | bool PreCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3758 | VkDevice device, |
| 3759 | const VkQueryPoolCreateInfo* pCreateInfo) |
| 3760 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3761 | if(pCreateInfo != nullptr) |
| 3762 | { |
| 3763 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3764 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3765 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3766 | "vkCreateQueryPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3767 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3768 | } |
| 3769 | if(pCreateInfo->queryType < VK_QUERY_TYPE_BEGIN_RANGE || |
| 3770 | pCreateInfo->queryType > VK_QUERY_TYPE_END_RANGE) |
| 3771 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3772 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3773 | "vkCreateQueryPool parameter, VkQueryType pCreateInfo->queryType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3774 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3775 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3776 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3777 | |
| 3778 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3779 | } |
| 3780 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3781 | bool PostCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3782 | VkDevice device, |
| 3783 | VkQueryPool* pQueryPool, |
| 3784 | VkResult result) |
| 3785 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3786 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3787 | if(pQueryPool != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3788 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3789 | } |
| 3790 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3791 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3792 | { |
| 3793 | std::string reason = "vkCreateQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3794 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3795 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3796 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3797 | |
| 3798 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3799 | } |
| 3800 | |
| 3801 | VK_LAYER_EXPORT VkResult VKAPI vkCreateQueryPool( |
| 3802 | VkDevice device, |
| 3803 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3804 | VkQueryPool* pQueryPool) |
| 3805 | { |
| 3806 | PreCreateQueryPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3807 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3808 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 3809 | |
| 3810 | PostCreateQueryPool(device, pQueryPool, result); |
| 3811 | |
| 3812 | return result; |
| 3813 | } |
| 3814 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3815 | bool PostDestroyQueryPool( |
| 3816 | VkDevice device, |
| 3817 | VkQueryPool queryPool, |
| 3818 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3819 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3820 | |
| 3821 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3822 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3823 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3824 | std::string reason = "vkDestroyQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
| 3825 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3826 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3827 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3828 | |
| 3829 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3830 | } |
| 3831 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3832 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyQueryPool( |
| 3833 | VkDevice device, |
| 3834 | VkQueryPool queryPool) |
| 3835 | { |
| 3836 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyQueryPool(device, queryPool); |
| 3837 | |
| 3838 | PostDestroyQueryPool(device, queryPool, result); |
| 3839 | |
| 3840 | return result; |
| 3841 | } |
| 3842 | |
| 3843 | bool PostGetQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3844 | VkDevice device, |
| 3845 | VkQueryPool queryPool, |
| 3846 | uint32_t startQuery, |
| 3847 | uint32_t queryCount, |
| 3848 | size_t* pDataSize, |
| 3849 | void* pData, |
| 3850 | VkQueryResultFlags flags, |
| 3851 | VkResult result) |
| 3852 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3853 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3854 | |
| 3855 | |
| 3856 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3857 | if(pDataSize != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3858 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3859 | } |
| 3860 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3861 | if(pData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3862 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3863 | } |
| 3864 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3865 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3866 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3867 | { |
| 3868 | std::string reason = "vkGetQueryPoolResults parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3869 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3870 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3871 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3872 | |
| 3873 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3874 | } |
| 3875 | |
| 3876 | VK_LAYER_EXPORT VkResult VKAPI vkGetQueryPoolResults( |
| 3877 | VkDevice device, |
| 3878 | VkQueryPool queryPool, |
| 3879 | uint32_t startQuery, |
| 3880 | uint32_t queryCount, |
| 3881 | size_t* pDataSize, |
| 3882 | void* pData, |
| 3883 | VkQueryResultFlags flags) |
| 3884 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3885 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags); |
| 3886 | |
| 3887 | PostGetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags, result); |
| 3888 | |
| 3889 | return result; |
| 3890 | } |
| 3891 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3892 | bool PreCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3893 | VkDevice device, |
| 3894 | const VkBufferCreateInfo* pCreateInfo) |
| 3895 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3896 | if(pCreateInfo != nullptr) |
| 3897 | { |
| 3898 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3899 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3900 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3901 | "vkCreateBuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3902 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3903 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3904 | if(pCreateInfo->sharingMode < VK_SHARING_MODE_BEGIN_RANGE || |
| 3905 | pCreateInfo->sharingMode > VK_SHARING_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3906 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3907 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3908 | "vkCreateBuffer parameter, VkSharingMode pCreateInfo->sharingMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3909 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3910 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3911 | if(pCreateInfo->pQueueFamilyIndices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3912 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3913 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3914 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3915 | |
| 3916 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3917 | } |
| 3918 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3919 | bool PostCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3920 | VkDevice device, |
| 3921 | VkBuffer* pBuffer, |
| 3922 | VkResult result) |
| 3923 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3924 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3925 | if(pBuffer != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3926 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3927 | } |
| 3928 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3929 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3930 | { |
| 3931 | std::string reason = "vkCreateBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3932 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3933 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3934 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3935 | |
| 3936 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3937 | } |
| 3938 | |
| 3939 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBuffer( |
| 3940 | VkDevice device, |
| 3941 | const VkBufferCreateInfo* pCreateInfo, |
| 3942 | VkBuffer* pBuffer) |
| 3943 | { |
| 3944 | PreCreateBuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3945 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3946 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pBuffer); |
| 3947 | |
| 3948 | PostCreateBuffer(device, pBuffer, result); |
| 3949 | |
| 3950 | return result; |
| 3951 | } |
| 3952 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3953 | bool PostDestroyBuffer( |
| 3954 | VkDevice device, |
| 3955 | VkBuffer buffer, |
| 3956 | VkResult result) |
| 3957 | { |
| 3958 | |
| 3959 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3960 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3961 | { |
| 3962 | std::string reason = "vkDestroyBuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 3963 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3964 | return false; |
| 3965 | } |
| 3966 | |
| 3967 | return true; |
| 3968 | } |
| 3969 | |
| 3970 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyBuffer( |
| 3971 | VkDevice device, |
| 3972 | VkBuffer buffer) |
| 3973 | { |
| 3974 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyBuffer(device, buffer); |
| 3975 | |
| 3976 | PostDestroyBuffer(device, buffer, result); |
| 3977 | |
| 3978 | return result; |
| 3979 | } |
| 3980 | |
| 3981 | bool PreCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3982 | VkDevice device, |
| 3983 | const VkBufferViewCreateInfo* pCreateInfo) |
| 3984 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3985 | if(pCreateInfo != nullptr) |
| 3986 | { |
| 3987 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3988 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3989 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3990 | "vkCreateBufferView parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3991 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3992 | } |
| 3993 | if(pCreateInfo->viewType < VK_BUFFER_VIEW_TYPE_BEGIN_RANGE || |
| 3994 | pCreateInfo->viewType > VK_BUFFER_VIEW_TYPE_END_RANGE) |
| 3995 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3996 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3997 | "vkCreateBufferView parameter, VkBufferViewType pCreateInfo->viewType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3998 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3999 | } |
| 4000 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4001 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4002 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4003 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4004 | "vkCreateBufferView parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4005 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4006 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4007 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4008 | |
| 4009 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4010 | } |
| 4011 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4012 | bool PostCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4013 | VkDevice device, |
| 4014 | VkBufferView* pView, |
| 4015 | VkResult result) |
| 4016 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4017 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4018 | if(pView != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4019 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4020 | } |
| 4021 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4022 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4023 | { |
| 4024 | std::string reason = "vkCreateBufferView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4025 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4026 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4027 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4028 | |
| 4029 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4030 | } |
| 4031 | |
| 4032 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBufferView( |
| 4033 | VkDevice device, |
| 4034 | const VkBufferViewCreateInfo* pCreateInfo, |
| 4035 | VkBufferView* pView) |
| 4036 | { |
| 4037 | PreCreateBufferView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4038 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4039 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pView); |
| 4040 | |
| 4041 | PostCreateBufferView(device, pView, result); |
| 4042 | |
| 4043 | return result; |
| 4044 | } |
| 4045 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4046 | bool PostDestroyBufferView( |
| 4047 | VkDevice device, |
| 4048 | VkBufferView bufferView, |
| 4049 | VkResult result) |
| 4050 | { |
| 4051 | |
| 4052 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4053 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4054 | { |
| 4055 | std::string reason = "vkDestroyBufferView parameter, VkResult result, is " + EnumeratorString(result); |
| 4056 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4057 | return false; |
| 4058 | } |
| 4059 | |
| 4060 | return true; |
| 4061 | } |
| 4062 | |
| 4063 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyBufferView( |
| 4064 | VkDevice device, |
| 4065 | VkBufferView bufferView) |
| 4066 | { |
| 4067 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyBufferView(device, bufferView); |
| 4068 | |
| 4069 | PostDestroyBufferView(device, bufferView, result); |
| 4070 | |
| 4071 | return result; |
| 4072 | } |
| 4073 | |
| 4074 | bool PreCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4075 | VkDevice device, |
| 4076 | const VkImageCreateInfo* pCreateInfo) |
| 4077 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4078 | if(pCreateInfo != nullptr) |
| 4079 | { |
| 4080 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 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 | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4083 | "vkCreateImage parameter, VkStructureType pCreateInfo->sType, is an invalid 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->imageType < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 4087 | pCreateInfo->imageType > VK_IMAGE_TYPE_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 | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4090 | "vkCreateImage parameter, VkImageType pCreateInfo->imageType, is an 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->format < VK_FORMAT_BEGIN_RANGE || |
| 4094 | pCreateInfo->format > VK_FORMAT_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 | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4097 | "vkCreateImage parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4098 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4099 | } |
| 4100 | if(pCreateInfo->tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 4101 | pCreateInfo->tiling > VK_IMAGE_TILING_END_RANGE) |
| 4102 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4103 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4104 | "vkCreateImage parameter, VkImageTiling pCreateInfo->tiling, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4105 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4106 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4107 | if(pCreateInfo->sharingMode < VK_SHARING_MODE_BEGIN_RANGE || |
| 4108 | pCreateInfo->sharingMode > VK_SHARING_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4109 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4110 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4111 | "vkCreateImage parameter, VkSharingMode pCreateInfo->sharingMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4112 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4113 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4114 | if(pCreateInfo->pQueueFamilyIndices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4115 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4116 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4117 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4118 | |
| 4119 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4120 | } |
| 4121 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4122 | bool PostCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4123 | VkDevice device, |
| 4124 | VkImage* pImage, |
| 4125 | VkResult result) |
| 4126 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4127 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4128 | if(pImage != nullptr) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4129 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4130 | } |
| 4131 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4132 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4133 | { |
| 4134 | std::string reason = "vkCreateImage parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4135 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4136 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4137 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4138 | |
| 4139 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4140 | } |
| 4141 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4142 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImage( |
| 4143 | VkDevice device, |
| 4144 | const VkImageCreateInfo* pCreateInfo, |
| 4145 | VkImage* pImage) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4146 | { |
| 4147 | PreCreateImage(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4148 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4149 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pImage); |
| 4150 | |
| 4151 | PostCreateImage(device, pImage, result); |
| 4152 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4153 | return result; |
| 4154 | } |
| 4155 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4156 | bool PostDestroyImage( |
| 4157 | VkDevice device, |
| 4158 | VkImage image, |
| 4159 | VkResult result) |
| 4160 | { |
| 4161 | |
| 4162 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4163 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4164 | { |
| 4165 | std::string reason = "vkDestroyImage parameter, VkResult result, is " + EnumeratorString(result); |
| 4166 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4167 | return false; |
| 4168 | } |
| 4169 | |
| 4170 | return true; |
| 4171 | } |
| 4172 | |
| 4173 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyImage( |
| 4174 | VkDevice device, |
| 4175 | VkImage image) |
| 4176 | { |
| 4177 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyImage(device, image); |
| 4178 | |
| 4179 | PostDestroyImage(device, image, result); |
| 4180 | |
| 4181 | return result; |
| 4182 | } |
| 4183 | |
| 4184 | bool PreGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4185 | VkDevice device, |
| 4186 | const VkImageSubresource* pSubresource) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4187 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4188 | if(pSubresource != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4189 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4190 | if(pSubresource->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 4191 | pSubresource->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 4192 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4193 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4194 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4195 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4196 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4197 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4198 | |
| 4199 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4200 | } |
| 4201 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4202 | bool PostGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4203 | VkDevice device, |
| 4204 | VkImage image, |
| 4205 | VkSubresourceLayout* pLayout, |
| 4206 | VkResult result) |
| 4207 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4208 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4209 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4210 | if(pLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4211 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4212 | } |
| 4213 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4214 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4215 | { |
| 4216 | std::string reason = "vkGetImageSubresourceLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4217 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4218 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4219 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4220 | |
| 4221 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4222 | } |
| 4223 | |
| 4224 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout( |
| 4225 | VkDevice device, |
| 4226 | VkImage image, |
| 4227 | const VkImageSubresource* pSubresource, |
| 4228 | VkSubresourceLayout* pLayout) |
| 4229 | { |
| 4230 | PreGetImageSubresourceLayout(device, pSubresource); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4231 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4232 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
| 4233 | |
| 4234 | PostGetImageSubresourceLayout(device, image, pLayout, result); |
| 4235 | |
| 4236 | return result; |
| 4237 | } |
| 4238 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4239 | bool PreCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4240 | VkDevice device, |
| 4241 | const VkImageViewCreateInfo* pCreateInfo) |
| 4242 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4243 | if(pCreateInfo != nullptr) |
| 4244 | { |
| 4245 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4246 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4247 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4248 | "vkCreateImageView parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4249 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4250 | } |
| 4251 | if(pCreateInfo->viewType < VK_IMAGE_VIEW_TYPE_BEGIN_RANGE || |
| 4252 | pCreateInfo->viewType > VK_IMAGE_VIEW_TYPE_END_RANGE) |
| 4253 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4254 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4255 | "vkCreateImageView parameter, VkImageViewType pCreateInfo->viewType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4256 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4257 | } |
| 4258 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4259 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4260 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4261 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4262 | "vkCreateImageView parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4263 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4264 | } |
| 4265 | if(pCreateInfo->channels.r < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4266 | pCreateInfo->channels.r > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4267 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4268 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4269 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.r, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4270 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4271 | } |
| 4272 | if(pCreateInfo->channels.g < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4273 | pCreateInfo->channels.g > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4274 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4275 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4276 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.g, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4277 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4278 | } |
| 4279 | if(pCreateInfo->channels.b < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4280 | pCreateInfo->channels.b > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4281 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4282 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4283 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.b, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4284 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4285 | } |
| 4286 | if(pCreateInfo->channels.a < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 4287 | pCreateInfo->channels.a > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 4288 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4289 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4290 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.a, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4291 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4292 | } |
| 4293 | if(pCreateInfo->subresourceRange.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 4294 | pCreateInfo->subresourceRange.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 4295 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4296 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4297 | "vkCreateImageView parameter, VkImageAspect pCreateInfo->subresourceRange.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4298 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4299 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4300 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4301 | |
| 4302 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4303 | } |
| 4304 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4305 | bool PostCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4306 | VkDevice device, |
| 4307 | VkImageView* pView, |
| 4308 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4309 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4310 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4311 | if(pView != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4312 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4313 | } |
| 4314 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4315 | if(result < VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4316 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4317 | std::string reason = "vkCreateImageView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4318 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4319 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4320 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4321 | |
| 4322 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4323 | } |
| 4324 | |
| 4325 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImageView( |
| 4326 | VkDevice device, |
| 4327 | const VkImageViewCreateInfo* pCreateInfo, |
| 4328 | VkImageView* pView) |
| 4329 | { |
| 4330 | PreCreateImageView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4331 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4332 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pView); |
| 4333 | |
| 4334 | PostCreateImageView(device, pView, result); |
| 4335 | |
| 4336 | return result; |
| 4337 | } |
| 4338 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4339 | bool PostDestroyImageView( |
| 4340 | VkDevice device, |
| 4341 | VkImageView imageView, |
| 4342 | VkResult result) |
| 4343 | { |
| 4344 | |
| 4345 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4346 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4347 | { |
| 4348 | std::string reason = "vkDestroyImageView parameter, VkResult result, is " + EnumeratorString(result); |
| 4349 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4350 | return false; |
| 4351 | } |
| 4352 | |
| 4353 | return true; |
| 4354 | } |
| 4355 | |
| 4356 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyImageView( |
| 4357 | VkDevice device, |
| 4358 | VkImageView imageView) |
| 4359 | { |
| 4360 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyImageView(device, imageView); |
| 4361 | |
| 4362 | PostDestroyImageView(device, imageView, result); |
| 4363 | |
| 4364 | return result; |
| 4365 | } |
| 4366 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4367 | bool PreCreateAttachmentView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4368 | VkDevice device, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4369 | const VkAttachmentViewCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4370 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4371 | if(pCreateInfo != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4372 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4373 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4374 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4375 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4376 | "vkCreateAttachmentView parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 4377 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4378 | } |
| 4379 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 4380 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 4381 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4382 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4383 | "vkCreateAttachmentView parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
| 4384 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4385 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4386 | } |
| 4387 | |
| 4388 | return true; |
| 4389 | } |
| 4390 | |
| 4391 | bool PostCreateAttachmentView( |
| 4392 | VkDevice device, |
| 4393 | VkAttachmentView* pView, |
| 4394 | VkResult result) |
| 4395 | { |
| 4396 | |
| 4397 | if(pView != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4398 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4399 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4400 | |
| 4401 | if(result < VK_SUCCESS) |
| 4402 | { |
| 4403 | std::string reason = "vkCreateAttachmentView parameter, VkResult result, is " + EnumeratorString(result); |
| 4404 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4405 | return false; |
| 4406 | } |
| 4407 | |
| 4408 | return true; |
| 4409 | } |
| 4410 | |
| 4411 | VK_LAYER_EXPORT VkResult VKAPI vkCreateAttachmentView( |
| 4412 | VkDevice device, |
| 4413 | const VkAttachmentViewCreateInfo* pCreateInfo, |
| 4414 | VkAttachmentView* pView) |
| 4415 | { |
| 4416 | PreCreateAttachmentView(device, pCreateInfo); |
| 4417 | |
| 4418 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateAttachmentView(device, pCreateInfo, pView); |
| 4419 | |
| 4420 | PostCreateAttachmentView(device, pView, result); |
| 4421 | |
| 4422 | return result; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4423 | } |
| 4424 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4425 | bool PostDestroyAttachmentView( |
| 4426 | VkDevice device, |
| 4427 | VkAttachmentView attachmentView, |
| 4428 | VkResult result) |
| 4429 | { |
| 4430 | |
| 4431 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4432 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4433 | { |
| 4434 | std::string reason = "vkDestroyAttachmentView parameter, VkResult result, is " + EnumeratorString(result); |
| 4435 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4436 | return false; |
| 4437 | } |
| 4438 | |
| 4439 | return true; |
| 4440 | } |
| 4441 | |
| 4442 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyAttachmentView( |
| 4443 | VkDevice device, |
| 4444 | VkAttachmentView attachmentView) |
| 4445 | { |
| 4446 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyAttachmentView(device, attachmentView); |
| 4447 | |
| 4448 | PostDestroyAttachmentView(device, attachmentView, result); |
| 4449 | |
| 4450 | return result; |
| 4451 | } |
| 4452 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4453 | bool PostDestroyShaderModule( |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4454 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4455 | VkShaderModule shaderModule, |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4456 | VkResult result) |
| 4457 | { |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4458 | |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4459 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4460 | if(result < VK_SUCCESS) |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4461 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4462 | std::string reason = "vkDestroyShaderModule parameter, VkResult result, is " + EnumeratorString(result); |
| 4463 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4464 | return false; |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4465 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4466 | |
| 4467 | return true; |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4468 | } |
| 4469 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4470 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyShaderModule( |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4471 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4472 | VkShaderModule shaderModule) |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4473 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4474 | 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] | 4475 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4476 | PostDestroyShaderModule(device, shaderModule, result); |
Courtney Goeltzenleuchter | ee4027d | 2015-06-28 13:01:17 -0600 | [diff] [blame] | 4477 | |
| 4478 | return result; |
| 4479 | } |
| 4480 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4481 | bool PreCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4482 | VkDevice device, |
| 4483 | const VkShaderCreateInfo* pCreateInfo) |
| 4484 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4485 | if(pCreateInfo != nullptr) |
| 4486 | { |
| 4487 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SHADER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4488 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4489 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4490 | "vkCreateShader parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4491 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4492 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4493 | if(pCreateInfo->pName != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4494 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4495 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4496 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4497 | |
| 4498 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4499 | } |
| 4500 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4501 | bool PostCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4502 | VkDevice device, |
| 4503 | VkShader* pShader, |
| 4504 | VkResult result) |
| 4505 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4506 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4507 | if(pShader != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4508 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4509 | } |
| 4510 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4511 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4512 | { |
| 4513 | std::string reason = "vkCreateShader parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4514 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4515 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4516 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4517 | |
| 4518 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4519 | } |
| 4520 | |
| 4521 | VK_LAYER_EXPORT VkResult VKAPI vkCreateShader( |
| 4522 | VkDevice device, |
| 4523 | const VkShaderCreateInfo* pCreateInfo, |
| 4524 | VkShader* pShader) |
| 4525 | { |
| 4526 | PreCreateShader(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4527 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4528 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateShader(device, pCreateInfo, pShader); |
| 4529 | |
| 4530 | PostCreateShader(device, pShader, result); |
| 4531 | |
| 4532 | return result; |
| 4533 | } |
| 4534 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4535 | bool PostDestroyShader( |
| 4536 | VkDevice device, |
| 4537 | VkShader shader, |
| 4538 | VkResult result) |
| 4539 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4540 | |
| 4541 | |
| 4542 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4543 | { |
| 4544 | std::string reason = "vkDestroyShader parameter, VkResult result, is " + EnumeratorString(result); |
| 4545 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4546 | return false; |
| 4547 | } |
| 4548 | |
| 4549 | return true; |
| 4550 | } |
| 4551 | |
| 4552 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyShader( |
| 4553 | VkDevice device, |
| 4554 | VkShader shader) |
| 4555 | { |
| 4556 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyShader(device, shader); |
| 4557 | |
| 4558 | PostDestroyShader(device, shader, result); |
| 4559 | |
| 4560 | return result; |
| 4561 | } |
| 4562 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4563 | bool PreCreatePipelineCache( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4564 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4565 | const VkPipelineCacheCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4566 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4567 | if(pCreateInfo != nullptr) |
| 4568 | { |
| 4569 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4570 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4571 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4572 | "vkCreatePipelineCache parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4573 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4574 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4575 | if(pCreateInfo->initialData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4576 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4577 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4578 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4579 | |
| 4580 | return true; |
| 4581 | } |
| 4582 | |
| 4583 | bool PostCreatePipelineCache( |
| 4584 | VkDevice device, |
| 4585 | VkPipelineCache* pPipelineCache, |
| 4586 | VkResult result) |
| 4587 | { |
| 4588 | |
| 4589 | if(pPipelineCache != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4590 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4591 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4592 | |
| 4593 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4594 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4595 | std::string reason = "vkCreatePipelineCache parameter, VkResult result, is " + EnumeratorString(result); |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4596 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4597 | return false; |
| 4598 | } |
| 4599 | |
| 4600 | return true; |
| 4601 | } |
| 4602 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4603 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineCache( |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4604 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4605 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 4606 | VkPipelineCache* pPipelineCache) |
| 4607 | { |
| 4608 | PreCreatePipelineCache(device, pCreateInfo); |
| 4609 | |
| 4610 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineCache(device, pCreateInfo, pPipelineCache); |
| 4611 | |
| 4612 | PostCreatePipelineCache(device, pPipelineCache, result); |
| 4613 | |
| 4614 | return result; |
| 4615 | } |
| 4616 | |
| 4617 | bool PostDestroyPipelineCache( |
| 4618 | VkDevice device, |
| 4619 | VkPipelineCache pipelineCache, |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4620 | VkResult result) |
| 4621 | { |
| 4622 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4623 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4624 | if(result < VK_SUCCESS) |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4625 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4626 | std::string reason = "vkDestroyPipelineCache parameter, VkResult result, is " + EnumeratorString(result); |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 4627 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4628 | return false; |
| 4629 | } |
| 4630 | |
| 4631 | return true; |
| 4632 | } |
| 4633 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4634 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipelineCache( |
| 4635 | VkDevice device, |
| 4636 | VkPipelineCache pipelineCache) |
| 4637 | { |
| 4638 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipelineCache(device, pipelineCache); |
| 4639 | |
| 4640 | PostDestroyPipelineCache(device, pipelineCache, result); |
| 4641 | |
| 4642 | return result; |
| 4643 | } |
| 4644 | |
| 4645 | bool PostGetPipelineCacheSize( |
| 4646 | VkDevice device, |
| 4647 | VkPipelineCache pipelineCache) |
| 4648 | { |
| 4649 | |
| 4650 | |
| 4651 | return true; |
| 4652 | } |
| 4653 | |
| 4654 | VK_LAYER_EXPORT size_t VKAPI vkGetPipelineCacheSize( |
| 4655 | VkDevice device, |
| 4656 | VkPipelineCache pipelineCache) |
| 4657 | { |
Jeremy Hayes | a663c70 | 2015-07-31 12:54:58 -0600 | [diff] [blame] | 4658 | size_t result = get_dispatch_table(pc_device_table_map, device)->GetPipelineCacheSize(device, pipelineCache); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4659 | |
| 4660 | PostGetPipelineCacheSize(device, pipelineCache); |
Jeremy Hayes | a663c70 | 2015-07-31 12:54:58 -0600 | [diff] [blame] | 4661 | |
| 4662 | return result; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4663 | } |
| 4664 | |
| 4665 | bool PostGetPipelineCacheData( |
| 4666 | VkDevice device, |
| 4667 | VkPipelineCache pipelineCache, |
| 4668 | void* pData, |
| 4669 | VkResult result) |
| 4670 | { |
| 4671 | |
| 4672 | |
| 4673 | if(pData != nullptr) |
| 4674 | { |
| 4675 | } |
| 4676 | |
| 4677 | if(result < VK_SUCCESS) |
| 4678 | { |
| 4679 | std::string reason = "vkGetPipelineCacheData parameter, VkResult result, is " + EnumeratorString(result); |
| 4680 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4681 | return false; |
| 4682 | } |
| 4683 | |
| 4684 | return true; |
| 4685 | } |
| 4686 | |
| 4687 | VK_LAYER_EXPORT VkResult VKAPI vkGetPipelineCacheData( |
| 4688 | VkDevice device, |
| 4689 | VkPipelineCache pipelineCache, |
| 4690 | void* pData) |
| 4691 | { |
| 4692 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetPipelineCacheData(device, pipelineCache, pData); |
| 4693 | |
| 4694 | PostGetPipelineCacheData(device, pipelineCache, pData, result); |
| 4695 | |
| 4696 | return result; |
| 4697 | } |
| 4698 | |
| 4699 | bool PreMergePipelineCaches( |
| 4700 | VkDevice device, |
| 4701 | const VkPipelineCache* pSrcCaches) |
| 4702 | { |
| 4703 | if(pSrcCaches != nullptr) |
| 4704 | { |
| 4705 | } |
| 4706 | |
| 4707 | return true; |
| 4708 | } |
| 4709 | |
| 4710 | bool PostMergePipelineCaches( |
| 4711 | VkDevice device, |
| 4712 | VkPipelineCache destCache, |
| 4713 | uint32_t srcCacheCount, |
| 4714 | VkResult result) |
| 4715 | { |
| 4716 | |
| 4717 | |
| 4718 | |
| 4719 | if(result < VK_SUCCESS) |
| 4720 | { |
| 4721 | std::string reason = "vkMergePipelineCaches parameter, VkResult result, is " + EnumeratorString(result); |
| 4722 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4723 | return false; |
| 4724 | } |
| 4725 | |
| 4726 | return true; |
| 4727 | } |
| 4728 | |
| 4729 | VK_LAYER_EXPORT VkResult VKAPI vkMergePipelineCaches( |
| 4730 | VkDevice device, |
| 4731 | VkPipelineCache destCache, |
| 4732 | uint32_t srcCacheCount, |
| 4733 | const VkPipelineCache* pSrcCaches) |
| 4734 | { |
| 4735 | PreMergePipelineCaches(device, pSrcCaches); |
| 4736 | |
| 4737 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MergePipelineCaches(device, destCache, srcCacheCount, pSrcCaches); |
| 4738 | |
| 4739 | PostMergePipelineCaches(device, destCache, srcCacheCount, result); |
| 4740 | |
| 4741 | return result; |
| 4742 | } |
| 4743 | |
| 4744 | bool PreCreateGraphicsPipelines( |
| 4745 | VkDevice device, |
| 4746 | const VkGraphicsPipelineCreateInfo* pCreateInfos) |
| 4747 | { |
| 4748 | if(pCreateInfos != nullptr) |
| 4749 | { |
| 4750 | if(pCreateInfos->sType != VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO) |
| 4751 | { |
| 4752 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4753 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->sType, is an invalid enumerator"); |
| 4754 | return false; |
| 4755 | } |
| 4756 | if(pCreateInfos->pStages != nullptr) |
| 4757 | { |
| 4758 | if(pCreateInfos->pStages->sType != VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO) |
| 4759 | { |
| 4760 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4761 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pStages->sType, is an invalid enumerator"); |
| 4762 | return false; |
| 4763 | } |
| 4764 | if(pCreateInfos->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4765 | pCreateInfos->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4766 | { |
| 4767 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4768 | "vkCreateGraphicsPipelines parameter, VkShaderStage pCreateInfos->pStages->stage, is an unrecognized enumerator"); |
| 4769 | return false; |
| 4770 | } |
| 4771 | if(pCreateInfos->pStages->pSpecializationInfo != nullptr) |
| 4772 | { |
| 4773 | if(pCreateInfos->pStages->pSpecializationInfo->pMap != nullptr) |
| 4774 | { |
| 4775 | } |
| 4776 | if(pCreateInfos->pStages->pSpecializationInfo->pData != nullptr) |
| 4777 | { |
| 4778 | } |
| 4779 | } |
| 4780 | } |
| 4781 | if(pCreateInfos->pVertexInputState != nullptr) |
| 4782 | { |
| 4783 | if(pCreateInfos->pVertexInputState->sType != VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO) |
| 4784 | { |
| 4785 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4786 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pVertexInputState->sType, is an invalid enumerator"); |
| 4787 | return false; |
| 4788 | } |
| 4789 | if(pCreateInfos->pVertexInputState->pVertexBindingDescriptions != nullptr) |
| 4790 | { |
| 4791 | if(pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4792 | pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4793 | { |
| 4794 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4795 | "vkCreateGraphicsPipelines parameter, VkVertexInputStepRate pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate, is an unrecognized enumerator"); |
| 4796 | return false; |
| 4797 | } |
| 4798 | } |
| 4799 | if(pCreateInfos->pVertexInputState->pVertexAttributeDescriptions != nullptr) |
| 4800 | { |
| 4801 | if(pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4802 | pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4803 | { |
| 4804 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4805 | "vkCreateGraphicsPipelines parameter, VkFormat pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format, is an unrecognized enumerator"); |
| 4806 | return false; |
| 4807 | } |
| 4808 | } |
| 4809 | } |
| 4810 | if(pCreateInfos->pInputAssemblyState != nullptr) |
| 4811 | { |
| 4812 | if(pCreateInfos->pInputAssemblyState->sType != VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO) |
| 4813 | { |
| 4814 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4815 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pInputAssemblyState->sType, is an invalid enumerator"); |
| 4816 | return false; |
| 4817 | } |
| 4818 | if(pCreateInfos->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4819 | pCreateInfos->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
| 4820 | { |
| 4821 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4822 | "vkCreateGraphicsPipelines parameter, VkPrimitiveTopology pCreateInfos->pInputAssemblyState->topology, is an unrecognized enumerator"); |
| 4823 | return false; |
| 4824 | } |
| 4825 | } |
| 4826 | if(pCreateInfos->pTessellationState != nullptr) |
| 4827 | { |
| 4828 | if(pCreateInfos->pTessellationState->sType != VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO) |
| 4829 | { |
| 4830 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4831 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pTessellationState->sType, is an invalid enumerator"); |
| 4832 | return false; |
| 4833 | } |
| 4834 | } |
| 4835 | if(pCreateInfos->pViewportState != nullptr) |
| 4836 | { |
| 4837 | if(pCreateInfos->pViewportState->sType != VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO) |
| 4838 | { |
| 4839 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4840 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pViewportState->sType, is an invalid enumerator"); |
| 4841 | return false; |
| 4842 | } |
| 4843 | } |
| 4844 | if(pCreateInfos->pRasterState != nullptr) |
| 4845 | { |
| 4846 | if(pCreateInfos->pRasterState->sType != VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO) |
| 4847 | { |
| 4848 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4849 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pRasterState->sType, is an invalid enumerator"); |
| 4850 | return false; |
| 4851 | } |
| 4852 | if(pCreateInfos->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 4853 | pCreateInfos->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
| 4854 | { |
| 4855 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4856 | "vkCreateGraphicsPipelines parameter, VkFillMode pCreateInfos->pRasterState->fillMode, is an unrecognized enumerator"); |
| 4857 | return false; |
| 4858 | } |
| 4859 | if(pCreateInfos->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 4860 | pCreateInfos->pRasterState->cullMode > VK_CULL_MODE_END_RANGE) |
| 4861 | { |
| 4862 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4863 | "vkCreateGraphicsPipelines parameter, VkCullMode pCreateInfos->pRasterState->cullMode, is an unrecognized enumerator"); |
| 4864 | return false; |
| 4865 | } |
| 4866 | if(pCreateInfos->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 4867 | pCreateInfos->pRasterState->frontFace > VK_FRONT_FACE_END_RANGE) |
| 4868 | { |
| 4869 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4870 | "vkCreateGraphicsPipelines parameter, VkFrontFace pCreateInfos->pRasterState->frontFace, is an unrecognized enumerator"); |
| 4871 | return false; |
| 4872 | } |
| 4873 | } |
| 4874 | if(pCreateInfos->pMultisampleState != nullptr) |
| 4875 | { |
| 4876 | if(pCreateInfos->pMultisampleState->sType != VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO) |
| 4877 | { |
| 4878 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4879 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pMultisampleState->sType, is an invalid enumerator"); |
| 4880 | return false; |
| 4881 | } |
| 4882 | } |
| 4883 | if(pCreateInfos->pDepthStencilState != nullptr) |
| 4884 | { |
| 4885 | if(pCreateInfos->pDepthStencilState->sType != VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO) |
| 4886 | { |
| 4887 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4888 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pDepthStencilState->sType, is an invalid enumerator"); |
| 4889 | return false; |
| 4890 | } |
| 4891 | if(pCreateInfos->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4892 | pCreateInfos->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4893 | { |
| 4894 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4895 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->depthCompareOp, is an unrecognized enumerator"); |
| 4896 | return false; |
| 4897 | } |
| 4898 | if(pCreateInfos->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4899 | pCreateInfos->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 4900 | { |
| 4901 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4902 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilFailOp, is an unrecognized enumerator"); |
| 4903 | return false; |
| 4904 | } |
| 4905 | if(pCreateInfos->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4906 | pCreateInfos->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 4907 | { |
| 4908 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4909 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilPassOp, is an unrecognized enumerator"); |
| 4910 | return false; |
| 4911 | } |
| 4912 | if(pCreateInfos->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4913 | pCreateInfos->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 4914 | { |
| 4915 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4916 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilDepthFailOp, is an unrecognized enumerator"); |
| 4917 | return false; |
| 4918 | } |
| 4919 | if(pCreateInfos->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4920 | pCreateInfos->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4921 | { |
| 4922 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4923 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->front.stencilCompareOp, is an unrecognized enumerator"); |
| 4924 | return false; |
| 4925 | } |
| 4926 | if(pCreateInfos->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4927 | pCreateInfos->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 4928 | { |
| 4929 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4930 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilFailOp, is an unrecognized enumerator"); |
| 4931 | return false; |
| 4932 | } |
| 4933 | if(pCreateInfos->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4934 | pCreateInfos->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 4935 | { |
| 4936 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4937 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilPassOp, is an unrecognized enumerator"); |
| 4938 | return false; |
| 4939 | } |
| 4940 | if(pCreateInfos->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4941 | pCreateInfos->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 4942 | { |
| 4943 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4944 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilDepthFailOp, is an unrecognized enumerator"); |
| 4945 | return false; |
| 4946 | } |
| 4947 | if(pCreateInfos->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4948 | pCreateInfos->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4949 | { |
| 4950 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4951 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->back.stencilCompareOp, is an unrecognized enumerator"); |
| 4952 | return false; |
| 4953 | } |
| 4954 | } |
| 4955 | if(pCreateInfos->pColorBlendState != nullptr) |
| 4956 | { |
| 4957 | if(pCreateInfos->pColorBlendState->sType != VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO) |
| 4958 | { |
| 4959 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4960 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pColorBlendState->sType, is an invalid enumerator"); |
| 4961 | return false; |
| 4962 | } |
| 4963 | if(pCreateInfos->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 4964 | pCreateInfos->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
| 4965 | { |
| 4966 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4967 | "vkCreateGraphicsPipelines parameter, VkLogicOp pCreateInfos->pColorBlendState->logicOp, is an unrecognized enumerator"); |
| 4968 | return false; |
| 4969 | } |
| 4970 | if(pCreateInfos->pColorBlendState->pAttachments != nullptr) |
| 4971 | { |
| 4972 | if(pCreateInfos->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4973 | pCreateInfos->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
| 4974 | { |
| 4975 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4976 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->srcBlendColor, is an unrecognized enumerator"); |
| 4977 | return false; |
| 4978 | } |
| 4979 | if(pCreateInfos->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4980 | pCreateInfos->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
| 4981 | { |
| 4982 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4983 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->destBlendColor, is an unrecognized enumerator"); |
| 4984 | return false; |
| 4985 | } |
| 4986 | if(pCreateInfos->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 4987 | pCreateInfos->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
| 4988 | { |
| 4989 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4990 | "vkCreateGraphicsPipelines parameter, VkBlendOp pCreateInfos->pColorBlendState->pAttachments->blendOpColor, is an unrecognized enumerator"); |
| 4991 | return false; |
| 4992 | } |
| 4993 | if(pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4994 | pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
| 4995 | { |
| 4996 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4997 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha, is an unrecognized enumerator"); |
| 4998 | return false; |
| 4999 | } |
| 5000 | if(pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 5001 | pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
| 5002 | { |
| 5003 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5004 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha, is an unrecognized enumerator"); |
| 5005 | return false; |
| 5006 | } |
| 5007 | if(pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 5008 | pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
| 5009 | { |
| 5010 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5011 | "vkCreateGraphicsPipelines parameter, VkBlendOp pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha, is an unrecognized enumerator"); |
| 5012 | return false; |
| 5013 | } |
| 5014 | } |
| 5015 | } |
Jeremy Hayes | f06ae82 | 2015-07-31 14:16:20 -0600 | [diff] [blame] | 5016 | if(pCreateInfos->renderPass == VK_NULL_HANDLE) |
| 5017 | { |
| 5018 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5019 | "vkCreateGraphicsPipelines parameter, VkRenderPass pCreateInfos->renderPass, is null pointer"); |
| 5020 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5021 | } |
| 5022 | |
| 5023 | return true; |
| 5024 | } |
| 5025 | |
| 5026 | bool PostCreateGraphicsPipelines( |
| 5027 | VkDevice device, |
| 5028 | VkPipelineCache pipelineCache, |
| 5029 | uint32_t count, |
| 5030 | VkPipeline* pPipelines, |
| 5031 | VkResult result) |
| 5032 | { |
| 5033 | |
| 5034 | |
| 5035 | |
| 5036 | if(pPipelines != nullptr) |
| 5037 | { |
| 5038 | } |
| 5039 | |
| 5040 | if(result < VK_SUCCESS) |
| 5041 | { |
| 5042 | std::string reason = "vkCreateGraphicsPipelines parameter, VkResult result, is " + EnumeratorString(result); |
| 5043 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5044 | return false; |
| 5045 | } |
| 5046 | |
| 5047 | return true; |
| 5048 | } |
| 5049 | |
| 5050 | VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines( |
| 5051 | VkDevice device, |
| 5052 | VkPipelineCache pipelineCache, |
| 5053 | uint32_t count, |
| 5054 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 5055 | VkPipeline* pPipelines) |
| 5056 | { |
| 5057 | PreCreateGraphicsPipelines(device, pCreateInfos); |
| 5058 | |
| 5059 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
| 5060 | |
| 5061 | PostCreateGraphicsPipelines(device, pipelineCache, count, pPipelines, result); |
| 5062 | |
| 5063 | return result; |
| 5064 | } |
| 5065 | |
| 5066 | bool PreCreateComputePipelines( |
| 5067 | VkDevice device, |
| 5068 | const VkComputePipelineCreateInfo* pCreateInfos) |
| 5069 | { |
| 5070 | if(pCreateInfos != nullptr) |
| 5071 | { |
| 5072 | if(pCreateInfos->sType != VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO) |
| 5073 | { |
| 5074 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5075 | "vkCreateComputePipelines parameter, VkStructureType pCreateInfos->sType, is an invalid enumerator"); |
| 5076 | return false; |
| 5077 | } |
| 5078 | if(pCreateInfos->cs.sType != VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO) |
| 5079 | { |
| 5080 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5081 | "vkCreateComputePipelines parameter, VkStructureType pCreateInfos->cs.sType, is an invalid enumerator"); |
| 5082 | return false; |
| 5083 | } |
| 5084 | if(pCreateInfos->cs.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 5085 | pCreateInfos->cs.stage > VK_SHADER_STAGE_END_RANGE) |
| 5086 | { |
| 5087 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5088 | "vkCreateComputePipelines parameter, VkShaderStage pCreateInfos->cs.stage, is an unrecognized enumerator"); |
| 5089 | return false; |
| 5090 | } |
| 5091 | if(pCreateInfos->cs.pSpecializationInfo != nullptr) |
| 5092 | { |
| 5093 | if(pCreateInfos->cs.pSpecializationInfo->pMap != nullptr) |
| 5094 | { |
| 5095 | } |
| 5096 | if(pCreateInfos->cs.pSpecializationInfo->pData != nullptr) |
| 5097 | { |
| 5098 | } |
| 5099 | } |
| 5100 | } |
| 5101 | |
| 5102 | return true; |
| 5103 | } |
| 5104 | |
| 5105 | bool PostCreateComputePipelines( |
| 5106 | VkDevice device, |
| 5107 | VkPipelineCache pipelineCache, |
| 5108 | uint32_t count, |
| 5109 | VkPipeline* pPipelines, |
| 5110 | VkResult result) |
| 5111 | { |
| 5112 | |
| 5113 | |
| 5114 | |
| 5115 | if(pPipelines != nullptr) |
| 5116 | { |
| 5117 | } |
| 5118 | |
| 5119 | if(result < VK_SUCCESS) |
| 5120 | { |
| 5121 | std::string reason = "vkCreateComputePipelines parameter, VkResult result, is " + EnumeratorString(result); |
| 5122 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5123 | return false; |
| 5124 | } |
| 5125 | |
| 5126 | return true; |
| 5127 | } |
| 5128 | |
| 5129 | VK_LAYER_EXPORT VkResult VKAPI vkCreateComputePipelines( |
| 5130 | VkDevice device, |
| 5131 | VkPipelineCache pipelineCache, |
| 5132 | uint32_t count, |
| 5133 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 5134 | VkPipeline* pPipelines) |
| 5135 | { |
| 5136 | PreCreateComputePipelines(device, pCreateInfos); |
| 5137 | |
| 5138 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
| 5139 | |
| 5140 | PostCreateComputePipelines(device, pipelineCache, count, pPipelines, result); |
| 5141 | |
| 5142 | return result; |
| 5143 | } |
| 5144 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 5145 | bool PostDestroyPipeline( |
| 5146 | VkDevice device, |
| 5147 | VkPipeline pipeline, |
| 5148 | VkResult result) |
| 5149 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5150 | |
| 5151 | |
| 5152 | if(result < VK_SUCCESS) |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 5153 | { |
| 5154 | std::string reason = "vkDestroyPipeline parameter, VkResult result, is " + EnumeratorString(result); |
| 5155 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5156 | return false; |
| 5157 | } |
| 5158 | |
| 5159 | return true; |
| 5160 | } |
| 5161 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5162 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipeline( |
| 5163 | VkDevice device, |
| 5164 | VkPipeline pipeline) |
| 5165 | { |
| 5166 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipeline(device, pipeline); |
| 5167 | |
| 5168 | PostDestroyPipeline(device, pipeline, result); |
| 5169 | |
| 5170 | return result; |
| 5171 | } |
| 5172 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5173 | bool PreCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5174 | VkDevice device, |
| 5175 | const VkPipelineLayoutCreateInfo* pCreateInfo) |
| 5176 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5177 | if(pCreateInfo != nullptr) |
| 5178 | { |
| 5179 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5180 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5181 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5182 | "vkCreatePipelineLayout parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 5183 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5184 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5185 | if(pCreateInfo->pSetLayouts != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5186 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5187 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5188 | if(pCreateInfo->pPushConstantRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5189 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5190 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5191 | } |
| 5192 | |
| 5193 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5194 | } |
| 5195 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5196 | bool PostCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5197 | VkDevice device, |
| 5198 | VkPipelineLayout* pPipelineLayout, |
| 5199 | VkResult result) |
| 5200 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5201 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5202 | if(pPipelineLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5203 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5204 | } |
| 5205 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5206 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5207 | { |
| 5208 | std::string reason = "vkCreatePipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5209 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5210 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5211 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5212 | |
| 5213 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5214 | } |
| 5215 | |
| 5216 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineLayout( |
| 5217 | VkDevice device, |
| 5218 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 5219 | VkPipelineLayout* pPipelineLayout) |
| 5220 | { |
| 5221 | PreCreatePipelineLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5222 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5223 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); |
| 5224 | |
| 5225 | PostCreatePipelineLayout(device, pPipelineLayout, result); |
| 5226 | |
| 5227 | return result; |
| 5228 | } |
| 5229 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5230 | bool PostDestroyPipelineLayout( |
| 5231 | VkDevice device, |
| 5232 | VkPipelineLayout pipelineLayout, |
| 5233 | VkResult result) |
| 5234 | { |
| 5235 | |
| 5236 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5237 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5238 | { |
| 5239 | std::string reason = "vkDestroyPipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
| 5240 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5241 | return false; |
| 5242 | } |
| 5243 | |
| 5244 | return true; |
| 5245 | } |
| 5246 | |
| 5247 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyPipelineLayout( |
| 5248 | VkDevice device, |
| 5249 | VkPipelineLayout pipelineLayout) |
| 5250 | { |
| 5251 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyPipelineLayout(device, pipelineLayout); |
| 5252 | |
| 5253 | PostDestroyPipelineLayout(device, pipelineLayout, result); |
| 5254 | |
| 5255 | return result; |
| 5256 | } |
| 5257 | |
| 5258 | bool PreCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5259 | VkDevice device, |
| 5260 | const VkSamplerCreateInfo* pCreateInfo) |
| 5261 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5262 | if(pCreateInfo != nullptr) |
| 5263 | { |
| 5264 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5265 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5266 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5267 | "vkCreateSampler parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5268 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5269 | } |
| 5270 | if(pCreateInfo->magFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5271 | pCreateInfo->magFilter > VK_TEX_FILTER_END_RANGE) |
| 5272 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5273 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5274 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->magFilter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5275 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5276 | } |
| 5277 | if(pCreateInfo->minFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5278 | pCreateInfo->minFilter > VK_TEX_FILTER_END_RANGE) |
| 5279 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5280 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5281 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->minFilter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5282 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5283 | } |
| 5284 | if(pCreateInfo->mipMode < VK_TEX_MIPMAP_MODE_BEGIN_RANGE || |
| 5285 | pCreateInfo->mipMode > VK_TEX_MIPMAP_MODE_END_RANGE) |
| 5286 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5287 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5288 | "vkCreateSampler parameter, VkTexMipmapMode pCreateInfo->mipMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5289 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5290 | } |
| 5291 | if(pCreateInfo->addressU < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5292 | pCreateInfo->addressU > VK_TEX_ADDRESS_END_RANGE) |
| 5293 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5294 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5295 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressU, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5296 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5297 | } |
| 5298 | if(pCreateInfo->addressV < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5299 | pCreateInfo->addressV > VK_TEX_ADDRESS_END_RANGE) |
| 5300 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5301 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5302 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressV, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5303 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5304 | } |
| 5305 | if(pCreateInfo->addressW < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 5306 | pCreateInfo->addressW > VK_TEX_ADDRESS_END_RANGE) |
| 5307 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5308 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5309 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressW, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5310 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5311 | } |
| 5312 | if(pCreateInfo->compareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 5313 | pCreateInfo->compareOp > VK_COMPARE_OP_END_RANGE) |
| 5314 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5315 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5316 | "vkCreateSampler parameter, VkCompareOp pCreateInfo->compareOp, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5317 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5318 | } |
| 5319 | if(pCreateInfo->borderColor < VK_BORDER_COLOR_BEGIN_RANGE || |
| 5320 | pCreateInfo->borderColor > VK_BORDER_COLOR_END_RANGE) |
| 5321 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5322 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5323 | "vkCreateSampler parameter, VkBorderColor pCreateInfo->borderColor, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5324 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5325 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5326 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5327 | |
| 5328 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5329 | } |
| 5330 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5331 | bool PostCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5332 | VkDevice device, |
| 5333 | VkSampler* pSampler, |
| 5334 | VkResult result) |
| 5335 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5336 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5337 | if(pSampler != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5338 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5339 | } |
| 5340 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5341 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5342 | { |
| 5343 | std::string reason = "vkCreateSampler parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5344 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5345 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5346 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5347 | |
| 5348 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5349 | } |
| 5350 | |
| 5351 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSampler( |
| 5352 | VkDevice device, |
| 5353 | const VkSamplerCreateInfo* pCreateInfo, |
| 5354 | VkSampler* pSampler) |
| 5355 | { |
| 5356 | PreCreateSampler(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5357 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5358 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pSampler); |
| 5359 | |
| 5360 | PostCreateSampler(device, pSampler, result); |
| 5361 | |
| 5362 | return result; |
| 5363 | } |
| 5364 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5365 | bool PostDestroySampler( |
| 5366 | VkDevice device, |
| 5367 | VkSampler sampler, |
| 5368 | VkResult result) |
| 5369 | { |
| 5370 | |
| 5371 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5372 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5373 | { |
| 5374 | std::string reason = "vkDestroySampler parameter, VkResult result, is " + EnumeratorString(result); |
| 5375 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5376 | return false; |
| 5377 | } |
| 5378 | |
| 5379 | return true; |
| 5380 | } |
| 5381 | |
| 5382 | VK_LAYER_EXPORT VkResult VKAPI vkDestroySampler( |
| 5383 | VkDevice device, |
| 5384 | VkSampler sampler) |
| 5385 | { |
| 5386 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroySampler(device, sampler); |
| 5387 | |
| 5388 | PostDestroySampler(device, sampler, result); |
| 5389 | |
| 5390 | return result; |
| 5391 | } |
| 5392 | |
| 5393 | bool PreCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5394 | VkDevice device, |
| 5395 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo) |
| 5396 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5397 | if(pCreateInfo != nullptr) |
| 5398 | { |
| 5399 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5400 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5401 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5402 | "vkCreateDescriptorSetLayout parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5403 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5404 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5405 | if(pCreateInfo->pBinding != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5406 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5407 | if(pCreateInfo->pBinding->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5408 | pCreateInfo->pBinding->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5409 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5410 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5411 | "vkCreateDescriptorSetLayout parameter, VkDescriptorType pCreateInfo->pBinding->descriptorType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5412 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5413 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5414 | if(pCreateInfo->pBinding->pImmutableSamplers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5415 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5416 | } |
| 5417 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5418 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5419 | |
| 5420 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5421 | } |
| 5422 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5423 | bool PostCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5424 | VkDevice device, |
| 5425 | VkDescriptorSetLayout* pSetLayout, |
| 5426 | VkResult result) |
| 5427 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5428 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5429 | if(pSetLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5430 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5431 | } |
| 5432 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5433 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5434 | { |
| 5435 | std::string reason = "vkCreateDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5436 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5437 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5438 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5439 | |
| 5440 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5441 | } |
| 5442 | |
| 5443 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout( |
| 5444 | VkDevice device, |
| 5445 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5446 | VkDescriptorSetLayout* pSetLayout) |
| 5447 | { |
| 5448 | PreCreateDescriptorSetLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5449 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5450 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout); |
| 5451 | |
| 5452 | PostCreateDescriptorSetLayout(device, pSetLayout, result); |
| 5453 | |
| 5454 | return result; |
| 5455 | } |
| 5456 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5457 | bool PostDestroyDescriptorSetLayout( |
| 5458 | VkDevice device, |
| 5459 | VkDescriptorSetLayout descriptorSetLayout, |
| 5460 | VkResult result) |
| 5461 | { |
| 5462 | |
| 5463 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5464 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5465 | { |
| 5466 | std::string reason = "vkDestroyDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
| 5467 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5468 | return false; |
| 5469 | } |
| 5470 | |
| 5471 | return true; |
| 5472 | } |
| 5473 | |
| 5474 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDescriptorSetLayout( |
| 5475 | VkDevice device, |
| 5476 | VkDescriptorSetLayout descriptorSetLayout) |
| 5477 | { |
| 5478 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorSetLayout(device, descriptorSetLayout); |
| 5479 | |
| 5480 | PostDestroyDescriptorSetLayout(device, descriptorSetLayout, result); |
| 5481 | |
| 5482 | return result; |
| 5483 | } |
| 5484 | |
| 5485 | bool PreCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5486 | VkDevice device, |
| 5487 | const VkDescriptorPoolCreateInfo* pCreateInfo) |
| 5488 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5489 | if(pCreateInfo != nullptr) |
| 5490 | { |
| 5491 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5492 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5493 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5494 | "vkCreateDescriptorPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5495 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5496 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5497 | if(pCreateInfo->pTypeCount != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5498 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5499 | if(pCreateInfo->pTypeCount->type < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5500 | pCreateInfo->pTypeCount->type > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5501 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5502 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5503 | "vkCreateDescriptorPool parameter, VkDescriptorType pCreateInfo->pTypeCount->type, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5504 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5505 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5506 | } |
| 5507 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5508 | |
| 5509 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5510 | } |
| 5511 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5512 | bool PostCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5513 | VkDevice device, |
| 5514 | VkDescriptorPoolUsage poolUsage, |
| 5515 | uint32_t maxSets, |
| 5516 | VkDescriptorPool* pDescriptorPool, |
| 5517 | VkResult result) |
| 5518 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5519 | |
| 5520 | if(poolUsage < VK_DESCRIPTOR_POOL_USAGE_BEGIN_RANGE || |
| 5521 | poolUsage > VK_DESCRIPTOR_POOL_USAGE_END_RANGE) |
| 5522 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5523 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5524 | "vkCreateDescriptorPool parameter, VkDescriptorPoolUsage poolUsage, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5525 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5526 | } |
| 5527 | |
| 5528 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5529 | if(pDescriptorPool != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5530 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5531 | } |
| 5532 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5533 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5534 | { |
| 5535 | std::string reason = "vkCreateDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5536 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5537 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5538 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5539 | |
| 5540 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5541 | } |
| 5542 | |
| 5543 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool( |
| 5544 | VkDevice device, |
| 5545 | VkDescriptorPoolUsage poolUsage, |
| 5546 | uint32_t maxSets, |
| 5547 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 5548 | VkDescriptorPool* pDescriptorPool) |
| 5549 | { |
| 5550 | PreCreateDescriptorPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5551 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5552 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool); |
| 5553 | |
| 5554 | PostCreateDescriptorPool(device, poolUsage, maxSets, pDescriptorPool, result); |
| 5555 | |
| 5556 | return result; |
| 5557 | } |
| 5558 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5559 | bool PostDestroyDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5560 | VkDevice device, |
| 5561 | VkDescriptorPool descriptorPool, |
| 5562 | VkResult result) |
| 5563 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5564 | |
| 5565 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5566 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5567 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5568 | std::string reason = "vkDestroyDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
| 5569 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5570 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5571 | } |
| 5572 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5573 | return true; |
| 5574 | } |
| 5575 | |
| 5576 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDescriptorPool( |
| 5577 | VkDevice device, |
| 5578 | VkDescriptorPool descriptorPool) |
| 5579 | { |
| 5580 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorPool(device, descriptorPool); |
| 5581 | |
| 5582 | PostDestroyDescriptorPool(device, descriptorPool, result); |
| 5583 | |
| 5584 | return result; |
| 5585 | } |
| 5586 | |
| 5587 | bool PostResetDescriptorPool( |
| 5588 | VkDevice device, |
| 5589 | VkDescriptorPool descriptorPool, |
| 5590 | VkResult result) |
| 5591 | { |
| 5592 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5593 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5594 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5595 | { |
| 5596 | std::string reason = "vkResetDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5597 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 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 | |
| 5604 | VK_LAYER_EXPORT VkResult VKAPI vkResetDescriptorPool( |
| 5605 | VkDevice device, |
| 5606 | VkDescriptorPool descriptorPool) |
| 5607 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5608 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool); |
| 5609 | |
| 5610 | PostResetDescriptorPool(device, descriptorPool, result); |
| 5611 | |
| 5612 | return result; |
| 5613 | } |
| 5614 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5615 | bool PreAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5616 | VkDevice device, |
| 5617 | const VkDescriptorSetLayout* pSetLayouts) |
| 5618 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5619 | if(pSetLayouts != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5620 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5621 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5622 | |
| 5623 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5624 | } |
| 5625 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5626 | bool PostAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5627 | VkDevice device, |
| 5628 | VkDescriptorPool descriptorPool, |
| 5629 | VkDescriptorSetUsage setUsage, |
| 5630 | uint32_t count, |
| 5631 | VkDescriptorSet* pDescriptorSets, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5632 | VkResult result) |
| 5633 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5634 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5635 | |
| 5636 | if(setUsage < VK_DESCRIPTOR_SET_USAGE_BEGIN_RANGE || |
| 5637 | setUsage > VK_DESCRIPTOR_SET_USAGE_END_RANGE) |
| 5638 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5639 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5640 | "vkAllocDescriptorSets parameter, VkDescriptorSetUsage setUsage, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5641 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5642 | } |
| 5643 | |
| 5644 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5645 | if(pDescriptorSets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5646 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5647 | } |
| 5648 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5649 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5650 | { |
| 5651 | std::string reason = "vkAllocDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5652 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5653 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5654 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5655 | |
| 5656 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5657 | } |
| 5658 | |
| 5659 | VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets( |
| 5660 | VkDevice device, |
| 5661 | VkDescriptorPool descriptorPool, |
| 5662 | VkDescriptorSetUsage setUsage, |
| 5663 | uint32_t count, |
| 5664 | const VkDescriptorSetLayout* pSetLayouts, |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 5665 | VkDescriptorSet* pDescriptorSets) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5666 | { |
| 5667 | PreAllocDescriptorSets(device, pSetLayouts); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5668 | |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 5669 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5670 | |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 5671 | PostAllocDescriptorSets(device, descriptorPool, setUsage, count, pDescriptorSets, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5672 | |
| 5673 | return result; |
| 5674 | } |
| 5675 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5676 | bool PreFreeDescriptorSets( |
| 5677 | VkDevice device, |
| 5678 | const VkDescriptorSet* pDescriptorSets) |
| 5679 | { |
| 5680 | if(pDescriptorSets != nullptr) |
| 5681 | { |
| 5682 | } |
| 5683 | |
| 5684 | return true; |
| 5685 | } |
| 5686 | |
| 5687 | bool PostFreeDescriptorSets( |
| 5688 | VkDevice device, |
| 5689 | VkDescriptorPool descriptorPool, |
| 5690 | uint32_t count, |
| 5691 | VkResult result) |
| 5692 | { |
| 5693 | |
| 5694 | |
| 5695 | |
| 5696 | if(result < VK_SUCCESS) |
| 5697 | { |
| 5698 | std::string reason = "vkFreeDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
| 5699 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5700 | return false; |
| 5701 | } |
| 5702 | |
| 5703 | return true; |
| 5704 | } |
| 5705 | |
| 5706 | VK_LAYER_EXPORT VkResult VKAPI vkFreeDescriptorSets( |
| 5707 | VkDevice device, |
| 5708 | VkDescriptorPool descriptorPool, |
| 5709 | uint32_t count, |
| 5710 | const VkDescriptorSet* pDescriptorSets) |
| 5711 | { |
| 5712 | PreFreeDescriptorSets(device, pDescriptorSets); |
| 5713 | |
| 5714 | VkResult result = get_dispatch_table(pc_device_table_map, device)->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets); |
| 5715 | |
| 5716 | PostFreeDescriptorSets(device, descriptorPool, count, result); |
| 5717 | |
| 5718 | return result; |
| 5719 | } |
| 5720 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5721 | bool PreUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5722 | VkDevice device, |
| 5723 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 5724 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 5725 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5726 | if(pDescriptorWrites != nullptr) |
| 5727 | { |
| 5728 | if(pDescriptorWrites->sType != VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5729 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5730 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5731 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorWrites->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5732 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5733 | } |
| 5734 | if(pDescriptorWrites->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 5735 | pDescriptorWrites->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 5736 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5737 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5738 | "vkUpdateDescriptorSets parameter, VkDescriptorType pDescriptorWrites->descriptorType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5739 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5740 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5741 | if(pDescriptorWrites->pDescriptors != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5742 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5743 | if(pDescriptorWrites->pDescriptors->imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5744 | pDescriptorWrites->pDescriptors->imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5745 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5746 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5747 | "vkUpdateDescriptorSets parameter, VkImageLayout pDescriptorWrites->pDescriptors->imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5748 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5749 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5750 | } |
| 5751 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5752 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5753 | if(pDescriptorCopies != nullptr) |
| 5754 | { |
| 5755 | if(pDescriptorCopies->sType != VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5756 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5757 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5758 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorCopies->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5759 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5760 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5761 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5762 | |
| 5763 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5764 | } |
| 5765 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5766 | bool PostUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5767 | VkDevice device, |
| 5768 | uint32_t writeCount, |
| 5769 | uint32_t copyCount, |
| 5770 | VkResult result) |
| 5771 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5772 | |
| 5773 | |
| 5774 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5775 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5776 | { |
| 5777 | std::string reason = "vkUpdateDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5778 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5779 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5780 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5781 | |
| 5782 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5783 | } |
| 5784 | |
| 5785 | VK_LAYER_EXPORT VkResult VKAPI vkUpdateDescriptorSets( |
| 5786 | VkDevice device, |
| 5787 | uint32_t writeCount, |
| 5788 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 5789 | uint32_t copyCount, |
| 5790 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 5791 | { |
| 5792 | PreUpdateDescriptorSets(device, pDescriptorWrites, pDescriptorCopies); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5793 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5794 | VkResult result = get_dispatch_table(pc_device_table_map, device)->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies); |
| 5795 | |
| 5796 | PostUpdateDescriptorSets(device, writeCount, copyCount, result); |
| 5797 | |
| 5798 | return result; |
| 5799 | } |
| 5800 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5801 | bool PreCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5802 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5803 | const VkDynamicViewportStateCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5804 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5805 | if(pCreateInfo != nullptr) |
| 5806 | { |
| 5807 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_VIEWPORT_STATE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5808 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5809 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5810 | "vkCreateDynamicViewportState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5811 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5812 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5813 | if(pCreateInfo->pViewports != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5814 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5815 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5816 | if(pCreateInfo->pScissors != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5817 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5818 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5819 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5820 | |
| 5821 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5822 | } |
| 5823 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5824 | bool PostCreateDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5825 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5826 | VkDynamicViewportState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5827 | VkResult result) |
| 5828 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5829 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5830 | if(pState != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5831 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5832 | } |
| 5833 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5834 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5835 | { |
| 5836 | std::string reason = "vkCreateDynamicViewportState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5837 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5838 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5839 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5840 | |
| 5841 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5842 | } |
| 5843 | |
| 5844 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicViewportState( |
| 5845 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5846 | const VkDynamicViewportStateCreateInfo* pCreateInfo, |
| 5847 | VkDynamicViewportState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5848 | { |
| 5849 | PreCreateDynamicViewportState(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)->CreateDynamicViewportState(device, pCreateInfo, pState); |
| 5852 | |
| 5853 | PostCreateDynamicViewportState(device, pState, result); |
| 5854 | |
| 5855 | return result; |
| 5856 | } |
| 5857 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5858 | bool PostDestroyDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5859 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5860 | VkDynamicViewportState dynamicViewportState, |
| 5861 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5862 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5863 | |
| 5864 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 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 = "vkDestroyDynamicViewportState 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 vkDestroyDynamicViewportState( |
| 5876 | VkDevice device, |
| 5877 | VkDynamicViewportState dynamicViewportState) |
| 5878 | { |
| 5879 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicViewportState(device, dynamicViewportState); |
| 5880 | |
| 5881 | PostDestroyDynamicViewportState(device, dynamicViewportState, result); |
| 5882 | |
| 5883 | return result; |
| 5884 | } |
| 5885 | |
| 5886 | bool PreCreateDynamicRasterState( |
| 5887 | VkDevice device, |
| 5888 | const VkDynamicRasterStateCreateInfo* pCreateInfo) |
| 5889 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5890 | if(pCreateInfo != nullptr) |
| 5891 | { |
| 5892 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_RASTER_STATE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5893 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5894 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5895 | "vkCreateDynamicRasterState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5896 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5897 | } |
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 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5903 | bool PostCreateDynamicRasterState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5904 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5905 | VkDynamicRasterState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5906 | VkResult result) |
| 5907 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5908 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5909 | if(pState != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5910 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5911 | } |
| 5912 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5913 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5914 | { |
| 5915 | std::string reason = "vkCreateDynamicRasterState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5916 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5917 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5918 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5919 | |
| 5920 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5921 | } |
| 5922 | |
| 5923 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicRasterState( |
| 5924 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5925 | const VkDynamicRasterStateCreateInfo* pCreateInfo, |
| 5926 | VkDynamicRasterState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5927 | { |
| 5928 | PreCreateDynamicRasterState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5929 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5930 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicRasterState(device, pCreateInfo, pState); |
| 5931 | |
| 5932 | PostCreateDynamicRasterState(device, pState, result); |
| 5933 | |
| 5934 | return result; |
| 5935 | } |
| 5936 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5937 | bool PostDestroyDynamicRasterState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5938 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5939 | VkDynamicRasterState dynamicRasterState, |
| 5940 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5941 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5942 | |
| 5943 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5944 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5945 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5946 | std::string reason = "vkDestroyDynamicRasterState parameter, VkResult result, is " + EnumeratorString(result); |
| 5947 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5948 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5949 | } |
| 5950 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5951 | return true; |
| 5952 | } |
| 5953 | |
| 5954 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicRasterState( |
| 5955 | VkDevice device, |
| 5956 | VkDynamicRasterState dynamicRasterState) |
| 5957 | { |
| 5958 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicRasterState(device, dynamicRasterState); |
| 5959 | |
| 5960 | PostDestroyDynamicRasterState(device, dynamicRasterState, result); |
| 5961 | |
| 5962 | return result; |
| 5963 | } |
| 5964 | |
| 5965 | bool PreCreateDynamicColorBlendState( |
| 5966 | VkDevice device, |
| 5967 | const VkDynamicColorBlendStateCreateInfo* pCreateInfo) |
| 5968 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5969 | if(pCreateInfo != nullptr) |
| 5970 | { |
| 5971 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_COLOR_BLEND_STATE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5972 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5973 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5974 | "vkCreateDynamicColorBlendState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5975 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5976 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5977 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5978 | |
| 5979 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5980 | } |
| 5981 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5982 | bool PostCreateDynamicColorBlendState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5983 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5984 | VkDynamicColorBlendState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5985 | VkResult result) |
| 5986 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5987 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5988 | if(pState != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5989 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5990 | } |
| 5991 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5992 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5993 | { |
| 5994 | std::string reason = "vkCreateDynamicColorBlendState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5995 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5996 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5997 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5998 | |
| 5999 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6000 | } |
| 6001 | |
| 6002 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicColorBlendState( |
| 6003 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6004 | const VkDynamicColorBlendStateCreateInfo* pCreateInfo, |
| 6005 | VkDynamicColorBlendState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6006 | { |
| 6007 | PreCreateDynamicColorBlendState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6008 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6009 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicColorBlendState(device, pCreateInfo, pState); |
| 6010 | |
| 6011 | PostCreateDynamicColorBlendState(device, pState, result); |
| 6012 | |
| 6013 | return result; |
| 6014 | } |
| 6015 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6016 | bool PostDestroyDynamicColorBlendState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6017 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6018 | VkDynamicColorBlendState dynamicColorBlendState, |
| 6019 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6020 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6021 | |
| 6022 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6023 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6024 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6025 | std::string reason = "vkDestroyDynamicColorBlendState parameter, VkResult result, is " + EnumeratorString(result); |
| 6026 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6027 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6028 | } |
| 6029 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6030 | return true; |
| 6031 | } |
| 6032 | |
| 6033 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicColorBlendState( |
| 6034 | VkDevice device, |
| 6035 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6036 | { |
| 6037 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicColorBlendState(device, dynamicColorBlendState); |
| 6038 | |
| 6039 | PostDestroyDynamicColorBlendState(device, dynamicColorBlendState, result); |
| 6040 | |
| 6041 | return result; |
| 6042 | } |
| 6043 | |
| 6044 | bool PreCreateDynamicDepthStencilState( |
| 6045 | VkDevice device, |
| 6046 | const VkDynamicDepthStencilStateCreateInfo* pCreateInfo) |
| 6047 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6048 | if(pCreateInfo != nullptr) |
| 6049 | { |
| 6050 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_STENCIL_STATE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6051 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6052 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6053 | "vkCreateDynamicDepthStencilState parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6054 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6055 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6056 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6057 | |
| 6058 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6059 | } |
| 6060 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6061 | bool PostCreateDynamicDepthStencilState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6062 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6063 | VkDynamicDepthStencilState* pState, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6064 | VkResult result) |
| 6065 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6066 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6067 | if(pState != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6068 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6069 | } |
| 6070 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6071 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6072 | { |
| 6073 | std::string reason = "vkCreateDynamicDepthStencilState parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6074 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6075 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6076 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6077 | |
| 6078 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6079 | } |
| 6080 | |
| 6081 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDynamicDepthStencilState( |
| 6082 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6083 | const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, |
| 6084 | VkDynamicDepthStencilState* pState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6085 | { |
| 6086 | PreCreateDynamicDepthStencilState(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6087 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6088 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDynamicDepthStencilState(device, pCreateInfo, pState); |
| 6089 | |
| 6090 | PostCreateDynamicDepthStencilState(device, pState, result); |
| 6091 | |
| 6092 | return result; |
| 6093 | } |
| 6094 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6095 | bool PostDestroyDynamicDepthStencilState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6096 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6097 | VkDynamicDepthStencilState dynamicDepthStencilState, |
| 6098 | VkResult result) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6099 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6100 | |
| 6101 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6102 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6103 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6104 | std::string reason = "vkDestroyDynamicDepthStencilState parameter, VkResult result, is " + EnumeratorString(result); |
| 6105 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6106 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6107 | } |
| 6108 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6109 | return true; |
| 6110 | } |
| 6111 | |
| 6112 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyDynamicDepthStencilState( |
| 6113 | VkDevice device, |
| 6114 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6115 | { |
| 6116 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyDynamicDepthStencilState(device, dynamicDepthStencilState); |
| 6117 | |
| 6118 | PostDestroyDynamicDepthStencilState(device, dynamicDepthStencilState, result); |
| 6119 | |
| 6120 | return result; |
| 6121 | } |
| 6122 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6123 | bool PreCreateFramebuffer( |
| 6124 | VkDevice device, |
| 6125 | const VkFramebufferCreateInfo* pCreateInfo) |
| 6126 | { |
| 6127 | if(pCreateInfo != nullptr) |
| 6128 | { |
| 6129 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO) |
| 6130 | { |
| 6131 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6132 | "vkCreateFramebuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 6133 | return false; |
| 6134 | } |
| 6135 | if(pCreateInfo->pAttachments != nullptr) |
| 6136 | { |
| 6137 | if(pCreateInfo->pAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6138 | pCreateInfo->pAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6139 | { |
| 6140 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6141 | "vkCreateFramebuffer parameter, VkImageLayout pCreateInfo->pAttachments->layout, is an unrecognized enumerator"); |
| 6142 | return false; |
| 6143 | } |
| 6144 | } |
| 6145 | } |
| 6146 | |
| 6147 | return true; |
| 6148 | } |
| 6149 | |
| 6150 | bool PostCreateFramebuffer( |
| 6151 | VkDevice device, |
| 6152 | VkFramebuffer* pFramebuffer, |
| 6153 | VkResult result) |
| 6154 | { |
| 6155 | |
| 6156 | if(pFramebuffer != nullptr) |
| 6157 | { |
| 6158 | } |
| 6159 | |
| 6160 | if(result < VK_SUCCESS) |
| 6161 | { |
| 6162 | std::string reason = "vkCreateFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 6163 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6164 | return false; |
| 6165 | } |
| 6166 | |
| 6167 | return true; |
| 6168 | } |
| 6169 | |
| 6170 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFramebuffer( |
| 6171 | VkDevice device, |
| 6172 | const VkFramebufferCreateInfo* pCreateInfo, |
| 6173 | VkFramebuffer* pFramebuffer) |
| 6174 | { |
| 6175 | PreCreateFramebuffer(device, pCreateInfo); |
| 6176 | |
| 6177 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pFramebuffer); |
| 6178 | |
| 6179 | PostCreateFramebuffer(device, pFramebuffer, result); |
| 6180 | |
| 6181 | return result; |
| 6182 | } |
| 6183 | |
| 6184 | bool PostDestroyFramebuffer( |
| 6185 | VkDevice device, |
| 6186 | VkFramebuffer framebuffer, |
| 6187 | VkResult result) |
| 6188 | { |
| 6189 | |
| 6190 | |
| 6191 | if(result < VK_SUCCESS) |
| 6192 | { |
| 6193 | std::string reason = "vkDestroyFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 6194 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6195 | return false; |
| 6196 | } |
| 6197 | |
| 6198 | return true; |
| 6199 | } |
| 6200 | |
| 6201 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyFramebuffer( |
| 6202 | VkDevice device, |
| 6203 | VkFramebuffer framebuffer) |
| 6204 | { |
| 6205 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyFramebuffer(device, framebuffer); |
| 6206 | |
| 6207 | PostDestroyFramebuffer(device, framebuffer, result); |
| 6208 | |
| 6209 | return result; |
| 6210 | } |
| 6211 | |
| 6212 | bool PreCreateRenderPass( |
| 6213 | VkDevice device, |
| 6214 | const VkRenderPassCreateInfo* pCreateInfo) |
| 6215 | { |
| 6216 | if(pCreateInfo != nullptr) |
| 6217 | { |
| 6218 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO) |
| 6219 | { |
| 6220 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6221 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 6222 | return false; |
| 6223 | } |
| 6224 | if(pCreateInfo->pAttachments != nullptr) |
| 6225 | { |
| 6226 | if(pCreateInfo->pAttachments->sType != VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION) |
| 6227 | { |
| 6228 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6229 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pAttachments->sType, is an invalid enumerator"); |
| 6230 | return false; |
| 6231 | } |
| 6232 | if(pCreateInfo->pAttachments->format < VK_FORMAT_BEGIN_RANGE || |
| 6233 | pCreateInfo->pAttachments->format > VK_FORMAT_END_RANGE) |
| 6234 | { |
| 6235 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6236 | "vkCreateRenderPass parameter, VkFormat pCreateInfo->pAttachments->format, is an unrecognized enumerator"); |
| 6237 | return false; |
| 6238 | } |
| 6239 | if(pCreateInfo->pAttachments->loadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || |
| 6240 | pCreateInfo->pAttachments->loadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 6241 | { |
| 6242 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6243 | "vkCreateRenderPass parameter, VkAttachmentLoadOp pCreateInfo->pAttachments->loadOp, is an unrecognized enumerator"); |
| 6244 | return false; |
| 6245 | } |
| 6246 | if(pCreateInfo->pAttachments->storeOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || |
| 6247 | pCreateInfo->pAttachments->storeOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 6248 | { |
| 6249 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6250 | "vkCreateRenderPass parameter, VkAttachmentStoreOp pCreateInfo->pAttachments->storeOp, is an unrecognized enumerator"); |
| 6251 | return false; |
| 6252 | } |
| 6253 | if(pCreateInfo->pAttachments->stencilLoadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || |
| 6254 | pCreateInfo->pAttachments->stencilLoadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 6255 | { |
| 6256 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6257 | "vkCreateRenderPass parameter, VkAttachmentLoadOp pCreateInfo->pAttachments->stencilLoadOp, is an unrecognized enumerator"); |
| 6258 | return false; |
| 6259 | } |
| 6260 | if(pCreateInfo->pAttachments->stencilStoreOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || |
| 6261 | pCreateInfo->pAttachments->stencilStoreOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 6262 | { |
| 6263 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6264 | "vkCreateRenderPass parameter, VkAttachmentStoreOp pCreateInfo->pAttachments->stencilStoreOp, is an unrecognized enumerator"); |
| 6265 | return false; |
| 6266 | } |
| 6267 | if(pCreateInfo->pAttachments->initialLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6268 | pCreateInfo->pAttachments->initialLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6269 | { |
| 6270 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6271 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pAttachments->initialLayout, is an unrecognized enumerator"); |
| 6272 | return false; |
| 6273 | } |
| 6274 | if(pCreateInfo->pAttachments->finalLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6275 | pCreateInfo->pAttachments->finalLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6276 | { |
| 6277 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6278 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pAttachments->finalLayout, is an unrecognized enumerator"); |
| 6279 | return false; |
| 6280 | } |
| 6281 | } |
| 6282 | if(pCreateInfo->pSubpasses != nullptr) |
| 6283 | { |
| 6284 | if(pCreateInfo->pSubpasses->sType != VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION) |
| 6285 | { |
| 6286 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6287 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pSubpasses->sType, is an invalid enumerator"); |
| 6288 | return false; |
| 6289 | } |
| 6290 | if(pCreateInfo->pSubpasses->pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6291 | pCreateInfo->pSubpasses->pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6292 | { |
| 6293 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6294 | "vkCreateRenderPass parameter, VkPipelineBindPoint pCreateInfo->pSubpasses->pipelineBindPoint, is an unrecognized enumerator"); |
| 6295 | return false; |
| 6296 | } |
| 6297 | if(pCreateInfo->pSubpasses->inputAttachments != nullptr) |
| 6298 | { |
| 6299 | if(pCreateInfo->pSubpasses->inputAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6300 | pCreateInfo->pSubpasses->inputAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6301 | { |
| 6302 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6303 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->inputAttachments->layout, is an unrecognized enumerator"); |
| 6304 | return false; |
| 6305 | } |
| 6306 | } |
| 6307 | if(pCreateInfo->pSubpasses->colorAttachments != nullptr) |
| 6308 | { |
| 6309 | if(pCreateInfo->pSubpasses->colorAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6310 | pCreateInfo->pSubpasses->colorAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6311 | { |
| 6312 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6313 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->colorAttachments->layout, is an unrecognized enumerator"); |
| 6314 | return false; |
| 6315 | } |
| 6316 | } |
| 6317 | if(pCreateInfo->pSubpasses->resolveAttachments != nullptr) |
| 6318 | { |
| 6319 | if(pCreateInfo->pSubpasses->resolveAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6320 | pCreateInfo->pSubpasses->resolveAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6321 | { |
| 6322 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6323 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->resolveAttachments->layout, is an unrecognized enumerator"); |
| 6324 | return false; |
| 6325 | } |
| 6326 | } |
| 6327 | if(pCreateInfo->pSubpasses->depthStencilAttachment.layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6328 | pCreateInfo->pSubpasses->depthStencilAttachment.layout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6329 | { |
| 6330 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6331 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->depthStencilAttachment.layout, is an unrecognized enumerator"); |
| 6332 | return false; |
| 6333 | } |
| 6334 | if(pCreateInfo->pSubpasses->preserveAttachments != nullptr) |
| 6335 | { |
| 6336 | if(pCreateInfo->pSubpasses->preserveAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6337 | pCreateInfo->pSubpasses->preserveAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6338 | { |
| 6339 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6340 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->preserveAttachments->layout, is an unrecognized enumerator"); |
| 6341 | return false; |
| 6342 | } |
| 6343 | } |
| 6344 | } |
| 6345 | if(pCreateInfo->pDependencies != nullptr) |
| 6346 | { |
| 6347 | if(pCreateInfo->pDependencies->sType != VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY) |
| 6348 | { |
| 6349 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6350 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pDependencies->sType, is an invalid enumerator"); |
| 6351 | return false; |
| 6352 | } |
| 6353 | } |
| 6354 | } |
| 6355 | |
| 6356 | return true; |
| 6357 | } |
| 6358 | |
| 6359 | bool PostCreateRenderPass( |
| 6360 | VkDevice device, |
| 6361 | VkRenderPass* pRenderPass, |
| 6362 | VkResult result) |
| 6363 | { |
| 6364 | |
| 6365 | if(pRenderPass != nullptr) |
| 6366 | { |
| 6367 | } |
| 6368 | |
| 6369 | if(result < VK_SUCCESS) |
| 6370 | { |
| 6371 | std::string reason = "vkCreateRenderPass parameter, VkResult result, is " + EnumeratorString(result); |
| 6372 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6373 | return false; |
| 6374 | } |
| 6375 | |
| 6376 | return true; |
| 6377 | } |
| 6378 | |
| 6379 | VK_LAYER_EXPORT VkResult VKAPI vkCreateRenderPass( |
| 6380 | VkDevice device, |
| 6381 | const VkRenderPassCreateInfo* pCreateInfo, |
| 6382 | VkRenderPass* pRenderPass) |
| 6383 | { |
| 6384 | PreCreateRenderPass(device, pCreateInfo); |
| 6385 | |
| 6386 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pRenderPass); |
| 6387 | |
| 6388 | PostCreateRenderPass(device, pRenderPass, result); |
| 6389 | |
| 6390 | return result; |
| 6391 | } |
| 6392 | |
| 6393 | bool PostDestroyRenderPass( |
| 6394 | VkDevice device, |
| 6395 | VkRenderPass renderPass, |
| 6396 | VkResult result) |
| 6397 | { |
| 6398 | |
| 6399 | |
| 6400 | if(result < VK_SUCCESS) |
| 6401 | { |
| 6402 | std::string reason = "vkDestroyRenderPass parameter, VkResult result, is " + EnumeratorString(result); |
| 6403 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6404 | return false; |
| 6405 | } |
| 6406 | |
| 6407 | return true; |
| 6408 | } |
| 6409 | |
| 6410 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyRenderPass( |
| 6411 | VkDevice device, |
| 6412 | VkRenderPass renderPass) |
| 6413 | { |
| 6414 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyRenderPass(device, renderPass); |
| 6415 | |
| 6416 | PostDestroyRenderPass(device, renderPass, result); |
| 6417 | |
| 6418 | return result; |
| 6419 | } |
| 6420 | |
| 6421 | bool PostGetRenderAreaGranularity( |
| 6422 | VkDevice device, |
| 6423 | VkRenderPass renderPass, |
| 6424 | VkExtent2D* pGranularity, |
| 6425 | VkResult result) |
| 6426 | { |
| 6427 | |
| 6428 | |
| 6429 | if(pGranularity != nullptr) |
| 6430 | { |
| 6431 | } |
| 6432 | |
| 6433 | if(result < VK_SUCCESS) |
| 6434 | { |
| 6435 | std::string reason = "vkGetRenderAreaGranularity parameter, VkResult result, is " + EnumeratorString(result); |
| 6436 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6437 | return false; |
| 6438 | } |
| 6439 | |
| 6440 | return true; |
| 6441 | } |
| 6442 | |
| 6443 | VK_LAYER_EXPORT VkResult VKAPI vkGetRenderAreaGranularity( |
| 6444 | VkDevice device, |
| 6445 | VkRenderPass renderPass, |
| 6446 | VkExtent2D* pGranularity) |
| 6447 | { |
| 6448 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetRenderAreaGranularity(device, renderPass, pGranularity); |
| 6449 | |
| 6450 | PostGetRenderAreaGranularity(device, renderPass, pGranularity, result); |
| 6451 | |
| 6452 | return result; |
| 6453 | } |
| 6454 | |
| 6455 | bool PreCreateCommandPool( |
| 6456 | VkDevice device, |
| 6457 | const VkCmdPoolCreateInfo* pCreateInfo) |
| 6458 | { |
| 6459 | if(pCreateInfo != nullptr) |
| 6460 | { |
| 6461 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO) |
| 6462 | { |
| 6463 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6464 | "vkCreateCommandPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 6465 | return false; |
| 6466 | } |
| 6467 | } |
| 6468 | |
| 6469 | return true; |
| 6470 | } |
| 6471 | |
| 6472 | bool PostCreateCommandPool( |
| 6473 | VkDevice device, |
| 6474 | VkCmdPool* pCmdPool, |
| 6475 | VkResult result) |
| 6476 | { |
| 6477 | |
| 6478 | if(pCmdPool != nullptr) |
| 6479 | { |
| 6480 | } |
| 6481 | |
| 6482 | if(result < VK_SUCCESS) |
| 6483 | { |
| 6484 | std::string reason = "vkCreateCommandPool parameter, VkResult result, is " + EnumeratorString(result); |
| 6485 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6486 | return false; |
| 6487 | } |
| 6488 | |
| 6489 | return true; |
| 6490 | } |
| 6491 | |
| 6492 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandPool( |
| 6493 | VkDevice device, |
| 6494 | const VkCmdPoolCreateInfo* pCreateInfo, |
| 6495 | VkCmdPool* pCmdPool) |
| 6496 | { |
| 6497 | PreCreateCommandPool(device, pCreateInfo); |
| 6498 | |
| 6499 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandPool(device, pCreateInfo, pCmdPool); |
| 6500 | |
| 6501 | PostCreateCommandPool(device, pCmdPool, result); |
| 6502 | |
| 6503 | return result; |
| 6504 | } |
| 6505 | |
| 6506 | bool PostDestroyCommandPool( |
| 6507 | VkDevice device, |
| 6508 | VkCmdPool cmdPool, |
| 6509 | VkResult result) |
| 6510 | { |
| 6511 | |
| 6512 | |
| 6513 | if(result < VK_SUCCESS) |
| 6514 | { |
| 6515 | std::string reason = "vkDestroyCommandPool parameter, VkResult result, is " + EnumeratorString(result); |
| 6516 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6517 | return false; |
| 6518 | } |
| 6519 | |
| 6520 | return true; |
| 6521 | } |
| 6522 | |
| 6523 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyCommandPool( |
| 6524 | VkDevice device, |
| 6525 | VkCmdPool cmdPool) |
| 6526 | { |
| 6527 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyCommandPool(device, cmdPool); |
| 6528 | |
| 6529 | PostDestroyCommandPool(device, cmdPool, result); |
| 6530 | |
| 6531 | return result; |
| 6532 | } |
| 6533 | |
| 6534 | bool PostResetCommandPool( |
| 6535 | VkDevice device, |
| 6536 | VkCmdPool cmdPool, |
| 6537 | VkCmdPoolResetFlags flags, |
| 6538 | VkResult result) |
| 6539 | { |
| 6540 | |
| 6541 | |
| 6542 | |
| 6543 | if(result < VK_SUCCESS) |
| 6544 | { |
| 6545 | std::string reason = "vkResetCommandPool parameter, VkResult result, is " + EnumeratorString(result); |
| 6546 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6547 | return false; |
| 6548 | } |
| 6549 | |
| 6550 | return true; |
| 6551 | } |
| 6552 | |
| 6553 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandPool( |
| 6554 | VkDevice device, |
| 6555 | VkCmdPool cmdPool, |
| 6556 | VkCmdPoolResetFlags flags) |
| 6557 | { |
| 6558 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetCommandPool(device, cmdPool, flags); |
| 6559 | |
| 6560 | PostResetCommandPool(device, cmdPool, flags, result); |
| 6561 | |
| 6562 | return result; |
| 6563 | } |
| 6564 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6565 | bool PreCreateCommandBuffer( |
| 6566 | VkDevice device, |
| 6567 | const VkCmdBufferCreateInfo* pCreateInfo) |
| 6568 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6569 | if(pCreateInfo != nullptr) |
| 6570 | { |
| 6571 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6572 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6573 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6574 | "vkCreateCommandBuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6575 | return false; |
| 6576 | } |
| 6577 | if(pCreateInfo->level < VK_CMD_BUFFER_LEVEL_BEGIN_RANGE || |
| 6578 | pCreateInfo->level > VK_CMD_BUFFER_LEVEL_END_RANGE) |
| 6579 | { |
| 6580 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6581 | "vkCreateCommandBuffer parameter, VkCmdBufferLevel pCreateInfo->level, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6582 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6583 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6584 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6585 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6586 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6587 | } |
| 6588 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6589 | bool PostCreateCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6590 | VkDevice device, |
| 6591 | VkCmdBuffer* pCmdBuffer, |
| 6592 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6593 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6594 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6595 | if(pCmdBuffer != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6596 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6597 | } |
| 6598 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6599 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6600 | { |
| 6601 | std::string reason = "vkCreateCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6602 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6603 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6604 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6605 | |
| 6606 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6607 | } |
| 6608 | |
| 6609 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandBuffer( |
| 6610 | VkDevice device, |
| 6611 | const VkCmdBufferCreateInfo* pCreateInfo, |
| 6612 | VkCmdBuffer* pCmdBuffer) |
| 6613 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6614 | PreCreateCommandBuffer(device, pCreateInfo); |
| 6615 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6616 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 6617 | |
| 6618 | PostCreateCommandBuffer(device, pCmdBuffer, result); |
| 6619 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6620 | return result; |
| 6621 | } |
| 6622 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6623 | bool PostDestroyCommandBuffer( |
| 6624 | VkDevice device, |
| 6625 | VkCmdBuffer commandBuffer, |
| 6626 | VkResult result) |
| 6627 | { |
| 6628 | |
| 6629 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6630 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6631 | { |
| 6632 | std::string reason = "vkDestroyCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 6633 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6634 | return false; |
| 6635 | } |
| 6636 | |
| 6637 | return true; |
| 6638 | } |
| 6639 | |
| 6640 | VK_LAYER_EXPORT VkResult VKAPI vkDestroyCommandBuffer( |
| 6641 | VkDevice device, |
| 6642 | VkCmdBuffer commandBuffer) |
| 6643 | { |
| 6644 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DestroyCommandBuffer(device, commandBuffer); |
| 6645 | |
| 6646 | PostDestroyCommandBuffer(device, commandBuffer, result); |
| 6647 | |
| 6648 | return result; |
| 6649 | } |
| 6650 | |
| 6651 | bool PreBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6652 | VkCmdBuffer cmdBuffer, |
| 6653 | const VkCmdBufferBeginInfo* pBeginInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6654 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6655 | if(pBeginInfo != nullptr) |
| 6656 | { |
| 6657 | if(pBeginInfo->sType != VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6658 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6659 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6660 | "vkBeginCommandBuffer parameter, VkStructureType pBeginInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6661 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6662 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6663 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6664 | |
| 6665 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6666 | } |
| 6667 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6668 | bool PostBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6669 | VkCmdBuffer cmdBuffer, |
| 6670 | VkResult result) |
| 6671 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6672 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6673 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6674 | { |
| 6675 | std::string reason = "vkBeginCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6676 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6677 | return false; |
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 | |
| 6680 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6681 | } |
| 6682 | |
| 6683 | VK_LAYER_EXPORT VkResult VKAPI vkBeginCommandBuffer( |
| 6684 | VkCmdBuffer cmdBuffer, |
| 6685 | const VkCmdBufferBeginInfo* pBeginInfo) |
| 6686 | { |
| 6687 | PreBeginCommandBuffer(cmdBuffer, pBeginInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6688 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6689 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->BeginCommandBuffer(cmdBuffer, pBeginInfo); |
| 6690 | |
| 6691 | PostBeginCommandBuffer(cmdBuffer, result); |
| 6692 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6693 | return result; |
| 6694 | } |
| 6695 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6696 | bool PostEndCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6697 | VkCmdBuffer cmdBuffer, |
| 6698 | VkResult result) |
| 6699 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6700 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6701 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6702 | { |
| 6703 | std::string reason = "vkEndCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6704 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6705 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6706 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6707 | |
| 6708 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6709 | } |
| 6710 | |
| 6711 | VK_LAYER_EXPORT VkResult VKAPI vkEndCommandBuffer( |
| 6712 | VkCmdBuffer cmdBuffer) |
| 6713 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6714 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->EndCommandBuffer(cmdBuffer); |
| 6715 | |
| 6716 | PostEndCommandBuffer(cmdBuffer, result); |
| 6717 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6718 | return result; |
| 6719 | } |
| 6720 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6721 | bool PostResetCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6722 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6723 | VkCmdBufferResetFlags flags, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6724 | VkResult result) |
| 6725 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6726 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6727 | |
| 6728 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6729 | { |
| 6730 | std::string reason = "vkResetCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6731 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 6732 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6733 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6734 | |
| 6735 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6736 | } |
| 6737 | |
| 6738 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandBuffer( |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 6739 | VkCmdBuffer cmdBuffer, |
| 6740 | VkCmdBufferResetFlags flags) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6741 | { |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 6742 | 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] | 6743 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6744 | PostResetCommandBuffer(cmdBuffer, flags, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6745 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6746 | return result; |
| 6747 | } |
| 6748 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6749 | bool PostCmdBindPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6750 | VkCmdBuffer cmdBuffer, |
| 6751 | VkPipelineBindPoint pipelineBindPoint, |
| 6752 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6753 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6754 | |
| 6755 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6756 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6757 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6758 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6759 | "vkCmdBindPipeline parameter, VkPipelineBindPoint pipelineBindPoint, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6760 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6761 | } |
| 6762 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6763 | |
| 6764 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6765 | } |
| 6766 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6767 | VK_LAYER_EXPORT void VKAPI vkCmdBindPipeline( |
| 6768 | VkCmdBuffer cmdBuffer, |
| 6769 | VkPipelineBindPoint pipelineBindPoint, |
| 6770 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6771 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6772 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 6773 | |
| 6774 | PostCmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 6775 | } |
| 6776 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6777 | bool PostCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6778 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6779 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6780 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6781 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6782 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6783 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6784 | } |
| 6785 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6786 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicViewportState( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6787 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6788 | VkDynamicViewportState dynamicViewportState) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6789 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6790 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6791 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6792 | PostCmdBindDynamicViewportState(cmdBuffer, dynamicViewportState); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6793 | } |
| 6794 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6795 | bool PostCmdBindDynamicRasterState( |
| 6796 | VkCmdBuffer cmdBuffer, |
| 6797 | VkDynamicRasterState dynamicRasterState) |
| 6798 | { |
| 6799 | |
| 6800 | |
| 6801 | return true; |
| 6802 | } |
| 6803 | |
| 6804 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicRasterState( |
| 6805 | VkCmdBuffer cmdBuffer, |
| 6806 | VkDynamicRasterState dynamicRasterState) |
| 6807 | { |
| 6808 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicRasterState(cmdBuffer, dynamicRasterState); |
| 6809 | |
| 6810 | PostCmdBindDynamicRasterState(cmdBuffer, dynamicRasterState); |
| 6811 | } |
| 6812 | |
| 6813 | bool PostCmdBindDynamicColorBlendState( |
| 6814 | VkCmdBuffer cmdBuffer, |
| 6815 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6816 | { |
| 6817 | |
| 6818 | |
| 6819 | return true; |
| 6820 | } |
| 6821 | |
| 6822 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicColorBlendState( |
| 6823 | VkCmdBuffer cmdBuffer, |
| 6824 | VkDynamicColorBlendState dynamicColorBlendState) |
| 6825 | { |
| 6826 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState); |
| 6827 | |
| 6828 | PostCmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState); |
| 6829 | } |
| 6830 | |
| 6831 | bool PostCmdBindDynamicDepthStencilState( |
| 6832 | VkCmdBuffer cmdBuffer, |
| 6833 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6834 | { |
| 6835 | |
| 6836 | |
| 6837 | return true; |
| 6838 | } |
| 6839 | |
| 6840 | VK_LAYER_EXPORT void VKAPI vkCmdBindDynamicDepthStencilState( |
| 6841 | VkCmdBuffer cmdBuffer, |
| 6842 | VkDynamicDepthStencilState dynamicDepthStencilState) |
| 6843 | { |
| 6844 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState); |
| 6845 | |
| 6846 | PostCmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState); |
| 6847 | } |
| 6848 | |
| 6849 | bool PreCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6850 | VkCmdBuffer cmdBuffer, |
| 6851 | const VkDescriptorSet* pDescriptorSets, |
| 6852 | const uint32_t* pDynamicOffsets) |
| 6853 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6854 | if(pDescriptorSets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6855 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6856 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6857 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6858 | if(pDynamicOffsets != nullptr) |
| 6859 | { |
| 6860 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6861 | |
| 6862 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6863 | } |
| 6864 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6865 | bool PostCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6866 | VkCmdBuffer cmdBuffer, |
| 6867 | VkPipelineBindPoint pipelineBindPoint, |
| 6868 | VkPipelineLayout layout, |
| 6869 | uint32_t firstSet, |
| 6870 | uint32_t setCount, |
| 6871 | uint32_t dynamicOffsetCount) |
| 6872 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6873 | |
| 6874 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 6875 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 6876 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6877 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6878 | "vkCmdBindDescriptorSets parameter, VkPipelineBindPoint pipelineBindPoint, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6879 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6880 | } |
| 6881 | |
| 6882 | |
| 6883 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6884 | |
| 6885 | |
| 6886 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6887 | } |
| 6888 | |
| 6889 | VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets( |
| 6890 | VkCmdBuffer cmdBuffer, |
| 6891 | VkPipelineBindPoint pipelineBindPoint, |
| 6892 | VkPipelineLayout layout, |
| 6893 | uint32_t firstSet, |
| 6894 | uint32_t setCount, |
| 6895 | const VkDescriptorSet* pDescriptorSets, |
| 6896 | uint32_t dynamicOffsetCount, |
| 6897 | const uint32_t* pDynamicOffsets) |
| 6898 | { |
| 6899 | PreCmdBindDescriptorSets(cmdBuffer, pDescriptorSets, pDynamicOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6900 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6901 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 6902 | |
| 6903 | PostCmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, dynamicOffsetCount); |
| 6904 | } |
| 6905 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6906 | bool PostCmdBindIndexBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6907 | VkCmdBuffer cmdBuffer, |
| 6908 | VkBuffer buffer, |
| 6909 | VkDeviceSize offset, |
| 6910 | VkIndexType indexType) |
| 6911 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6912 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6913 | |
| 6914 | |
| 6915 | if(indexType < VK_INDEX_TYPE_BEGIN_RANGE || |
| 6916 | indexType > VK_INDEX_TYPE_END_RANGE) |
| 6917 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6918 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6919 | "vkCmdBindIndexBuffer parameter, VkIndexType indexType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6920 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6921 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6922 | |
| 6923 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6924 | } |
| 6925 | |
| 6926 | VK_LAYER_EXPORT void VKAPI vkCmdBindIndexBuffer( |
| 6927 | VkCmdBuffer cmdBuffer, |
| 6928 | VkBuffer buffer, |
| 6929 | VkDeviceSize offset, |
| 6930 | VkIndexType indexType) |
| 6931 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6932 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6933 | |
| 6934 | PostCmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 6935 | } |
| 6936 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6937 | bool PreCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6938 | VkCmdBuffer cmdBuffer, |
| 6939 | const VkBuffer* pBuffers, |
| 6940 | const VkDeviceSize* pOffsets) |
| 6941 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6942 | if(pBuffers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6943 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6944 | } |
| 6945 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6946 | if(pOffsets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6947 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6948 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6949 | |
| 6950 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6951 | } |
| 6952 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6953 | bool PostCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6954 | VkCmdBuffer cmdBuffer, |
| 6955 | uint32_t startBinding, |
| 6956 | uint32_t bindingCount) |
| 6957 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6958 | |
| 6959 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6960 | |
| 6961 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6962 | } |
| 6963 | |
Courtney Goeltzenleuchter | f68ad72 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 6964 | VK_LAYER_EXPORT void VKAPI vkCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6965 | VkCmdBuffer cmdBuffer, |
| 6966 | uint32_t startBinding, |
| 6967 | uint32_t bindingCount, |
| 6968 | const VkBuffer* pBuffers, |
| 6969 | const VkDeviceSize* pOffsets) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6970 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6971 | PreCmdBindVertexBuffers(cmdBuffer, pBuffers, pOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6972 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6973 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets); |
| 6974 | |
| 6975 | PostCmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6976 | } |
| 6977 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6978 | bool PostCmdDraw( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6979 | VkCmdBuffer cmdBuffer, |
| 6980 | uint32_t firstVertex, |
| 6981 | uint32_t vertexCount, |
| 6982 | uint32_t firstInstance, |
| 6983 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6984 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6985 | |
| 6986 | |
| 6987 | |
| 6988 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6989 | |
| 6990 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6991 | } |
| 6992 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6993 | VK_LAYER_EXPORT void VKAPI vkCmdDraw( |
| 6994 | VkCmdBuffer cmdBuffer, |
| 6995 | uint32_t firstVertex, |
| 6996 | uint32_t vertexCount, |
| 6997 | uint32_t firstInstance, |
| 6998 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6999 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7000 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 7001 | |
| 7002 | PostCmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7003 | } |
| 7004 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7005 | bool PostCmdDrawIndexed( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7006 | VkCmdBuffer cmdBuffer, |
| 7007 | uint32_t firstIndex, |
| 7008 | uint32_t indexCount, |
| 7009 | int32_t vertexOffset, |
| 7010 | uint32_t firstInstance, |
| 7011 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7012 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7013 | |
| 7014 | |
| 7015 | |
| 7016 | |
| 7017 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7018 | |
| 7019 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7020 | } |
| 7021 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7022 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed( |
| 7023 | VkCmdBuffer cmdBuffer, |
| 7024 | uint32_t firstIndex, |
| 7025 | uint32_t indexCount, |
| 7026 | int32_t vertexOffset, |
| 7027 | uint32_t firstInstance, |
| 7028 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7029 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7030 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 7031 | |
| 7032 | PostCmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 7033 | } |
| 7034 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7035 | bool PostCmdDrawIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7036 | VkCmdBuffer cmdBuffer, |
| 7037 | VkBuffer buffer, |
| 7038 | VkDeviceSize offset, |
| 7039 | uint32_t count, |
| 7040 | uint32_t stride) |
| 7041 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7042 | |
| 7043 | |
| 7044 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7045 | |
| 7046 | |
| 7047 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7048 | } |
| 7049 | |
| 7050 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndirect( |
| 7051 | VkCmdBuffer cmdBuffer, |
| 7052 | VkBuffer buffer, |
| 7053 | VkDeviceSize offset, |
| 7054 | uint32_t count, |
| 7055 | uint32_t stride) |
| 7056 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7057 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 7058 | |
| 7059 | PostCmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 7060 | } |
| 7061 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7062 | bool PostCmdDrawIndexedIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7063 | VkCmdBuffer cmdBuffer, |
| 7064 | VkBuffer buffer, |
| 7065 | VkDeviceSize offset, |
| 7066 | uint32_t count, |
| 7067 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7068 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7069 | |
| 7070 | |
| 7071 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7072 | |
| 7073 | |
| 7074 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7075 | } |
| 7076 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7077 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexedIndirect( |
| 7078 | VkCmdBuffer cmdBuffer, |
| 7079 | VkBuffer buffer, |
| 7080 | VkDeviceSize offset, |
| 7081 | uint32_t count, |
| 7082 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7083 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7084 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 7085 | |
| 7086 | PostCmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 7087 | } |
| 7088 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7089 | bool PostCmdDispatch( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7090 | VkCmdBuffer cmdBuffer, |
| 7091 | uint32_t x, |
| 7092 | uint32_t y, |
| 7093 | uint32_t z) |
| 7094 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7095 | |
| 7096 | |
| 7097 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7098 | |
| 7099 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7100 | } |
| 7101 | |
| 7102 | VK_LAYER_EXPORT void VKAPI vkCmdDispatch( |
| 7103 | VkCmdBuffer cmdBuffer, |
| 7104 | uint32_t x, |
| 7105 | uint32_t y, |
| 7106 | uint32_t z) |
| 7107 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7108 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatch(cmdBuffer, x, y, z); |
| 7109 | |
| 7110 | PostCmdDispatch(cmdBuffer, x, y, z); |
| 7111 | } |
| 7112 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7113 | bool PostCmdDispatchIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7114 | VkCmdBuffer cmdBuffer, |
| 7115 | VkBuffer buffer, |
| 7116 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7117 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7118 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7119 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7120 | |
| 7121 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7122 | } |
| 7123 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7124 | VK_LAYER_EXPORT void VKAPI vkCmdDispatchIndirect( |
| 7125 | VkCmdBuffer cmdBuffer, |
| 7126 | VkBuffer buffer, |
| 7127 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7128 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7129 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatchIndirect(cmdBuffer, buffer, offset); |
| 7130 | |
| 7131 | PostCmdDispatchIndirect(cmdBuffer, buffer, offset); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7132 | } |
| 7133 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7134 | bool PreCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7135 | VkCmdBuffer cmdBuffer, |
| 7136 | const VkBufferCopy* pRegions) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7137 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7138 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7139 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7140 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7141 | |
| 7142 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7143 | } |
| 7144 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7145 | bool PostCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7146 | VkCmdBuffer cmdBuffer, |
| 7147 | VkBuffer srcBuffer, |
| 7148 | VkBuffer destBuffer, |
| 7149 | uint32_t regionCount) |
| 7150 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7151 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7152 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7153 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7154 | |
| 7155 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7156 | } |
| 7157 | |
| 7158 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBuffer( |
| 7159 | VkCmdBuffer cmdBuffer, |
| 7160 | VkBuffer srcBuffer, |
| 7161 | VkBuffer destBuffer, |
| 7162 | uint32_t regionCount, |
| 7163 | const VkBufferCopy* pRegions) |
| 7164 | { |
| 7165 | PreCmdCopyBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7166 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7167 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); |
| 7168 | |
| 7169 | PostCmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount); |
| 7170 | } |
| 7171 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7172 | bool PreCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7173 | VkCmdBuffer cmdBuffer, |
| 7174 | const VkImageCopy* pRegions) |
| 7175 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7176 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7177 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7178 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7179 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7180 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7181 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7182 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7183 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7184 | } |
| 7185 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7186 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7187 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7188 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7189 | "vkCmdCopyImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7190 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7191 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7192 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7193 | |
| 7194 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7195 | } |
| 7196 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7197 | bool PostCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7198 | VkCmdBuffer cmdBuffer, |
| 7199 | VkImage srcImage, |
| 7200 | VkImageLayout srcImageLayout, |
| 7201 | VkImage destImage, |
| 7202 | VkImageLayout destImageLayout, |
| 7203 | uint32_t regionCount) |
| 7204 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7205 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7206 | |
| 7207 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7208 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7209 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7210 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7211 | "vkCmdCopyImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7212 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7213 | } |
| 7214 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7215 | |
| 7216 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7217 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7218 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7219 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7220 | "vkCmdCopyImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7221 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7222 | } |
| 7223 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7224 | |
| 7225 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7226 | } |
| 7227 | |
| 7228 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImage( |
| 7229 | VkCmdBuffer cmdBuffer, |
| 7230 | VkImage srcImage, |
| 7231 | VkImageLayout srcImageLayout, |
| 7232 | VkImage destImage, |
| 7233 | VkImageLayout destImageLayout, |
| 7234 | uint32_t regionCount, |
| 7235 | const VkImageCopy* pRegions) |
| 7236 | { |
| 7237 | PreCmdCopyImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7238 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7239 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 7240 | |
| 7241 | PostCmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 7242 | } |
| 7243 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7244 | bool PreCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7245 | VkCmdBuffer cmdBuffer, |
| 7246 | const VkImageBlit* pRegions) |
| 7247 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7248 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7249 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7250 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7251 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7252 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7253 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7254 | "vkCmdBlitImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7255 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7256 | } |
| 7257 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7258 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7259 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7260 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7261 | "vkCmdBlitImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7262 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7263 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7264 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7265 | |
| 7266 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7267 | } |
| 7268 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7269 | bool PostCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7270 | VkCmdBuffer cmdBuffer, |
| 7271 | VkImage srcImage, |
| 7272 | VkImageLayout srcImageLayout, |
| 7273 | VkImage destImage, |
| 7274 | VkImageLayout destImageLayout, |
| 7275 | uint32_t regionCount, |
| 7276 | VkTexFilter filter) |
| 7277 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7278 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7279 | |
| 7280 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7281 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7282 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7283 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7284 | "vkCmdBlitImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7285 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7286 | } |
| 7287 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7288 | |
| 7289 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7290 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 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 | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7293 | "vkCmdBlitImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
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 | |
| 7297 | |
| 7298 | if(filter < VK_TEX_FILTER_BEGIN_RANGE || |
| 7299 | filter > VK_TEX_FILTER_END_RANGE) |
| 7300 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7301 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7302 | "vkCmdBlitImage parameter, VkTexFilter filter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7303 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7304 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7305 | |
| 7306 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7307 | } |
| 7308 | |
| 7309 | VK_LAYER_EXPORT void VKAPI vkCmdBlitImage( |
| 7310 | VkCmdBuffer cmdBuffer, |
| 7311 | VkImage srcImage, |
| 7312 | VkImageLayout srcImageLayout, |
| 7313 | VkImage destImage, |
| 7314 | VkImageLayout destImageLayout, |
| 7315 | uint32_t regionCount, |
| 7316 | const VkImageBlit* pRegions, |
| 7317 | VkTexFilter filter) |
| 7318 | { |
| 7319 | PreCmdBlitImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7320 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7321 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); |
| 7322 | |
| 7323 | PostCmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, filter); |
| 7324 | } |
| 7325 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7326 | bool PreCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7327 | VkCmdBuffer cmdBuffer, |
| 7328 | const VkBufferImageCopy* pRegions) |
| 7329 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7330 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7331 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7332 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7333 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7334 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7335 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7336 | "vkCmdCopyBufferToImage parameter, VkImageAspect pRegions->imageSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7337 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7338 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7339 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7340 | |
| 7341 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7342 | } |
| 7343 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7344 | bool PostCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7345 | VkCmdBuffer cmdBuffer, |
| 7346 | VkBuffer srcBuffer, |
| 7347 | VkImage destImage, |
| 7348 | VkImageLayout destImageLayout, |
| 7349 | uint32_t regionCount) |
| 7350 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7351 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7352 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7353 | |
| 7354 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7355 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7356 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7357 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7358 | "vkCmdCopyBufferToImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7359 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7360 | } |
| 7361 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7362 | |
| 7363 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7364 | } |
| 7365 | |
| 7366 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBufferToImage( |
| 7367 | VkCmdBuffer cmdBuffer, |
| 7368 | VkBuffer srcBuffer, |
| 7369 | VkImage destImage, |
| 7370 | VkImageLayout destImageLayout, |
| 7371 | uint32_t regionCount, |
| 7372 | const VkBufferImageCopy* pRegions) |
| 7373 | { |
| 7374 | PreCmdCopyBufferToImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7375 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7376 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); |
| 7377 | |
| 7378 | PostCmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount); |
| 7379 | } |
| 7380 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7381 | bool PreCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7382 | VkCmdBuffer cmdBuffer, |
| 7383 | const VkBufferImageCopy* pRegions) |
| 7384 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7385 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7386 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7387 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7388 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7389 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7390 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7391 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7392 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7393 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7394 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7395 | |
| 7396 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7397 | } |
| 7398 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7399 | bool PostCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7400 | VkCmdBuffer cmdBuffer, |
| 7401 | VkImage srcImage, |
| 7402 | VkImageLayout srcImageLayout, |
| 7403 | VkBuffer destBuffer, |
| 7404 | uint32_t regionCount) |
| 7405 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7406 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7407 | |
| 7408 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7409 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7410 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7411 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7412 | "vkCmdCopyImageToBuffer parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7413 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7414 | } |
| 7415 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7416 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7417 | |
| 7418 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7419 | } |
| 7420 | |
| 7421 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImageToBuffer( |
| 7422 | VkCmdBuffer cmdBuffer, |
| 7423 | VkImage srcImage, |
| 7424 | VkImageLayout srcImageLayout, |
| 7425 | VkBuffer destBuffer, |
| 7426 | uint32_t regionCount, |
| 7427 | const VkBufferImageCopy* pRegions) |
| 7428 | { |
| 7429 | PreCmdCopyImageToBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7430 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7431 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); |
| 7432 | |
| 7433 | PostCmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount); |
| 7434 | } |
| 7435 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7436 | bool PreCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7437 | VkCmdBuffer cmdBuffer, |
| 7438 | const uint32_t* pData) |
| 7439 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7440 | if(pData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7441 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7442 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7443 | |
| 7444 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7445 | } |
| 7446 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7447 | bool PostCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7448 | VkCmdBuffer cmdBuffer, |
| 7449 | VkBuffer destBuffer, |
| 7450 | VkDeviceSize destOffset, |
| 7451 | VkDeviceSize dataSize) |
| 7452 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7453 | |
| 7454 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7455 | |
| 7456 | |
| 7457 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7458 | } |
| 7459 | |
| 7460 | VK_LAYER_EXPORT void VKAPI vkCmdUpdateBuffer( |
| 7461 | VkCmdBuffer cmdBuffer, |
| 7462 | VkBuffer destBuffer, |
| 7463 | VkDeviceSize destOffset, |
| 7464 | VkDeviceSize dataSize, |
| 7465 | const uint32_t* pData) |
| 7466 | { |
| 7467 | PreCmdUpdateBuffer(cmdBuffer, pData); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7468 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7469 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData); |
| 7470 | |
| 7471 | PostCmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize); |
| 7472 | } |
| 7473 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7474 | bool PostCmdFillBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7475 | VkCmdBuffer cmdBuffer, |
| 7476 | VkBuffer destBuffer, |
| 7477 | VkDeviceSize destOffset, |
| 7478 | VkDeviceSize fillSize, |
| 7479 | uint32_t data) |
| 7480 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7481 | |
| 7482 | |
| 7483 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7484 | |
| 7485 | |
| 7486 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7487 | } |
| 7488 | |
| 7489 | VK_LAYER_EXPORT void VKAPI vkCmdFillBuffer( |
| 7490 | VkCmdBuffer cmdBuffer, |
| 7491 | VkBuffer destBuffer, |
| 7492 | VkDeviceSize destOffset, |
| 7493 | VkDeviceSize fillSize, |
| 7494 | uint32_t data) |
| 7495 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7496 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 7497 | |
| 7498 | PostCmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 7499 | } |
| 7500 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7501 | bool PreCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7502 | VkCmdBuffer cmdBuffer, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 7503 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7504 | const VkImageSubresourceRange* pRanges) |
| 7505 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7506 | if(pColor != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7507 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7508 | } |
| 7509 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7510 | if(pRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7511 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7512 | if(pRanges->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7513 | pRanges->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7514 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7515 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7516 | "vkCmdClearColorImage parameter, VkImageAspect pRanges->aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7517 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7518 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7519 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7520 | |
| 7521 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7522 | } |
| 7523 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7524 | bool PostCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7525 | VkCmdBuffer cmdBuffer, |
| 7526 | VkImage image, |
| 7527 | VkImageLayout imageLayout, |
| 7528 | uint32_t rangeCount) |
| 7529 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7530 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7531 | |
| 7532 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7533 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7534 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7535 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7536 | "vkCmdClearColorImage parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7537 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7538 | } |
| 7539 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7540 | |
| 7541 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7542 | } |
| 7543 | |
| 7544 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage( |
| 7545 | VkCmdBuffer cmdBuffer, |
| 7546 | VkImage image, |
| 7547 | VkImageLayout imageLayout, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 7548 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7549 | uint32_t rangeCount, |
| 7550 | const VkImageSubresourceRange* pRanges) |
| 7551 | { |
| 7552 | PreCmdClearColorImage(cmdBuffer, pColor, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7553 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7554 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 7555 | |
| 7556 | PostCmdClearColorImage(cmdBuffer, image, imageLayout, rangeCount); |
| 7557 | } |
| 7558 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7559 | bool PreCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7560 | VkCmdBuffer cmdBuffer, |
| 7561 | const VkImageSubresourceRange* pRanges) |
| 7562 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7563 | if(pRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7564 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7565 | if(pRanges->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7566 | pRanges->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7567 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7568 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7569 | "vkCmdClearDepthStencilImage parameter, VkImageAspect pRanges->aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7570 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7571 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7572 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7573 | |
| 7574 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7575 | } |
| 7576 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7577 | bool PostCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7578 | VkCmdBuffer cmdBuffer, |
| 7579 | VkImage image, |
| 7580 | VkImageLayout imageLayout, |
| 7581 | float depth, |
| 7582 | uint32_t stencil, |
| 7583 | uint32_t rangeCount) |
| 7584 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7585 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7586 | |
| 7587 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7588 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7589 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7590 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7591 | "vkCmdClearDepthStencilImage parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7592 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7593 | } |
| 7594 | |
| 7595 | |
| 7596 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7597 | |
| 7598 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7599 | } |
| 7600 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7601 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7602 | VkCmdBuffer cmdBuffer, |
| 7603 | VkImage image, |
| 7604 | VkImageLayout imageLayout, |
| 7605 | float depth, |
| 7606 | uint32_t stencil, |
| 7607 | uint32_t rangeCount, |
| 7608 | const VkImageSubresourceRange* pRanges) |
| 7609 | { |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7610 | PreCmdClearDepthStencilImage(cmdBuffer, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7611 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7612 | 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] | 7613 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 7614 | PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7615 | } |
| 7616 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7617 | bool PreCmdClearColorAttachment( |
| 7618 | VkCmdBuffer cmdBuffer, |
| 7619 | const VkClearColorValue* pColor, |
| 7620 | const VkRect3D* pRects) |
| 7621 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7622 | if(pColor != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7623 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7624 | } |
| 7625 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7626 | if(pRects != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7627 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7628 | } |
| 7629 | |
| 7630 | return true; |
| 7631 | } |
| 7632 | |
| 7633 | bool PostCmdClearColorAttachment( |
| 7634 | VkCmdBuffer cmdBuffer, |
| 7635 | uint32_t colorAttachment, |
| 7636 | VkImageLayout imageLayout, |
| 7637 | uint32_t rectCount) |
| 7638 | { |
| 7639 | |
| 7640 | |
| 7641 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7642 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7643 | { |
| 7644 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7645 | "vkCmdClearColorAttachment parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7646 | return false; |
| 7647 | } |
| 7648 | |
| 7649 | |
| 7650 | return true; |
| 7651 | } |
| 7652 | |
| 7653 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorAttachment( |
| 7654 | VkCmdBuffer cmdBuffer, |
| 7655 | uint32_t colorAttachment, |
| 7656 | VkImageLayout imageLayout, |
| 7657 | const VkClearColorValue* pColor, |
| 7658 | uint32_t rectCount, |
| 7659 | const VkRect3D* pRects) |
| 7660 | { |
| 7661 | PreCmdClearColorAttachment(cmdBuffer, pColor, pRects); |
| 7662 | |
| 7663 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects); |
| 7664 | |
| 7665 | PostCmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, rectCount); |
| 7666 | } |
| 7667 | |
| 7668 | bool PreCmdClearDepthStencilAttachment( |
| 7669 | VkCmdBuffer cmdBuffer, |
| 7670 | const VkRect3D* pRects) |
| 7671 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7672 | if(pRects != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7673 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7674 | } |
| 7675 | |
| 7676 | return true; |
| 7677 | } |
| 7678 | |
| 7679 | bool PostCmdClearDepthStencilAttachment( |
| 7680 | VkCmdBuffer cmdBuffer, |
| 7681 | VkImageAspectFlags imageAspectMask, |
| 7682 | VkImageLayout imageLayout, |
| 7683 | float depth, |
| 7684 | uint32_t stencil, |
| 7685 | uint32_t rectCount) |
| 7686 | { |
| 7687 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7688 | |
| 7689 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7690 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7691 | { |
| 7692 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7693 | "vkCmdClearDepthStencilAttachment parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7694 | return false; |
| 7695 | } |
| 7696 | |
| 7697 | |
| 7698 | |
| 7699 | |
| 7700 | return true; |
| 7701 | } |
| 7702 | |
| 7703 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment( |
| 7704 | VkCmdBuffer cmdBuffer, |
| 7705 | VkImageAspectFlags imageAspectMask, |
| 7706 | VkImageLayout imageLayout, |
| 7707 | float depth, |
| 7708 | uint32_t stencil, |
| 7709 | uint32_t rectCount, |
| 7710 | const VkRect3D* pRects) |
| 7711 | { |
| 7712 | PreCmdClearDepthStencilAttachment(cmdBuffer, pRects); |
| 7713 | |
| 7714 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects); |
| 7715 | |
| 7716 | PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount); |
| 7717 | } |
| 7718 | |
| 7719 | bool PreCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7720 | VkCmdBuffer cmdBuffer, |
| 7721 | const VkImageResolve* pRegions) |
| 7722 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7723 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7724 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7725 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7726 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7727 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7728 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7729 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7730 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7731 | } |
| 7732 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 7733 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 7734 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7735 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7736 | "vkCmdResolveImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7737 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7738 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7739 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7740 | |
| 7741 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7742 | } |
| 7743 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7744 | bool PostCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7745 | VkCmdBuffer cmdBuffer, |
| 7746 | VkImage srcImage, |
| 7747 | VkImageLayout srcImageLayout, |
| 7748 | VkImage destImage, |
| 7749 | VkImageLayout destImageLayout, |
| 7750 | uint32_t regionCount) |
| 7751 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7752 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7753 | |
| 7754 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7755 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7756 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7757 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7758 | "vkCmdResolveImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7759 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7760 | } |
| 7761 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7762 | |
| 7763 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 7764 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 7765 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7766 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7767 | "vkCmdResolveImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7768 | return false; |
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 | |
| 7772 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7773 | } |
| 7774 | |
| 7775 | VK_LAYER_EXPORT void VKAPI vkCmdResolveImage( |
| 7776 | VkCmdBuffer cmdBuffer, |
| 7777 | VkImage srcImage, |
| 7778 | VkImageLayout srcImageLayout, |
| 7779 | VkImage destImage, |
| 7780 | VkImageLayout destImageLayout, |
| 7781 | uint32_t regionCount, |
| 7782 | const VkImageResolve* pRegions) |
| 7783 | { |
| 7784 | PreCmdResolveImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7785 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7786 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 7787 | |
| 7788 | PostCmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 7789 | } |
| 7790 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7791 | bool PostCmdSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7792 | VkCmdBuffer cmdBuffer, |
| 7793 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7794 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7795 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7796 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7797 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7798 | |
| 7799 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7800 | } |
| 7801 | |
| 7802 | VK_LAYER_EXPORT void VKAPI vkCmdSetEvent( |
| 7803 | VkCmdBuffer cmdBuffer, |
| 7804 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7805 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7806 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7807 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7808 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7809 | PostCmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7810 | } |
| 7811 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7812 | bool PostCmdResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7813 | VkCmdBuffer cmdBuffer, |
| 7814 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7815 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7816 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7817 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7818 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7819 | |
| 7820 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7821 | } |
| 7822 | |
| 7823 | VK_LAYER_EXPORT void VKAPI vkCmdResetEvent( |
| 7824 | VkCmdBuffer cmdBuffer, |
| 7825 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7826 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7827 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7828 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7829 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7830 | PostCmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7831 | } |
| 7832 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7833 | bool PreCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7834 | VkCmdBuffer cmdBuffer, |
| 7835 | const VkEvent* pEvents, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 7836 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7837 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7838 | if(pEvents != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7839 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7840 | } |
| 7841 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7842 | if(ppMemBarriers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7843 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7844 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7845 | |
| 7846 | return true; |
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 | bool PostCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7850 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7851 | uint32_t eventCount, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7852 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7853 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7854 | uint32_t memBarrierCount) |
| 7855 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7856 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7857 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7858 | |
| 7859 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7860 | |
| 7861 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7862 | } |
| 7863 | |
| 7864 | VK_LAYER_EXPORT void VKAPI vkCmdWaitEvents( |
| 7865 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7866 | uint32_t eventCount, |
| 7867 | const VkEvent* pEvents, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7868 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7869 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7870 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 7871 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7872 | { |
| 7873 | PreCmdWaitEvents(cmdBuffer, pEvents, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7874 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7875 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWaitEvents(cmdBuffer, eventCount, pEvents, srcStageMask, destStageMask, memBarrierCount, ppMemBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7876 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7877 | PostCmdWaitEvents(cmdBuffer, eventCount, srcStageMask, destStageMask, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7878 | } |
| 7879 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7880 | bool PreCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7881 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7882 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7883 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 7884 | if(ppMemBarriers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7885 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7886 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7887 | |
| 7888 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7889 | } |
| 7890 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7891 | bool PostCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7892 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7893 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7894 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7895 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7896 | uint32_t memBarrierCount) |
| 7897 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7898 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7899 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7900 | |
| 7901 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7902 | |
| 7903 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7904 | } |
| 7905 | |
| 7906 | VK_LAYER_EXPORT void VKAPI vkCmdPipelineBarrier( |
| 7907 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7908 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7909 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 7910 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7911 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7912 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7913 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 7914 | PreCmdPipelineBarrier(cmdBuffer, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7915 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7916 | 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] | 7917 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 7918 | PostCmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7919 | } |
| 7920 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7921 | bool PostCmdBeginQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7922 | VkCmdBuffer cmdBuffer, |
| 7923 | VkQueryPool queryPool, |
| 7924 | uint32_t slot, |
| 7925 | VkQueryControlFlags flags) |
| 7926 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7927 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7928 | |
| 7929 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7930 | |
| 7931 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7932 | } |
| 7933 | |
| 7934 | VK_LAYER_EXPORT void VKAPI vkCmdBeginQuery( |
| 7935 | VkCmdBuffer cmdBuffer, |
| 7936 | VkQueryPool queryPool, |
| 7937 | uint32_t slot, |
| 7938 | VkQueryControlFlags flags) |
| 7939 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7940 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7941 | |
| 7942 | PostCmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 7943 | } |
| 7944 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7945 | bool PostCmdEndQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7946 | VkCmdBuffer cmdBuffer, |
| 7947 | VkQueryPool queryPool, |
| 7948 | uint32_t slot) |
| 7949 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7950 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7951 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7952 | |
| 7953 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7954 | } |
| 7955 | |
| 7956 | VK_LAYER_EXPORT void VKAPI vkCmdEndQuery( |
| 7957 | VkCmdBuffer cmdBuffer, |
| 7958 | VkQueryPool queryPool, |
| 7959 | uint32_t slot) |
| 7960 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7961 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndQuery(cmdBuffer, queryPool, slot); |
| 7962 | |
| 7963 | PostCmdEndQuery(cmdBuffer, queryPool, slot); |
| 7964 | } |
| 7965 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7966 | bool PostCmdResetQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7967 | VkCmdBuffer cmdBuffer, |
| 7968 | VkQueryPool queryPool, |
| 7969 | uint32_t startQuery, |
| 7970 | uint32_t queryCount) |
| 7971 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7972 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7973 | |
| 7974 | |
| 7975 | |
| 7976 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7977 | } |
| 7978 | |
| 7979 | VK_LAYER_EXPORT void VKAPI vkCmdResetQueryPool( |
| 7980 | VkCmdBuffer cmdBuffer, |
| 7981 | VkQueryPool queryPool, |
| 7982 | uint32_t startQuery, |
| 7983 | uint32_t queryCount) |
| 7984 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7985 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 7986 | |
| 7987 | PostCmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 7988 | } |
| 7989 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 7990 | bool PostCmdWriteTimestamp( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7991 | VkCmdBuffer cmdBuffer, |
| 7992 | VkTimestampType timestampType, |
| 7993 | VkBuffer destBuffer, |
| 7994 | VkDeviceSize destOffset) |
| 7995 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7996 | |
| 7997 | if(timestampType < VK_TIMESTAMP_TYPE_BEGIN_RANGE || |
| 7998 | timestampType > VK_TIMESTAMP_TYPE_END_RANGE) |
| 7999 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8000 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8001 | "vkCmdWriteTimestamp parameter, VkTimestampType timestampType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8002 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8003 | } |
| 8004 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8005 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8006 | |
| 8007 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8008 | } |
| 8009 | |
| 8010 | VK_LAYER_EXPORT void VKAPI vkCmdWriteTimestamp( |
| 8011 | VkCmdBuffer cmdBuffer, |
| 8012 | VkTimestampType timestampType, |
| 8013 | VkBuffer destBuffer, |
| 8014 | VkDeviceSize destOffset) |
| 8015 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8016 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 8017 | |
| 8018 | PostCmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 8019 | } |
| 8020 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8021 | bool PostCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8022 | VkCmdBuffer cmdBuffer, |
| 8023 | VkQueryPool queryPool, |
| 8024 | uint32_t startQuery, |
| 8025 | uint32_t queryCount, |
| 8026 | VkBuffer destBuffer, |
| 8027 | VkDeviceSize destOffset, |
| 8028 | VkDeviceSize destStride, |
| 8029 | VkQueryResultFlags flags) |
| 8030 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8031 | |
| 8032 | |
| 8033 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8034 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8035 | |
| 8036 | |
| 8037 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8038 | |
| 8039 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8040 | } |
| 8041 | |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8042 | VK_LAYER_EXPORT void VKAPI vkCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8043 | VkCmdBuffer cmdBuffer, |
| 8044 | VkQueryPool queryPool, |
| 8045 | uint32_t startQuery, |
| 8046 | uint32_t queryCount, |
| 8047 | VkBuffer destBuffer, |
| 8048 | VkDeviceSize destOffset, |
| 8049 | VkDeviceSize destStride, |
| 8050 | VkQueryResultFlags flags) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8051 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8052 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
| 8053 | |
| 8054 | PostCmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 8055 | } |
| 8056 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8057 | bool PreCmdPushConstants( |
| 8058 | VkCmdBuffer cmdBuffer, |
| 8059 | const void* values) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8060 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8061 | if(values != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8062 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8063 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8064 | |
| 8065 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8066 | } |
| 8067 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8068 | bool PostCmdPushConstants( |
| 8069 | VkCmdBuffer cmdBuffer, |
| 8070 | VkPipelineLayout layout, |
| 8071 | VkShaderStageFlags stageFlags, |
| 8072 | uint32_t start, |
| 8073 | uint32_t length) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8074 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8075 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8076 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8077 | |
| 8078 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8079 | |
| 8080 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8081 | } |
| 8082 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8083 | VK_LAYER_EXPORT void VKAPI vkCmdPushConstants( |
| 8084 | VkCmdBuffer cmdBuffer, |
| 8085 | VkPipelineLayout layout, |
| 8086 | VkShaderStageFlags stageFlags, |
| 8087 | uint32_t start, |
| 8088 | uint32_t length, |
| 8089 | const void* values) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8090 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8091 | PreCmdPushConstants(cmdBuffer, values); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8092 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8093 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdPushConstants(cmdBuffer, layout, stageFlags, start, length, values); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8094 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8095 | PostCmdPushConstants(cmdBuffer, layout, stageFlags, start, length); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8096 | } |
| 8097 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8098 | bool PreCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8099 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8100 | const VkRenderPassBeginInfo* pRenderPassBegin) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8101 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8102 | if(pRenderPassBegin != nullptr) |
| 8103 | { |
| 8104 | if(pRenderPassBegin->sType != VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8105 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8106 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8107 | "vkCmdBeginRenderPass parameter, VkStructureType pRenderPassBegin->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8108 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 8109 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8110 | if(pRenderPassBegin->pAttachmentClearValues != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8111 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8112 | } |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 8113 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8114 | |
| 8115 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8116 | } |
| 8117 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8118 | bool PostCmdBeginRenderPass( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8119 | VkCmdBuffer cmdBuffer, |
| 8120 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8121 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8122 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8123 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 8124 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
| 8125 | { |
| 8126 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 8127 | "vkCmdBeginRenderPass parameter, VkRenderPassContents contents, is an unrecognized enumerator"); |
| 8128 | return false; |
| 8129 | } |
| 8130 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8131 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8132 | } |
| 8133 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8134 | VK_LAYER_EXPORT void VKAPI vkCmdBeginRenderPass( |
| 8135 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8136 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 8137 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8138 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8139 | PreCmdBeginRenderPass(cmdBuffer, pRenderPassBegin); |
| 8140 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8141 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8142 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8143 | PostCmdBeginRenderPass(cmdBuffer, contents); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8144 | } |
| 8145 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8146 | bool PostCmdNextSubpass( |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8147 | VkCmdBuffer cmdBuffer, |
| 8148 | VkRenderPassContents contents) |
| 8149 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8150 | |
| 8151 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8152 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8153 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8154 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8155 | "vkCmdNextSubpass parameter, VkRenderPassContents contents, is an unrecognized enumerator"); |
| 8156 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8157 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8158 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8159 | return true; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8160 | } |
| 8161 | |
| 8162 | VK_LAYER_EXPORT void VKAPI vkCmdNextSubpass( |
| 8163 | VkCmdBuffer cmdBuffer, |
| 8164 | VkRenderPassContents contents) |
| 8165 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8166 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdNextSubpass(cmdBuffer, contents); |
| 8167 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8168 | PostCmdNextSubpass(cmdBuffer, contents); |
| 8169 | } |
| 8170 | |
| 8171 | bool PostCmdEndRenderPass( |
| 8172 | VkCmdBuffer cmdBuffer) |
| 8173 | { |
| 8174 | |
| 8175 | return true; |
| 8176 | } |
| 8177 | |
| 8178 | VK_LAYER_EXPORT void VKAPI vkCmdEndRenderPass( |
| 8179 | VkCmdBuffer cmdBuffer) |
| 8180 | { |
| 8181 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndRenderPass(cmdBuffer); |
| 8182 | |
| 8183 | PostCmdEndRenderPass(cmdBuffer); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8184 | } |
| 8185 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8186 | bool PreCmdExecuteCommands( |
| 8187 | VkCmdBuffer cmdBuffer, |
| 8188 | const VkCmdBuffer* pCmdBuffers) |
| 8189 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 8190 | if(pCmdBuffers != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8191 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8192 | } |
| 8193 | |
| 8194 | return true; |
| 8195 | } |
| 8196 | |
| 8197 | bool PostCmdExecuteCommands( |
| 8198 | VkCmdBuffer cmdBuffer, |
| 8199 | uint32_t cmdBuffersCount) |
| 8200 | { |
| 8201 | |
| 8202 | |
| 8203 | return true; |
| 8204 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8205 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8206 | VK_LAYER_EXPORT void VKAPI vkCmdExecuteCommands( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8207 | VkCmdBuffer cmdBuffer, |
| 8208 | uint32_t cmdBuffersCount, |
| 8209 | const VkCmdBuffer* pCmdBuffers) |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8210 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8211 | PreCmdExecuteCommands(cmdBuffer, pCmdBuffers); |
| 8212 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 8213 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers); |
| 8214 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 8215 | PostCmdExecuteCommands(cmdBuffer, cmdBuffersCount); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8216 | } |
| 8217 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8218 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr(VkDevice device, const char* funcName) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8219 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8220 | if (device == NULL) { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8221 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8222 | } |
| 8223 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8224 | /* loader uses this to force layer initialization; device object is wrapped */ |
| 8225 | if (!strcmp(funcName, "vkGetDeviceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8226 | initDeviceTable(pc_device_table_map, (const VkBaseLayerObject *) device); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8227 | return (PFN_vkVoidFunction) vkGetDeviceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8228 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8229 | |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 8230 | if (!strcmp(funcName, "vkCreateDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8231 | return (PFN_vkVoidFunction) vkCreateDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8232 | if (!strcmp(funcName, "vkDestroyDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8233 | return (PFN_vkVoidFunction) vkDestroyDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8234 | if (!strcmp(funcName, "vkGetDeviceQueue")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8235 | return (PFN_vkVoidFunction) vkGetDeviceQueue; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8236 | if (!strcmp(funcName, "vkQueueSubmit")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8237 | return (PFN_vkVoidFunction) vkQueueSubmit; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8238 | if (!strcmp(funcName, "vkQueueWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8239 | return (PFN_vkVoidFunction) vkQueueWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8240 | if (!strcmp(funcName, "vkDeviceWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8241 | return (PFN_vkVoidFunction) vkDeviceWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8242 | if (!strcmp(funcName, "vkAllocMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8243 | return (PFN_vkVoidFunction) vkAllocMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8244 | if (!strcmp(funcName, "vkFreeMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8245 | return (PFN_vkVoidFunction) vkFreeMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8246 | if (!strcmp(funcName, "vkMapMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8247 | return (PFN_vkVoidFunction) vkMapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8248 | if (!strcmp(funcName, "vkUnmapMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8249 | return (PFN_vkVoidFunction) vkUnmapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8250 | if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8251 | return (PFN_vkVoidFunction) vkFlushMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8252 | if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8253 | return (PFN_vkVoidFunction) vkInvalidateMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8254 | if (!strcmp(funcName, "vkCreateFence")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8255 | return (PFN_vkVoidFunction) vkCreateFence; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8256 | if (!strcmp(funcName, "vkResetFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8257 | return (PFN_vkVoidFunction) vkResetFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8258 | if (!strcmp(funcName, "vkGetFenceStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8259 | return (PFN_vkVoidFunction) vkGetFenceStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8260 | if (!strcmp(funcName, "vkWaitForFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8261 | return (PFN_vkVoidFunction) vkWaitForFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8262 | if (!strcmp(funcName, "vkCreateSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8263 | return (PFN_vkVoidFunction) vkCreateSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8264 | if (!strcmp(funcName, "vkQueueSignalSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8265 | return (PFN_vkVoidFunction) vkQueueSignalSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8266 | if (!strcmp(funcName, "vkQueueWaitSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8267 | return (PFN_vkVoidFunction) vkQueueWaitSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8268 | if (!strcmp(funcName, "vkCreateEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8269 | return (PFN_vkVoidFunction) vkCreateEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8270 | if (!strcmp(funcName, "vkGetEventStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8271 | return (PFN_vkVoidFunction) vkGetEventStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8272 | if (!strcmp(funcName, "vkSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8273 | return (PFN_vkVoidFunction) vkSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8274 | if (!strcmp(funcName, "vkResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8275 | return (PFN_vkVoidFunction) vkResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8276 | if (!strcmp(funcName, "vkCreateQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8277 | return (PFN_vkVoidFunction) vkCreateQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8278 | if (!strcmp(funcName, "vkGetQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8279 | return (PFN_vkVoidFunction) vkGetQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8280 | if (!strcmp(funcName, "vkCreateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8281 | return (PFN_vkVoidFunction) vkCreateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8282 | if (!strcmp(funcName, "vkCreateBufferView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8283 | return (PFN_vkVoidFunction) vkCreateBufferView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8284 | if (!strcmp(funcName, "vkCreateImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8285 | return (PFN_vkVoidFunction) vkCreateImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8286 | if (!strcmp(funcName, "vkGetImageSubresourceLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8287 | return (PFN_vkVoidFunction) vkGetImageSubresourceLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8288 | if (!strcmp(funcName, "vkCreateImageView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8289 | return (PFN_vkVoidFunction) vkCreateImageView; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8290 | if (!strcmp(funcName, "vkCreateAttachmentView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8291 | return (PFN_vkVoidFunction) vkCreateAttachmentView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8292 | if (!strcmp(funcName, "vkCreateShader")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8293 | return (PFN_vkVoidFunction) vkCreateShader; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 8294 | if (!strcmp(funcName, "vkCreateGraphicsPipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8295 | return (PFN_vkVoidFunction) vkCreateGraphicsPipelines; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 8296 | if (!strcmp(funcName, "vkCreateComputePipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8297 | return (PFN_vkVoidFunction) vkCreateComputePipelines; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8298 | if (!strcmp(funcName, "vkCreatePipelineLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8299 | return (PFN_vkVoidFunction) vkCreatePipelineLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8300 | if (!strcmp(funcName, "vkCreateSampler")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8301 | return (PFN_vkVoidFunction) vkCreateSampler; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8302 | if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8303 | return (PFN_vkVoidFunction) vkCreateDescriptorSetLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8304 | if (!strcmp(funcName, "vkCreateDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8305 | return (PFN_vkVoidFunction) vkCreateDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8306 | if (!strcmp(funcName, "vkResetDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8307 | return (PFN_vkVoidFunction) vkResetDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8308 | if (!strcmp(funcName, "vkAllocDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8309 | return (PFN_vkVoidFunction) vkAllocDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8310 | if (!strcmp(funcName, "vkCreateDynamicViewportState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8311 | return (PFN_vkVoidFunction) vkCreateDynamicViewportState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8312 | if (!strcmp(funcName, "vkCreateDynamicRasterState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8313 | return (PFN_vkVoidFunction) vkCreateDynamicRasterState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8314 | if (!strcmp(funcName, "vkCreateDynamicColorBlendState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8315 | return (PFN_vkVoidFunction) vkCreateDynamicColorBlendState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8316 | if (!strcmp(funcName, "vkCreateDynamicDepthStencilState")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8317 | return (PFN_vkVoidFunction) vkCreateDynamicDepthStencilState; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8318 | if (!strcmp(funcName, "vkCreateCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8319 | return (PFN_vkVoidFunction) vkCreateCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8320 | if (!strcmp(funcName, "vkBeginCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8321 | return (PFN_vkVoidFunction) vkBeginCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8322 | if (!strcmp(funcName, "vkEndCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8323 | return (PFN_vkVoidFunction) vkEndCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8324 | if (!strcmp(funcName, "vkResetCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8325 | return (PFN_vkVoidFunction) vkResetCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8326 | if (!strcmp(funcName, "vkCmdBindPipeline")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8327 | return (PFN_vkVoidFunction) vkCmdBindPipeline; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8328 | if (!strcmp(funcName, "vkCmdBindDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8329 | return (PFN_vkVoidFunction) vkCmdBindDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8330 | if (!strcmp(funcName, "vkCmdBindVertexBuffers")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8331 | return (PFN_vkVoidFunction) vkCmdBindVertexBuffers; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8332 | if (!strcmp(funcName, "vkCmdBindIndexBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8333 | return (PFN_vkVoidFunction) vkCmdBindIndexBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8334 | if (!strcmp(funcName, "vkCmdDraw")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8335 | return (PFN_vkVoidFunction) vkCmdDraw; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8336 | if (!strcmp(funcName, "vkCmdDrawIndexed")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8337 | return (PFN_vkVoidFunction) vkCmdDrawIndexed; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8338 | if (!strcmp(funcName, "vkCmdDrawIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8339 | return (PFN_vkVoidFunction) vkCmdDrawIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8340 | if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8341 | return (PFN_vkVoidFunction) vkCmdDrawIndexedIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8342 | if (!strcmp(funcName, "vkCmdDispatch")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8343 | return (PFN_vkVoidFunction) vkCmdDispatch; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8344 | if (!strcmp(funcName, "vkCmdDispatchIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8345 | return (PFN_vkVoidFunction) vkCmdDispatchIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8346 | if (!strcmp(funcName, "vkCmdCopyBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8347 | return (PFN_vkVoidFunction) vkCmdCopyBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8348 | if (!strcmp(funcName, "vkCmdCopyImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8349 | return (PFN_vkVoidFunction) vkCmdCopyImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8350 | if (!strcmp(funcName, "vkCmdBlitImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8351 | return (PFN_vkVoidFunction) vkCmdBlitImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8352 | if (!strcmp(funcName, "vkCmdCopyBufferToImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8353 | return (PFN_vkVoidFunction) vkCmdCopyBufferToImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8354 | if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8355 | return (PFN_vkVoidFunction) vkCmdCopyImageToBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8356 | if (!strcmp(funcName, "vkCmdUpdateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8357 | return (PFN_vkVoidFunction) vkCmdUpdateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8358 | if (!strcmp(funcName, "vkCmdFillBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8359 | return (PFN_vkVoidFunction) vkCmdFillBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8360 | if (!strcmp(funcName, "vkCmdClearColorImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8361 | return (PFN_vkVoidFunction) vkCmdClearColorImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8362 | if (!strcmp(funcName, "vkCmdResolveImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8363 | return (PFN_vkVoidFunction) vkCmdResolveImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8364 | if (!strcmp(funcName, "vkCmdSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8365 | return (PFN_vkVoidFunction) vkCmdSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8366 | if (!strcmp(funcName, "vkCmdResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8367 | return (PFN_vkVoidFunction) vkCmdResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8368 | if (!strcmp(funcName, "vkCmdWaitEvents")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8369 | return (PFN_vkVoidFunction) vkCmdWaitEvents; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8370 | if (!strcmp(funcName, "vkCmdPipelineBarrier")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8371 | return (PFN_vkVoidFunction) vkCmdPipelineBarrier; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8372 | if (!strcmp(funcName, "vkCmdBeginQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8373 | return (PFN_vkVoidFunction) vkCmdBeginQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8374 | if (!strcmp(funcName, "vkCmdEndQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8375 | return (PFN_vkVoidFunction) vkCmdEndQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8376 | if (!strcmp(funcName, "vkCmdResetQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8377 | return (PFN_vkVoidFunction) vkCmdResetQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8378 | if (!strcmp(funcName, "vkCmdWriteTimestamp")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8379 | return (PFN_vkVoidFunction) vkCmdWriteTimestamp; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8380 | if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8381 | return (PFN_vkVoidFunction) vkCmdCopyQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8382 | if (!strcmp(funcName, "vkCreateFramebuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8383 | return (PFN_vkVoidFunction) vkCreateFramebuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8384 | if (!strcmp(funcName, "vkCreateRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8385 | return (PFN_vkVoidFunction) vkCreateRenderPass; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8386 | if (!strcmp(funcName, "vkCmdBeginRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8387 | return (PFN_vkVoidFunction) vkCmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 8388 | if (!strcmp(funcName, "vkCmdNextSubpass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8389 | return (PFN_vkVoidFunction) vkCmdNextSubpass; |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 8390 | |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 8391 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8392 | if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8393 | return NULL; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8394 | return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 8395 | } |
| 8396 | } |
| 8397 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8398 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetInstanceProcAddr(VkInstance instance, const char* funcName) |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8399 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8400 | if (instance == NULL) { |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8401 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 8402 | } |
| 8403 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8404 | /* loader uses this to force layer initialization; instance object is wrapped */ |
| 8405 | if (!strcmp(funcName, "vkGetInstanceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8406 | initInstanceTable(pc_instance_table_map, (const VkBaseLayerObject *) instance); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8407 | return (PFN_vkVoidFunction) vkGetInstanceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 8408 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8409 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8410 | if (!strcmp(funcName, "vkCreateInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8411 | return (PFN_vkVoidFunction) vkCreateInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8412 | if (!strcmp(funcName, "vkDestroyInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8413 | return (PFN_vkVoidFunction) vkDestroyInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8414 | if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8415 | return (PFN_vkVoidFunction) vkEnumeratePhysicalDevices; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8416 | if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8417 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8418 | if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8419 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 8420 | if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8421 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFormatProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8422 | if (!strcmp(funcName, "vkGetPhysicalDeviceLimits")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8423 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceLimits; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8424 | if (!strcmp(funcName, "vkGetGlobalLayerProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8425 | return (PFN_vkVoidFunction) vkGetGlobalLayerProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8426 | if (!strcmp(funcName, "vkGetGlobalExtensionProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8427 | return (PFN_vkVoidFunction) vkGetGlobalExtensionProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8428 | if (!strcmp(funcName, "vkGetPhysicalDeviceLayerProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8429 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceLayerProperties; |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 8430 | if (!strcmp(funcName, "vkGetPhysicalDeviceExtensionProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 8431 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 8432 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8433 | 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] | 8434 | 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] | 8435 | if(fptr) |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 8436 | return fptr; |
| 8437 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 8438 | { |
| 8439 | if (get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr == NULL) |
| 8440 | return NULL; |
| 8441 | return get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr(instance, funcName); |
| 8442 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 8443 | } |