Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1 | /* |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 2 | * Vulkan |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2014 LunarG, Inc. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | * DEALINGS IN THE SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | #include <stdio.h> |
| 26 | #include <stdlib.h> |
| 27 | #include <string.h> |
| 28 | |
| 29 | #include <iostream> |
| 30 | #include <string> |
| 31 | #include <sstream> |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 32 | #include <unordered_map> |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 33 | #include <vector> |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 34 | |
Tobin Ehlis | b835d1b | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 35 | #include "vk_loader_platform.h" |
Tobin Ehlis | 0c6f9ee | 2015-07-03 09:42:57 -0600 | [diff] [blame] | 36 | #include "vk_layer.h" |
Tobin Ehlis | a0cb02e | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 37 | #include "vk_layer_config.h" |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 38 | #include "vk_enum_validate_helper.h" |
| 39 | #include "vk_struct_validate_helper.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 40 | //The following is #included again to catch certain OS-specific functions being used: |
Tobin Ehlis | b835d1b | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 41 | #include "vk_loader_platform.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 42 | |
Tobin Ehlis | a0cb02e | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 43 | #include "vk_layer_table.h" |
| 44 | #include "vk_layer_data.h" |
| 45 | #include "vk_layer_logging.h" |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 46 | #include "vk_layer_extension_utils.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 47 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 48 | typedef struct _layer_data { |
| 49 | debug_report_data *report_data; |
| 50 | VkDbgMsgCallback logging_callback; |
| 51 | } layer_data; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 52 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 53 | static std::unordered_map<void*, layer_data*> layer_data_map; |
| 54 | static device_table_map pc_device_table_map; |
| 55 | static instance_table_map pc_instance_table_map; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 56 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 57 | // "my instance data" |
| 58 | debug_report_data *mid(VkInstance object) |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 59 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 60 | dispatch_key key = get_dispatch_key(object); |
Tobin Ehlis | bfbac25 | 2015-09-01 11:46:36 -0600 | [diff] [blame] | 61 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 62 | #if DISPATCH_MAP_DEBUG |
| 63 | fprintf(stderr, "MID: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, data); |
| 64 | #endif |
Courtney Goeltzenleuchter | 876a4f5 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 65 | assert(data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 66 | |
| 67 | return data->report_data; |
| 68 | } |
| 69 | |
| 70 | // "my device data" |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 71 | debug_report_data *mdd(void* object) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 72 | { |
| 73 | dispatch_key key = get_dispatch_key(object); |
| 74 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 75 | #if DISPATCH_MAP_DEBUG |
| 76 | fprintf(stderr, "MDD: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, data); |
| 77 | #endif |
Courtney Goeltzenleuchter | 876a4f5 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 78 | assert(data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 79 | return data->report_data; |
| 80 | } |
| 81 | |
| 82 | static void InitParamChecker(layer_data *data) |
| 83 | { |
| 84 | uint32_t report_flags = getLayerOptionFlags("ParamCheckerReportFlags", 0); |
| 85 | |
| 86 | uint32_t debug_action = 0; |
| 87 | getLayerOptionEnum("ParamCheckerDebugAction", (uint32_t *) &debug_action); |
| 88 | if(debug_action & VK_DBG_LAYER_ACTION_LOG_MSG) |
| 89 | { |
| 90 | FILE *log_output = NULL; |
| 91 | const char* option_str = getLayerOption("ParamCheckerLogFilename"); |
Tobin Ehlis | b1df55e | 2015-09-15 09:55:54 -0600 | [diff] [blame] | 92 | log_output = getLayerLogOutput(option_str, "ParamChecker"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 93 | layer_create_msg_callback(data->report_data, report_flags, log_callback, (void*)log_output, &data->logging_callback); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | VK_LAYER_EXPORT VkResult VKAPI vkDbgCreateMsgCallback( |
| 98 | VkInstance instance, |
| 99 | VkFlags msgFlags, |
| 100 | const PFN_vkDbgMsgCallback pfnMsgCallback, |
| 101 | void* pUserData, |
| 102 | VkDbgMsgCallback* pMsgCallback) |
| 103 | { |
| 104 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 105 | VkResult result = pTable->DbgCreateMsgCallback(instance, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 106 | |
| 107 | if (result == VK_SUCCESS) |
| 108 | { |
| 109 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 110 | result = layer_create_msg_callback(data->report_data, msgFlags, pfnMsgCallback, pUserData, pMsgCallback); |
| 111 | } |
| 112 | |
| 113 | return result; |
| 114 | } |
| 115 | |
| 116 | VK_LAYER_EXPORT VkResult VKAPI vkDbgDestroyMsgCallback( |
| 117 | VkInstance instance, |
| 118 | VkDbgMsgCallback msgCallback) |
| 119 | { |
| 120 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 121 | VkResult result = pTable->DbgDestroyMsgCallback(instance, msgCallback); |
| 122 | |
| 123 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 124 | layer_destroy_msg_callback(data->report_data, msgCallback); |
| 125 | |
| 126 | return result; |
| 127 | } |
| 128 | |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 129 | static const VkLayerProperties pc_global_layers[] = { |
| 130 | { |
| 131 | "ParamChecker", |
| 132 | VK_API_VERSION, |
| 133 | VK_MAKE_VERSION(0, 1, 0), |
| 134 | "Validation layer: ParamChecker", |
| 135 | } |
| 136 | }; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 137 | |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 138 | VK_LAYER_EXPORT VkResult VKAPI vkEnumerateInstanceExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 139 | const char *pLayerName, |
| 140 | uint32_t *pCount, |
| 141 | VkExtensionProperties* pProperties) |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 142 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 143 | /* ParamChecker does not have any global extensions */ |
| 144 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 145 | } |
| 146 | |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 147 | VK_LAYER_EXPORT VkResult VKAPI vkEnumerateInstanceLayerProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 148 | uint32_t *pCount, |
| 149 | VkLayerProperties* pProperties) |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 150 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 151 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), |
| 152 | pc_global_layers, |
| 153 | pCount, pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 154 | } |
| 155 | |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 156 | VK_LAYER_EXPORT VkResult VKAPI vkEnumerateDeviceExtensionProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 157 | VkPhysicalDevice physicalDevice, |
| 158 | const char* pLayerName, |
| 159 | uint32_t* pCount, |
| 160 | VkExtensionProperties* pProperties) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 161 | { |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 162 | /* ParamChecker does not have any physical device extensions */ |
| 163 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 164 | } |
| 165 | |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 166 | VK_LAYER_EXPORT VkResult VKAPI vkEnumerateDeviceLayerProperties( |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 167 | VkPhysicalDevice physicalDevice, |
| 168 | uint32_t* pCount, |
| 169 | VkLayerProperties* pProperties) |
| 170 | { |
| 171 | /* ParamChecker's physical device layers are the same as global */ |
| 172 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, |
| 173 | pCount, pProperties); |
| 174 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 175 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 176 | // Version: 0.138.2 |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 177 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 178 | static |
| 179 | std::string EnumeratorString(VkResult const& enumerator) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 180 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 181 | switch(enumerator) |
| 182 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 183 | case VK_RESULT_MAX_ENUM: |
| 184 | { |
| 185 | return "VK_RESULT_MAX_ENUM"; |
| 186 | break; |
| 187 | } |
Courtney Goeltzenleuchter | 55659b7 | 2015-09-14 18:01:17 -0600 | [diff] [blame] | 188 | case VK_ERROR_LAYER_NOT_PRESENT: |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 189 | { |
Courtney Goeltzenleuchter | 55659b7 | 2015-09-14 18:01:17 -0600 | [diff] [blame] | 190 | return "VK_ERROR_LAYER_NOT_PRESENT"; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 191 | break; |
| 192 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 193 | case VK_ERROR_INCOMPATIBLE_DRIVER: |
| 194 | { |
| 195 | return "VK_ERROR_INCOMPATIBLE_DRIVER"; |
| 196 | break; |
| 197 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 198 | case VK_ERROR_MEMORY_MAP_FAILED: |
| 199 | { |
| 200 | return "VK_ERROR_MEMORY_MAP_FAILED"; |
| 201 | break; |
| 202 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 203 | case VK_INCOMPLETE: |
| 204 | { |
| 205 | return "VK_INCOMPLETE"; |
| 206 | break; |
| 207 | } |
| 208 | case VK_ERROR_OUT_OF_HOST_MEMORY: |
| 209 | { |
| 210 | return "VK_ERROR_OUT_OF_HOST_MEMORY"; |
| 211 | break; |
| 212 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 213 | case VK_ERROR_INITIALIZATION_FAILED: |
| 214 | { |
| 215 | return "VK_ERROR_INITIALIZATION_FAILED"; |
| 216 | break; |
| 217 | } |
| 218 | case VK_NOT_READY: |
| 219 | { |
| 220 | return "VK_NOT_READY"; |
| 221 | break; |
| 222 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 223 | case VK_ERROR_OUT_OF_DEVICE_MEMORY: |
| 224 | { |
| 225 | return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; |
| 226 | break; |
| 227 | } |
| 228 | case VK_EVENT_SET: |
| 229 | { |
| 230 | return "VK_EVENT_SET"; |
| 231 | break; |
| 232 | } |
| 233 | case VK_TIMEOUT: |
| 234 | { |
| 235 | return "VK_TIMEOUT"; |
| 236 | break; |
| 237 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 238 | case VK_EVENT_RESET: |
| 239 | { |
| 240 | return "VK_EVENT_RESET"; |
| 241 | break; |
| 242 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 243 | case VK_UNSUPPORTED: |
| 244 | { |
| 245 | return "VK_UNSUPPORTED"; |
| 246 | break; |
| 247 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 248 | case VK_SUCCESS: |
| 249 | { |
| 250 | return "VK_SUCCESS"; |
| 251 | break; |
| 252 | } |
Courtney Goeltzenleuchter | 55659b7 | 2015-09-14 18:01:17 -0600 | [diff] [blame] | 253 | case VK_ERROR_EXTENSION_NOT_PRESENT: |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 254 | { |
Courtney Goeltzenleuchter | 55659b7 | 2015-09-14 18:01:17 -0600 | [diff] [blame] | 255 | return "VK_ERROR_EXTENSION_NOT_PRESENT"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 256 | break; |
| 257 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 258 | case VK_ERROR_DEVICE_LOST: |
| 259 | { |
| 260 | return "VK_ERROR_DEVICE_LOST"; |
| 261 | break; |
| 262 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 263 | default: |
| 264 | { |
| 265 | return "unrecognized enumerator"; |
| 266 | break; |
| 267 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 268 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 272 | bool ValidateEnumerator(VkFormatFeatureFlagBits const& enumerator) |
| 273 | { |
Courtney Goeltzenleuchter | f1ece60 | 2015-09-10 16:25:49 -0600 | [diff] [blame] | 274 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 275 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | |
| 276 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 277 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | |
| 278 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 279 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | |
| 280 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | |
| 281 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 282 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | |
| 283 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 284 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 285 | VK_FORMAT_FEATURE_BLIT_SOURCE_BIT | |
| 286 | VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 287 | if(enumerator & (~allFlags)) |
| 288 | { |
| 289 | return false; |
| 290 | } |
| 291 | |
| 292 | return true; |
| 293 | } |
| 294 | |
| 295 | static |
| 296 | std::string EnumeratorString(VkFormatFeatureFlagBits const& enumerator) |
| 297 | { |
| 298 | if(!ValidateEnumerator(enumerator)) |
| 299 | { |
| 300 | return "unrecognized enumerator"; |
| 301 | } |
| 302 | |
| 303 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 304 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) |
| 305 | { |
| 306 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 307 | } |
| 308 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) |
| 309 | { |
| 310 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 311 | } |
| 312 | if(enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) |
| 313 | { |
| 314 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 315 | } |
| 316 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) |
| 317 | { |
| 318 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 319 | } |
| 320 | if(enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) |
| 321 | { |
| 322 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 323 | } |
| 324 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) |
| 325 | { |
| 326 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 327 | } |
| 328 | if(enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) |
| 329 | { |
| 330 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 331 | } |
| 332 | if(enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) |
| 333 | { |
| 334 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 335 | } |
| 336 | if(enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) |
| 337 | { |
| 338 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 339 | } |
| 340 | if(enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 341 | { |
| 342 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 343 | } |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 344 | if(enumerator & VK_FORMAT_FEATURE_BLIT_SOURCE_BIT) |
| 345 | { |
| 346 | strings.push_back("VK_FORMAT_FEATURE_BLIT_SOURCE_BIT"); |
| 347 | } |
| 348 | if(enumerator & VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT) |
| 349 | { |
| 350 | strings.push_back("VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT"); |
| 351 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 352 | |
| 353 | std::string enumeratorString; |
| 354 | for(auto const& string : strings) |
| 355 | { |
| 356 | enumeratorString += string; |
| 357 | |
| 358 | if(string != strings.back()) |
| 359 | { |
| 360 | enumeratorString += '|'; |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | return enumeratorString; |
| 365 | } |
| 366 | |
| 367 | static |
| 368 | bool ValidateEnumerator(VkImageUsageFlagBits const& enumerator) |
| 369 | { |
| 370 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)(VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 371 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 372 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 373 | VK_IMAGE_USAGE_STORAGE_BIT | |
| 374 | VK_IMAGE_USAGE_SAMPLED_BIT | |
| 375 | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT | |
| 376 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | |
Cody Northrop | 84fa790 | 2015-08-25 15:39:48 -0600 | [diff] [blame] | 377 | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 378 | if(enumerator & (~allFlags)) |
| 379 | { |
| 380 | return false; |
| 381 | } |
| 382 | |
| 383 | return true; |
| 384 | } |
| 385 | |
| 386 | static |
| 387 | std::string EnumeratorString(VkImageUsageFlagBits const& enumerator) |
| 388 | { |
| 389 | if(!ValidateEnumerator(enumerator)) |
| 390 | { |
| 391 | return "unrecognized enumerator"; |
| 392 | } |
| 393 | |
| 394 | std::vector<std::string> strings; |
| 395 | if(enumerator & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) |
| 396 | { |
| 397 | strings.push_back("VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT"); |
| 398 | } |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 399 | if(enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 400 | { |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 401 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 402 | } |
| 403 | if(enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) |
| 404 | { |
| 405 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 406 | } |
| 407 | if(enumerator & VK_IMAGE_USAGE_STORAGE_BIT) |
| 408 | { |
| 409 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 410 | } |
| 411 | if(enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) |
| 412 | { |
| 413 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 414 | } |
| 415 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT) |
| 416 | { |
| 417 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT"); |
| 418 | } |
| 419 | if(enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) |
| 420 | { |
| 421 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 422 | } |
| 423 | if(enumerator & VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT) |
| 424 | { |
| 425 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT"); |
| 426 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 427 | |
| 428 | std::string enumeratorString; |
| 429 | for(auto const& string : strings) |
| 430 | { |
| 431 | enumeratorString += string; |
| 432 | |
| 433 | if(string != strings.back()) |
| 434 | { |
| 435 | enumeratorString += '|'; |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | return enumeratorString; |
| 440 | } |
| 441 | |
| 442 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 443 | bool ValidateEnumerator(VkQueueFlagBits const& enumerator) |
| 444 | { |
| 445 | VkQueueFlagBits allFlags = (VkQueueFlagBits)(VK_QUEUE_EXTENDED_BIT | |
| 446 | VK_QUEUE_DMA_BIT | |
| 447 | VK_QUEUE_COMPUTE_BIT | |
| 448 | VK_QUEUE_SPARSE_MEMMGR_BIT | |
| 449 | VK_QUEUE_GRAPHICS_BIT); |
| 450 | if(enumerator & (~allFlags)) |
| 451 | { |
| 452 | return false; |
| 453 | } |
| 454 | |
| 455 | return true; |
| 456 | } |
| 457 | |
| 458 | static |
| 459 | std::string EnumeratorString(VkQueueFlagBits const& enumerator) |
| 460 | { |
| 461 | if(!ValidateEnumerator(enumerator)) |
| 462 | { |
| 463 | return "unrecognized enumerator"; |
| 464 | } |
| 465 | |
| 466 | std::vector<std::string> strings; |
| 467 | if(enumerator & VK_QUEUE_EXTENDED_BIT) |
| 468 | { |
| 469 | strings.push_back("VK_QUEUE_EXTENDED_BIT"); |
| 470 | } |
| 471 | if(enumerator & VK_QUEUE_DMA_BIT) |
| 472 | { |
| 473 | strings.push_back("VK_QUEUE_DMA_BIT"); |
| 474 | } |
| 475 | if(enumerator & VK_QUEUE_COMPUTE_BIT) |
| 476 | { |
| 477 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 478 | } |
| 479 | if(enumerator & VK_QUEUE_SPARSE_MEMMGR_BIT) |
| 480 | { |
| 481 | strings.push_back("VK_QUEUE_SPARSE_MEMMGR_BIT"); |
| 482 | } |
| 483 | if(enumerator & VK_QUEUE_GRAPHICS_BIT) |
| 484 | { |
| 485 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 486 | } |
| 487 | |
| 488 | std::string enumeratorString; |
| 489 | for(auto const& string : strings) |
| 490 | { |
| 491 | enumeratorString += string; |
| 492 | |
| 493 | if(string != strings.back()) |
| 494 | { |
| 495 | enumeratorString += '|'; |
| 496 | } |
| 497 | } |
| 498 | |
| 499 | return enumeratorString; |
| 500 | } |
| 501 | |
| 502 | static |
| 503 | bool ValidateEnumerator(VkMemoryPropertyFlagBits const& enumerator) |
| 504 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 505 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)(VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT | |
| 506 | VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 507 | VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT | |
| 508 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 509 | VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT | |
| 510 | VK_MEMORY_PROPERTY_DEVICE_ONLY); |
| 511 | if(enumerator & (~allFlags)) |
| 512 | { |
| 513 | return false; |
| 514 | } |
| 515 | |
| 516 | return true; |
| 517 | } |
| 518 | |
| 519 | static |
| 520 | std::string EnumeratorString(VkMemoryPropertyFlagBits const& enumerator) |
| 521 | { |
| 522 | if(!ValidateEnumerator(enumerator)) |
| 523 | { |
| 524 | return "unrecognized enumerator"; |
| 525 | } |
| 526 | |
| 527 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 528 | if(enumerator & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) |
| 529 | { |
| 530 | strings.push_back("VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT"); |
| 531 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 532 | if(enumerator & VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT) |
| 533 | { |
| 534 | strings.push_back("VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT"); |
| 535 | } |
| 536 | if(enumerator & VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT) |
| 537 | { |
| 538 | strings.push_back("VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT"); |
| 539 | } |
| 540 | if(enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) |
| 541 | { |
| 542 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 543 | } |
| 544 | if(enumerator & VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT) |
| 545 | { |
| 546 | strings.push_back("VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT"); |
| 547 | } |
| 548 | if(enumerator & VK_MEMORY_PROPERTY_DEVICE_ONLY) |
| 549 | { |
| 550 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_ONLY"); |
| 551 | } |
| 552 | |
| 553 | std::string enumeratorString; |
| 554 | for(auto const& string : strings) |
| 555 | { |
| 556 | enumeratorString += string; |
| 557 | |
| 558 | if(string != strings.back()) |
| 559 | { |
| 560 | enumeratorString += '|'; |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | return enumeratorString; |
| 565 | } |
| 566 | |
| 567 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 568 | bool ValidateEnumerator(VkMemoryHeapFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 569 | { |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 570 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_HOST_LOCAL_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 571 | if(enumerator & (~allFlags)) |
| 572 | { |
| 573 | return false; |
| 574 | } |
| 575 | |
| 576 | return true; |
| 577 | } |
| 578 | |
| 579 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 580 | std::string EnumeratorString(VkMemoryHeapFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 581 | { |
| 582 | if(!ValidateEnumerator(enumerator)) |
| 583 | { |
| 584 | return "unrecognized enumerator"; |
| 585 | } |
| 586 | |
| 587 | std::vector<std::string> strings; |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 588 | if(enumerator & VK_MEMORY_HEAP_HOST_LOCAL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 589 | { |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 590 | strings.push_back("VK_MEMORY_HEAP_HOST_LOCAL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 591 | } |
| 592 | |
| 593 | std::string enumeratorString; |
| 594 | for(auto const& string : strings) |
| 595 | { |
| 596 | enumeratorString += string; |
| 597 | |
| 598 | if(string != strings.back()) |
| 599 | { |
| 600 | enumeratorString += '|'; |
| 601 | } |
| 602 | } |
| 603 | |
| 604 | return enumeratorString; |
| 605 | } |
| 606 | |
| 607 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 608 | bool ValidateEnumerator(VkSparseImageFormatFlagBits const& enumerator) |
| 609 | { |
| 610 | VkSparseImageFormatFlagBits allFlags = (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT | |
| 611 | VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT | |
| 612 | VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT); |
| 613 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 614 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 615 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 616 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 617 | |
| 618 | return true; |
| 619 | } |
| 620 | |
| 621 | static |
| 622 | std::string EnumeratorString(VkSparseImageFormatFlagBits const& enumerator) |
| 623 | { |
| 624 | if(!ValidateEnumerator(enumerator)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 625 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 626 | return "unrecognized enumerator"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 627 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 628 | |
| 629 | std::vector<std::string> strings; |
| 630 | if(enumerator & VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 631 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 632 | strings.push_back("VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 633 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 634 | if(enumerator & VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 635 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 636 | strings.push_back("VK_SPARSE_IMAGE_FMT_ALIGNED_MIP_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 637 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 638 | if(enumerator & VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 639 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 640 | strings.push_back("VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 641 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 642 | |
| 643 | std::string enumeratorString; |
| 644 | for(auto const& string : strings) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 645 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 646 | enumeratorString += string; |
| 647 | |
| 648 | if(string != strings.back()) |
| 649 | { |
| 650 | enumeratorString += '|'; |
| 651 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 652 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 653 | |
| 654 | return enumeratorString; |
| 655 | } |
| 656 | |
| 657 | static |
| 658 | bool ValidateEnumerator(VkSparseMemoryBindFlagBits const& enumerator) |
| 659 | { |
| 660 | VkSparseMemoryBindFlagBits allFlags = (VkSparseMemoryBindFlagBits)(VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT); |
| 661 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 662 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 663 | return false; |
| 664 | } |
| 665 | |
| 666 | return true; |
| 667 | } |
| 668 | |
| 669 | static |
| 670 | std::string EnumeratorString(VkSparseMemoryBindFlagBits const& enumerator) |
| 671 | { |
| 672 | if(!ValidateEnumerator(enumerator)) |
| 673 | { |
| 674 | return "unrecognized enumerator"; |
| 675 | } |
| 676 | |
| 677 | std::vector<std::string> strings; |
| 678 | if(enumerator & VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT) |
| 679 | { |
| 680 | strings.push_back("VK_SPARSE_MEMORY_BIND_REPLICATE_64KIB_BLOCK_BIT"); |
| 681 | } |
| 682 | |
| 683 | std::string enumeratorString; |
| 684 | for(auto const& string : strings) |
| 685 | { |
| 686 | enumeratorString += string; |
| 687 | |
| 688 | if(string != strings.back()) |
| 689 | { |
| 690 | enumeratorString += '|'; |
| 691 | } |
| 692 | } |
| 693 | |
| 694 | return enumeratorString; |
| 695 | } |
| 696 | |
| 697 | static |
| 698 | bool ValidateEnumerator(VkFenceCreateFlagBits const& enumerator) |
| 699 | { |
| 700 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
| 701 | if(enumerator & (~allFlags)) |
| 702 | { |
| 703 | return false; |
| 704 | } |
| 705 | |
| 706 | return true; |
| 707 | } |
| 708 | |
| 709 | static |
| 710 | std::string EnumeratorString(VkFenceCreateFlagBits const& enumerator) |
| 711 | { |
| 712 | if(!ValidateEnumerator(enumerator)) |
| 713 | { |
| 714 | return "unrecognized enumerator"; |
| 715 | } |
| 716 | |
| 717 | std::vector<std::string> strings; |
| 718 | if(enumerator & VK_FENCE_CREATE_SIGNALED_BIT) |
| 719 | { |
| 720 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 721 | } |
| 722 | |
| 723 | std::string enumeratorString; |
| 724 | for(auto const& string : strings) |
| 725 | { |
| 726 | enumeratorString += string; |
| 727 | |
| 728 | if(string != strings.back()) |
| 729 | { |
| 730 | enumeratorString += '|'; |
| 731 | } |
| 732 | } |
| 733 | |
| 734 | return enumeratorString; |
| 735 | } |
| 736 | |
| 737 | static |
| 738 | bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 739 | { |
| 740 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)(VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT | |
| 741 | VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT | |
| 742 | VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT | |
| 743 | VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT | |
| 744 | VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT | |
| 745 | VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT | |
| 746 | VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT | |
| 747 | VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT | |
| 748 | VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT | |
| 749 | VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT | |
| 750 | VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT); |
| 751 | if(enumerator & (~allFlags)) |
| 752 | { |
| 753 | return false; |
| 754 | } |
| 755 | |
| 756 | return true; |
| 757 | } |
| 758 | |
| 759 | static |
| 760 | std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const& enumerator) |
| 761 | { |
| 762 | if(!ValidateEnumerator(enumerator)) |
| 763 | { |
| 764 | return "unrecognized enumerator"; |
| 765 | } |
| 766 | |
| 767 | std::vector<std::string> strings; |
| 768 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT) |
| 769 | { |
| 770 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT"); |
| 771 | } |
| 772 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT) |
| 773 | { |
| 774 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT"); |
| 775 | } |
| 776 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT) |
| 777 | { |
| 778 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT"); |
| 779 | } |
| 780 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT) |
| 781 | { |
| 782 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT"); |
| 783 | } |
| 784 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT) |
| 785 | { |
| 786 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT"); |
| 787 | } |
| 788 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT) |
| 789 | { |
| 790 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT"); |
| 791 | } |
| 792 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT) |
| 793 | { |
| 794 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT"); |
| 795 | } |
| 796 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT) |
| 797 | { |
| 798 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT"); |
| 799 | } |
| 800 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT) |
| 801 | { |
| 802 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT"); |
| 803 | } |
| 804 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT) |
| 805 | { |
| 806 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT"); |
| 807 | } |
| 808 | if(enumerator & VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT) |
| 809 | { |
| 810 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT"); |
| 811 | } |
| 812 | |
| 813 | std::string enumeratorString; |
| 814 | for(auto const& string : strings) |
| 815 | { |
| 816 | enumeratorString += string; |
| 817 | |
| 818 | if(string != strings.back()) |
| 819 | { |
| 820 | enumeratorString += '|'; |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | return enumeratorString; |
| 825 | } |
| 826 | |
| 827 | static |
| 828 | bool ValidateEnumerator(VkQueryResultFlagBits const& enumerator) |
| 829 | { |
| 830 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | |
| 831 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 832 | VK_QUERY_RESULT_WAIT_BIT | |
| 833 | VK_QUERY_RESULT_64_BIT | |
| 834 | VK_QUERY_RESULT_DEFAULT); |
| 835 | if(enumerator & (~allFlags)) |
| 836 | { |
| 837 | return false; |
| 838 | } |
| 839 | |
| 840 | return true; |
| 841 | } |
| 842 | |
| 843 | static |
| 844 | std::string EnumeratorString(VkQueryResultFlagBits const& enumerator) |
| 845 | { |
| 846 | if(!ValidateEnumerator(enumerator)) |
| 847 | { |
| 848 | return "unrecognized enumerator"; |
| 849 | } |
| 850 | |
| 851 | std::vector<std::string> strings; |
| 852 | if(enumerator & VK_QUERY_RESULT_PARTIAL_BIT) |
| 853 | { |
| 854 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 855 | } |
| 856 | if(enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) |
| 857 | { |
| 858 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 859 | } |
| 860 | if(enumerator & VK_QUERY_RESULT_WAIT_BIT) |
| 861 | { |
| 862 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 863 | } |
| 864 | if(enumerator & VK_QUERY_RESULT_64_BIT) |
| 865 | { |
| 866 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 867 | } |
| 868 | if(enumerator & VK_QUERY_RESULT_DEFAULT) |
| 869 | { |
| 870 | strings.push_back("VK_QUERY_RESULT_DEFAULT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 871 | } |
| 872 | |
| 873 | std::string enumeratorString; |
| 874 | for(auto const& string : strings) |
| 875 | { |
| 876 | enumeratorString += string; |
| 877 | |
| 878 | if(string != strings.back()) |
| 879 | { |
| 880 | enumeratorString += '|'; |
| 881 | } |
| 882 | } |
| 883 | |
| 884 | return enumeratorString; |
| 885 | } |
| 886 | |
| 887 | static |
| 888 | bool ValidateEnumerator(VkBufferUsageFlagBits const& enumerator) |
| 889 | { |
| 890 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | |
| 891 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | |
| 892 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 893 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | |
| 894 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | |
| 895 | VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT | |
| 896 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | |
| 897 | VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT | |
Cody Northrop | 84fa790 | 2015-08-25 15:39:48 -0600 | [diff] [blame] | 898 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 899 | if(enumerator & (~allFlags)) |
| 900 | { |
| 901 | return false; |
| 902 | } |
| 903 | |
| 904 | return true; |
| 905 | } |
| 906 | |
| 907 | static |
| 908 | std::string EnumeratorString(VkBufferUsageFlagBits const& enumerator) |
| 909 | { |
| 910 | if(!ValidateEnumerator(enumerator)) |
| 911 | { |
| 912 | return "unrecognized enumerator"; |
| 913 | } |
| 914 | |
| 915 | std::vector<std::string> strings; |
| 916 | if(enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) |
| 917 | { |
| 918 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 919 | } |
| 920 | if(enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) |
| 921 | { |
| 922 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 923 | } |
| 924 | if(enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) |
| 925 | { |
| 926 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 927 | } |
| 928 | if(enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) |
| 929 | { |
| 930 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 931 | } |
| 932 | if(enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) |
| 933 | { |
| 934 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 935 | } |
| 936 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT) |
| 937 | { |
| 938 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT"); |
| 939 | } |
| 940 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) |
| 941 | { |
| 942 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 943 | } |
| 944 | if(enumerator & VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT) |
| 945 | { |
| 946 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT"); |
| 947 | } |
| 948 | if(enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) |
| 949 | { |
| 950 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 951 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 952 | |
| 953 | std::string enumeratorString; |
| 954 | for(auto const& string : strings) |
| 955 | { |
| 956 | enumeratorString += string; |
| 957 | |
| 958 | if(string != strings.back()) |
| 959 | { |
| 960 | enumeratorString += '|'; |
| 961 | } |
| 962 | } |
| 963 | |
| 964 | return enumeratorString; |
| 965 | } |
| 966 | |
| 967 | static |
| 968 | bool ValidateEnumerator(VkBufferCreateFlagBits const& enumerator) |
| 969 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 970 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)(VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | |
| 971 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 972 | VK_BUFFER_CREATE_SPARSE_BINDING_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 973 | if(enumerator & (~allFlags)) |
| 974 | { |
| 975 | return false; |
| 976 | } |
| 977 | |
| 978 | return true; |
| 979 | } |
| 980 | |
| 981 | static |
| 982 | std::string EnumeratorString(VkBufferCreateFlagBits const& enumerator) |
| 983 | { |
| 984 | if(!ValidateEnumerator(enumerator)) |
| 985 | { |
| 986 | return "unrecognized enumerator"; |
| 987 | } |
| 988 | |
| 989 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 990 | if(enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) |
| 991 | { |
| 992 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 993 | } |
| 994 | if(enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) |
| 995 | { |
| 996 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 997 | } |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 998 | if(enumerator & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 999 | { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1000 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1001 | } |
| 1002 | |
| 1003 | std::string enumeratorString; |
| 1004 | for(auto const& string : strings) |
| 1005 | { |
| 1006 | enumeratorString += string; |
| 1007 | |
| 1008 | if(string != strings.back()) |
| 1009 | { |
| 1010 | enumeratorString += '|'; |
| 1011 | } |
| 1012 | } |
| 1013 | |
| 1014 | return enumeratorString; |
| 1015 | } |
| 1016 | |
| 1017 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1018 | bool ValidateEnumerator(VkImageCreateFlagBits const& enumerator) |
| 1019 | { |
| 1020 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)(VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1021 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | |
| 1022 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1023 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1024 | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1025 | if(enumerator & (~allFlags)) |
| 1026 | { |
| 1027 | return false; |
| 1028 | } |
| 1029 | |
| 1030 | return true; |
| 1031 | } |
| 1032 | |
| 1033 | static |
| 1034 | std::string EnumeratorString(VkImageCreateFlagBits const& enumerator) |
| 1035 | { |
| 1036 | if(!ValidateEnumerator(enumerator)) |
| 1037 | { |
| 1038 | return "unrecognized enumerator"; |
| 1039 | } |
| 1040 | |
| 1041 | std::vector<std::string> strings; |
| 1042 | if(enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) |
| 1043 | { |
| 1044 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 1045 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1046 | if(enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) |
| 1047 | { |
| 1048 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 1049 | } |
| 1050 | if(enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) |
| 1051 | { |
| 1052 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 1053 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1054 | if(enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) |
| 1055 | { |
| 1056 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 1057 | } |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1058 | if(enumerator & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1059 | { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 1060 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1061 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1062 | |
| 1063 | std::string enumeratorString; |
| 1064 | for(auto const& string : strings) |
| 1065 | { |
| 1066 | enumeratorString += string; |
| 1067 | |
| 1068 | if(string != strings.back()) |
| 1069 | { |
| 1070 | enumeratorString += '|'; |
| 1071 | } |
| 1072 | } |
| 1073 | |
| 1074 | return enumeratorString; |
| 1075 | } |
| 1076 | |
| 1077 | static |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1078 | bool ValidateEnumerator(VkImageViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1079 | { |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1080 | VkImageViewCreateFlagBits allFlags = (VkImageViewCreateFlagBits)(VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT | |
| 1081 | VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1082 | if(enumerator & (~allFlags)) |
| 1083 | { |
| 1084 | return false; |
| 1085 | } |
| 1086 | |
| 1087 | return true; |
| 1088 | } |
| 1089 | |
| 1090 | static |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1091 | std::string EnumeratorString(VkImageViewCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1092 | { |
| 1093 | if(!ValidateEnumerator(enumerator)) |
| 1094 | { |
| 1095 | return "unrecognized enumerator"; |
| 1096 | } |
| 1097 | |
| 1098 | std::vector<std::string> strings; |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1099 | if(enumerator & VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1100 | { |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1101 | strings.push_back("VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1102 | } |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1103 | if(enumerator & VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1104 | { |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 1105 | strings.push_back("VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1106 | } |
| 1107 | |
| 1108 | std::string enumeratorString; |
| 1109 | for(auto const& string : strings) |
| 1110 | { |
| 1111 | enumeratorString += string; |
| 1112 | |
| 1113 | if(string != strings.back()) |
| 1114 | { |
| 1115 | enumeratorString += '|'; |
| 1116 | } |
| 1117 | } |
| 1118 | |
| 1119 | return enumeratorString; |
| 1120 | } |
| 1121 | |
| 1122 | static |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1123 | bool ValidateEnumerator(VkChannelFlagBits const& enumerator) |
| 1124 | { |
| 1125 | VkChannelFlagBits allFlags = (VkChannelFlagBits)(VK_CHANNEL_A_BIT | |
| 1126 | VK_CHANNEL_B_BIT | |
| 1127 | VK_CHANNEL_G_BIT | |
| 1128 | VK_CHANNEL_R_BIT); |
| 1129 | if(enumerator & (~allFlags)) |
| 1130 | { |
| 1131 | return false; |
| 1132 | } |
| 1133 | |
| 1134 | return true; |
| 1135 | } |
| 1136 | |
| 1137 | static |
| 1138 | std::string EnumeratorString(VkChannelFlagBits const& enumerator) |
| 1139 | { |
| 1140 | if(!ValidateEnumerator(enumerator)) |
| 1141 | { |
| 1142 | return "unrecognized enumerator"; |
| 1143 | } |
| 1144 | |
| 1145 | std::vector<std::string> strings; |
| 1146 | if(enumerator & VK_CHANNEL_A_BIT) |
| 1147 | { |
| 1148 | strings.push_back("VK_CHANNEL_A_BIT"); |
| 1149 | } |
| 1150 | if(enumerator & VK_CHANNEL_B_BIT) |
| 1151 | { |
| 1152 | strings.push_back("VK_CHANNEL_B_BIT"); |
| 1153 | } |
| 1154 | if(enumerator & VK_CHANNEL_G_BIT) |
| 1155 | { |
| 1156 | strings.push_back("VK_CHANNEL_G_BIT"); |
| 1157 | } |
| 1158 | if(enumerator & VK_CHANNEL_R_BIT) |
| 1159 | { |
| 1160 | strings.push_back("VK_CHANNEL_R_BIT"); |
| 1161 | } |
| 1162 | |
| 1163 | std::string enumeratorString; |
| 1164 | for(auto const& string : strings) |
| 1165 | { |
| 1166 | enumeratorString += string; |
| 1167 | |
| 1168 | if(string != strings.back()) |
| 1169 | { |
| 1170 | enumeratorString += '|'; |
| 1171 | } |
| 1172 | } |
| 1173 | |
| 1174 | return enumeratorString; |
| 1175 | } |
| 1176 | |
| 1177 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1178 | bool ValidateEnumerator(VkPipelineCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1179 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1180 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)(VK_PIPELINE_CREATE_DERIVATIVE_BIT | |
| 1181 | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | |
| 1182 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1183 | if(enumerator & (~allFlags)) |
| 1184 | { |
| 1185 | return false; |
| 1186 | } |
| 1187 | |
| 1188 | return true; |
| 1189 | } |
| 1190 | |
| 1191 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1192 | std::string EnumeratorString(VkPipelineCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1193 | { |
| 1194 | if(!ValidateEnumerator(enumerator)) |
| 1195 | { |
| 1196 | return "unrecognized enumerator"; |
| 1197 | } |
| 1198 | |
| 1199 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1200 | if(enumerator & VK_PIPELINE_CREATE_DERIVATIVE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1201 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1202 | strings.push_back("VK_PIPELINE_CREATE_DERIVATIVE_BIT"); |
| 1203 | } |
| 1204 | if(enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) |
| 1205 | { |
| 1206 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 1207 | } |
| 1208 | if(enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) |
| 1209 | { |
| 1210 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1211 | } |
| 1212 | |
| 1213 | std::string enumeratorString; |
| 1214 | for(auto const& string : strings) |
| 1215 | { |
| 1216 | enumeratorString += string; |
| 1217 | |
| 1218 | if(string != strings.back()) |
| 1219 | { |
| 1220 | enumeratorString += '|'; |
| 1221 | } |
| 1222 | } |
| 1223 | |
| 1224 | return enumeratorString; |
| 1225 | } |
| 1226 | |
| 1227 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1228 | bool ValidateEnumerator(VkShaderStageFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1229 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1230 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)(VK_SHADER_STAGE_ALL | |
| 1231 | VK_SHADER_STAGE_FRAGMENT_BIT | |
| 1232 | VK_SHADER_STAGE_GEOMETRY_BIT | |
| 1233 | VK_SHADER_STAGE_COMPUTE_BIT | |
| 1234 | VK_SHADER_STAGE_TESS_EVALUATION_BIT | |
| 1235 | VK_SHADER_STAGE_TESS_CONTROL_BIT | |
| 1236 | VK_SHADER_STAGE_VERTEX_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1237 | if(enumerator & (~allFlags)) |
| 1238 | { |
| 1239 | return false; |
| 1240 | } |
| 1241 | |
| 1242 | return true; |
| 1243 | } |
| 1244 | |
| 1245 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1246 | std::string EnumeratorString(VkShaderStageFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1247 | { |
| 1248 | if(!ValidateEnumerator(enumerator)) |
| 1249 | { |
| 1250 | return "unrecognized enumerator"; |
| 1251 | } |
| 1252 | |
| 1253 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1254 | if(enumerator & VK_SHADER_STAGE_ALL) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1255 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1256 | strings.push_back("VK_SHADER_STAGE_ALL"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1257 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1258 | if(enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1259 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1260 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1261 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1262 | if(enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1263 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1264 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 1265 | } |
| 1266 | if(enumerator & VK_SHADER_STAGE_COMPUTE_BIT) |
| 1267 | { |
| 1268 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 1269 | } |
| 1270 | if(enumerator & VK_SHADER_STAGE_TESS_EVALUATION_BIT) |
| 1271 | { |
| 1272 | strings.push_back("VK_SHADER_STAGE_TESS_EVALUATION_BIT"); |
| 1273 | } |
| 1274 | if(enumerator & VK_SHADER_STAGE_TESS_CONTROL_BIT) |
| 1275 | { |
| 1276 | strings.push_back("VK_SHADER_STAGE_TESS_CONTROL_BIT"); |
| 1277 | } |
| 1278 | if(enumerator & VK_SHADER_STAGE_VERTEX_BIT) |
| 1279 | { |
| 1280 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1281 | } |
| 1282 | |
| 1283 | std::string enumeratorString; |
| 1284 | for(auto const& string : strings) |
| 1285 | { |
| 1286 | enumeratorString += string; |
| 1287 | |
| 1288 | if(string != strings.back()) |
| 1289 | { |
| 1290 | enumeratorString += '|'; |
| 1291 | } |
| 1292 | } |
| 1293 | |
| 1294 | return enumeratorString; |
| 1295 | } |
| 1296 | |
| 1297 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1298 | bool ValidateEnumerator(VkSubpassDescriptionFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1299 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1300 | VkSubpassDescriptionFlagBits allFlags = (VkSubpassDescriptionFlagBits)(VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1301 | if(enumerator & (~allFlags)) |
| 1302 | { |
| 1303 | return false; |
| 1304 | } |
| 1305 | |
| 1306 | return true; |
| 1307 | } |
| 1308 | |
| 1309 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1310 | std::string EnumeratorString(VkSubpassDescriptionFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1311 | { |
| 1312 | if(!ValidateEnumerator(enumerator)) |
| 1313 | { |
| 1314 | return "unrecognized enumerator"; |
| 1315 | } |
| 1316 | |
| 1317 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1318 | if(enumerator & VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1319 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1320 | strings.push_back("VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1321 | } |
| 1322 | |
| 1323 | std::string enumeratorString; |
| 1324 | for(auto const& string : strings) |
| 1325 | { |
| 1326 | enumeratorString += string; |
| 1327 | |
| 1328 | if(string != strings.back()) |
| 1329 | { |
| 1330 | enumeratorString += '|'; |
| 1331 | } |
| 1332 | } |
| 1333 | |
| 1334 | return enumeratorString; |
| 1335 | } |
| 1336 | |
| 1337 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1338 | bool ValidateEnumerator(VkPipelineStageFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1339 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1340 | VkPipelineStageFlagBits allFlags = (VkPipelineStageFlagBits)(VK_PIPELINE_STAGE_ALL_GRAPHICS | |
| 1341 | VK_PIPELINE_STAGE_HOST_BIT | |
| 1342 | VK_PIPELINE_STAGE_TRANSFER_BIT | |
| 1343 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | |
| 1344 | VK_PIPELINE_STAGE_ALL_GPU_COMMANDS | |
| 1345 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1346 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | |
| 1347 | VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT | |
| 1348 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | |
| 1349 | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT | |
| 1350 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | |
| 1351 | VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT | |
| 1352 | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | |
| 1353 | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | |
| 1354 | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | |
| 1355 | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1356 | if(enumerator & (~allFlags)) |
| 1357 | { |
| 1358 | return false; |
| 1359 | } |
| 1360 | |
| 1361 | return true; |
| 1362 | } |
| 1363 | |
| 1364 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1365 | std::string EnumeratorString(VkPipelineStageFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1366 | { |
| 1367 | if(!ValidateEnumerator(enumerator)) |
| 1368 | { |
| 1369 | return "unrecognized enumerator"; |
| 1370 | } |
| 1371 | |
| 1372 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1373 | if(enumerator & VK_PIPELINE_STAGE_ALL_GRAPHICS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1374 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1375 | strings.push_back("VK_PIPELINE_STAGE_ALL_GRAPHICS"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1376 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1377 | if(enumerator & VK_PIPELINE_STAGE_HOST_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_STAGE_HOST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1380 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1381 | if(enumerator & VK_PIPELINE_STAGE_TRANSFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1382 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1383 | strings.push_back("VK_PIPELINE_STAGE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1384 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1385 | if(enumerator & VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1386 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1387 | strings.push_back("VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1388 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1389 | if(enumerator & VK_PIPELINE_STAGE_ALL_GPU_COMMANDS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1390 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1391 | strings.push_back("VK_PIPELINE_STAGE_ALL_GPU_COMMANDS"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1392 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1393 | if(enumerator & VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1394 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1395 | strings.push_back("VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1396 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1397 | if(enumerator & VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1398 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1399 | strings.push_back("VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1400 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1401 | if(enumerator & VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1402 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1403 | strings.push_back("VK_PIPELINE_STAGE_TESS_CONTROL_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1404 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1405 | if(enumerator & VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1406 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1407 | strings.push_back("VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1408 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1409 | if(enumerator & VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1410 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1411 | strings.push_back("VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT"); |
| 1412 | } |
| 1413 | if(enumerator & VK_PIPELINE_STAGE_VERTEX_SHADER_BIT) |
| 1414 | { |
| 1415 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_SHADER_BIT"); |
| 1416 | } |
| 1417 | if(enumerator & VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT) |
| 1418 | { |
| 1419 | strings.push_back("VK_PIPELINE_STAGE_TESS_EVALUATION_SHADER_BIT"); |
| 1420 | } |
| 1421 | if(enumerator & VK_PIPELINE_STAGE_VERTEX_INPUT_BIT) |
| 1422 | { |
| 1423 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_INPUT_BIT"); |
| 1424 | } |
| 1425 | if(enumerator & VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT) |
| 1426 | { |
| 1427 | strings.push_back("VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT"); |
| 1428 | } |
| 1429 | if(enumerator & VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT) |
| 1430 | { |
| 1431 | strings.push_back("VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT"); |
| 1432 | } |
| 1433 | if(enumerator & VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) |
| 1434 | { |
| 1435 | strings.push_back("VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1436 | } |
| 1437 | |
| 1438 | std::string enumeratorString; |
| 1439 | for(auto const& string : strings) |
| 1440 | { |
| 1441 | enumeratorString += string; |
| 1442 | |
| 1443 | if(string != strings.back()) |
| 1444 | { |
| 1445 | enumeratorString += '|'; |
| 1446 | } |
| 1447 | } |
| 1448 | |
| 1449 | return enumeratorString; |
| 1450 | } |
| 1451 | |
| 1452 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1453 | bool ValidateEnumerator(VkMemoryOutputFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1454 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1455 | VkMemoryOutputFlagBits allFlags = (VkMemoryOutputFlagBits)(VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 1456 | VK_MEMORY_OUTPUT_TRANSFER_BIT | |
| 1457 | VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT | |
| 1458 | VK_MEMORY_OUTPUT_SHADER_WRITE_BIT | |
| 1459 | VK_MEMORY_OUTPUT_HOST_WRITE_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1460 | if(enumerator & (~allFlags)) |
| 1461 | { |
| 1462 | return false; |
| 1463 | } |
| 1464 | |
| 1465 | return true; |
| 1466 | } |
| 1467 | |
| 1468 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1469 | std::string EnumeratorString(VkMemoryOutputFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1470 | { |
| 1471 | if(!ValidateEnumerator(enumerator)) |
| 1472 | { |
| 1473 | return "unrecognized enumerator"; |
| 1474 | } |
| 1475 | |
| 1476 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1477 | if(enumerator & VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1478 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1479 | strings.push_back("VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1480 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1481 | if(enumerator & VK_MEMORY_OUTPUT_TRANSFER_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1482 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1483 | strings.push_back("VK_MEMORY_OUTPUT_TRANSFER_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1484 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1485 | if(enumerator & VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1486 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1487 | strings.push_back("VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT"); |
| 1488 | } |
| 1489 | if(enumerator & VK_MEMORY_OUTPUT_SHADER_WRITE_BIT) |
| 1490 | { |
| 1491 | strings.push_back("VK_MEMORY_OUTPUT_SHADER_WRITE_BIT"); |
| 1492 | } |
| 1493 | if(enumerator & VK_MEMORY_OUTPUT_HOST_WRITE_BIT) |
| 1494 | { |
| 1495 | strings.push_back("VK_MEMORY_OUTPUT_HOST_WRITE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1496 | } |
| 1497 | |
| 1498 | std::string enumeratorString; |
| 1499 | for(auto const& string : strings) |
| 1500 | { |
| 1501 | enumeratorString += string; |
| 1502 | |
| 1503 | if(string != strings.back()) |
| 1504 | { |
| 1505 | enumeratorString += '|'; |
| 1506 | } |
| 1507 | } |
| 1508 | |
| 1509 | return enumeratorString; |
| 1510 | } |
| 1511 | |
| 1512 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1513 | bool ValidateEnumerator(VkMemoryInputFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1514 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1515 | VkMemoryInputFlagBits allFlags = (VkMemoryInputFlagBits)(VK_MEMORY_INPUT_TRANSFER_BIT | |
| 1516 | VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
| 1517 | VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT | |
| 1518 | VK_MEMORY_INPUT_SHADER_READ_BIT | |
| 1519 | VK_MEMORY_INPUT_UNIFORM_READ_BIT | |
| 1520 | VK_MEMORY_INPUT_INDEX_FETCH_BIT | |
| 1521 | VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT | |
| 1522 | VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT | |
| 1523 | VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT | |
| 1524 | VK_MEMORY_INPUT_HOST_READ_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1525 | if(enumerator & (~allFlags)) |
| 1526 | { |
| 1527 | return false; |
| 1528 | } |
| 1529 | |
| 1530 | return true; |
| 1531 | } |
| 1532 | |
| 1533 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1534 | std::string EnumeratorString(VkMemoryInputFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1535 | { |
| 1536 | if(!ValidateEnumerator(enumerator)) |
| 1537 | { |
| 1538 | return "unrecognized enumerator"; |
| 1539 | } |
| 1540 | |
| 1541 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1542 | if(enumerator & VK_MEMORY_INPUT_TRANSFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1543 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1544 | strings.push_back("VK_MEMORY_INPUT_TRANSFER_BIT"); |
| 1545 | } |
| 1546 | if(enumerator & VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT) |
| 1547 | { |
| 1548 | strings.push_back("VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 1549 | } |
| 1550 | if(enumerator & VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT) |
| 1551 | { |
| 1552 | strings.push_back("VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT"); |
| 1553 | } |
| 1554 | if(enumerator & VK_MEMORY_INPUT_SHADER_READ_BIT) |
| 1555 | { |
| 1556 | strings.push_back("VK_MEMORY_INPUT_SHADER_READ_BIT"); |
| 1557 | } |
| 1558 | if(enumerator & VK_MEMORY_INPUT_UNIFORM_READ_BIT) |
| 1559 | { |
| 1560 | strings.push_back("VK_MEMORY_INPUT_UNIFORM_READ_BIT"); |
| 1561 | } |
| 1562 | if(enumerator & VK_MEMORY_INPUT_INDEX_FETCH_BIT) |
| 1563 | { |
| 1564 | strings.push_back("VK_MEMORY_INPUT_INDEX_FETCH_BIT"); |
| 1565 | } |
| 1566 | if(enumerator & VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT) |
| 1567 | { |
| 1568 | strings.push_back("VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT"); |
| 1569 | } |
| 1570 | if(enumerator & VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT) |
| 1571 | { |
| 1572 | strings.push_back("VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT"); |
| 1573 | } |
| 1574 | if(enumerator & VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT) |
| 1575 | { |
| 1576 | strings.push_back("VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT"); |
| 1577 | } |
| 1578 | if(enumerator & VK_MEMORY_INPUT_HOST_READ_BIT) |
| 1579 | { |
| 1580 | strings.push_back("VK_MEMORY_INPUT_HOST_READ_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1581 | } |
| 1582 | |
| 1583 | std::string enumeratorString; |
| 1584 | for(auto const& string : strings) |
| 1585 | { |
| 1586 | enumeratorString += string; |
| 1587 | |
| 1588 | if(string != strings.back()) |
| 1589 | { |
| 1590 | enumeratorString += '|'; |
| 1591 | } |
| 1592 | } |
| 1593 | |
| 1594 | return enumeratorString; |
| 1595 | } |
| 1596 | |
| 1597 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1598 | bool ValidateEnumerator(VkCmdPoolCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1599 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1600 | VkCmdPoolCreateFlagBits allFlags = (VkCmdPoolCreateFlagBits)(VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | |
| 1601 | VK_CMD_POOL_CREATE_TRANSIENT_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1602 | if(enumerator & (~allFlags)) |
| 1603 | { |
| 1604 | return false; |
| 1605 | } |
| 1606 | |
| 1607 | return true; |
| 1608 | } |
| 1609 | |
| 1610 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1611 | std::string EnumeratorString(VkCmdPoolCreateFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1612 | { |
| 1613 | if(!ValidateEnumerator(enumerator)) |
| 1614 | { |
| 1615 | return "unrecognized enumerator"; |
| 1616 | } |
| 1617 | |
| 1618 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1619 | if(enumerator & VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1620 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1621 | strings.push_back("VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1622 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1623 | if(enumerator & VK_CMD_POOL_CREATE_TRANSIENT_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1624 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1625 | strings.push_back("VK_CMD_POOL_CREATE_TRANSIENT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1626 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1627 | |
| 1628 | std::string enumeratorString; |
| 1629 | for(auto const& string : strings) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1630 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1631 | enumeratorString += string; |
| 1632 | |
| 1633 | if(string != strings.back()) |
| 1634 | { |
| 1635 | enumeratorString += '|'; |
| 1636 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1637 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1638 | |
| 1639 | return enumeratorString; |
| 1640 | } |
| 1641 | |
| 1642 | static |
| 1643 | bool ValidateEnumerator(VkCmdPoolResetFlagBits const& enumerator) |
| 1644 | { |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 1645 | VkCmdPoolResetFlagBits allFlags = (VkCmdPoolResetFlagBits)(VK_CMD_POOL_RESET_RELEASE_RESOURCES_BIT); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1646 | if(enumerator & (~allFlags)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1647 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1648 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1649 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1650 | |
| 1651 | return true; |
| 1652 | } |
| 1653 | |
| 1654 | static |
| 1655 | std::string EnumeratorString(VkCmdPoolResetFlagBits const& enumerator) |
| 1656 | { |
| 1657 | if(!ValidateEnumerator(enumerator)) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1658 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1659 | return "unrecognized enumerator"; |
| 1660 | } |
| 1661 | |
| 1662 | std::vector<std::string> strings; |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 1663 | if(enumerator & VK_CMD_POOL_RESET_RELEASE_RESOURCES_BIT) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1664 | { |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 1665 | strings.push_back("VK_CMD_POOL_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1666 | } |
| 1667 | |
| 1668 | std::string enumeratorString; |
| 1669 | for(auto const& string : strings) |
| 1670 | { |
| 1671 | enumeratorString += string; |
| 1672 | |
| 1673 | if(string != strings.back()) |
| 1674 | { |
| 1675 | enumeratorString += '|'; |
| 1676 | } |
| 1677 | } |
| 1678 | |
| 1679 | return enumeratorString; |
| 1680 | } |
| 1681 | |
| 1682 | static |
| 1683 | bool ValidateEnumerator(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1684 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1685 | VkCmdBufferOptimizeFlagBits allFlags = (VkCmdBufferOptimizeFlagBits)(VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT | |
| 1686 | VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1687 | VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT | |
| 1688 | VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT | |
| 1689 | VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT); |
| 1690 | if(enumerator & (~allFlags)) |
| 1691 | { |
| 1692 | return false; |
| 1693 | } |
| 1694 | |
| 1695 | return true; |
| 1696 | } |
| 1697 | |
| 1698 | static |
| 1699 | std::string EnumeratorString(VkCmdBufferOptimizeFlagBits const& enumerator) |
| 1700 | { |
| 1701 | if(!ValidateEnumerator(enumerator)) |
| 1702 | { |
| 1703 | return "unrecognized enumerator"; |
| 1704 | } |
| 1705 | |
| 1706 | std::vector<std::string> strings; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1707 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT) |
| 1708 | { |
| 1709 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT"); |
| 1710 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1711 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT) |
| 1712 | { |
| 1713 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT"); |
| 1714 | } |
| 1715 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT) |
| 1716 | { |
| 1717 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT"); |
| 1718 | } |
| 1719 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT) |
| 1720 | { |
| 1721 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT"); |
| 1722 | } |
| 1723 | if(enumerator & VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT) |
| 1724 | { |
| 1725 | strings.push_back("VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT"); |
| 1726 | } |
| 1727 | |
| 1728 | std::string enumeratorString; |
| 1729 | for(auto const& string : strings) |
| 1730 | { |
| 1731 | enumeratorString += string; |
| 1732 | |
| 1733 | if(string != strings.back()) |
| 1734 | { |
| 1735 | enumeratorString += '|'; |
| 1736 | } |
| 1737 | } |
| 1738 | |
| 1739 | return enumeratorString; |
| 1740 | } |
| 1741 | |
| 1742 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1743 | bool ValidateEnumerator(VkCmdBufferResetFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1744 | { |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 1745 | VkCmdBufferResetFlagBits allFlags = (VkCmdBufferResetFlagBits)(VK_CMD_BUFFER_RESET_RELEASE_RESOURCES_BIT); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1746 | if(enumerator & (~allFlags)) |
| 1747 | { |
| 1748 | return false; |
| 1749 | } |
| 1750 | |
| 1751 | return true; |
| 1752 | } |
| 1753 | |
| 1754 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1755 | std::string EnumeratorString(VkCmdBufferResetFlagBits const& enumerator) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1756 | { |
| 1757 | if(!ValidateEnumerator(enumerator)) |
| 1758 | { |
| 1759 | return "unrecognized enumerator"; |
| 1760 | } |
| 1761 | |
| 1762 | std::vector<std::string> strings; |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 1763 | if(enumerator & VK_CMD_BUFFER_RESET_RELEASE_RESOURCES_BIT) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1764 | { |
Courtney Goeltzenleuchter | 7b0d95d | 2015-09-11 11:40:48 -0600 | [diff] [blame] | 1765 | strings.push_back("VK_CMD_BUFFER_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1766 | } |
| 1767 | |
| 1768 | std::string enumeratorString; |
| 1769 | for(auto const& string : strings) |
| 1770 | { |
| 1771 | enumeratorString += string; |
| 1772 | |
| 1773 | if(string != strings.back()) |
| 1774 | { |
| 1775 | enumeratorString += '|'; |
| 1776 | } |
| 1777 | } |
| 1778 | |
| 1779 | return enumeratorString; |
| 1780 | } |
| 1781 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1782 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1783 | bool ValidateEnumerator(VkImageAspectFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1784 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1785 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_METADATA_BIT | |
| 1786 | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1787 | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 1788 | VK_IMAGE_ASPECT_COLOR_BIT); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1789 | if(enumerator & (~allFlags)) |
| 1790 | { |
| 1791 | return false; |
| 1792 | } |
| 1793 | |
| 1794 | return true; |
| 1795 | } |
| 1796 | |
| 1797 | static |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1798 | std::string EnumeratorString(VkImageAspectFlagBits const& enumerator) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1799 | { |
| 1800 | if(!ValidateEnumerator(enumerator)) |
| 1801 | { |
| 1802 | return "unrecognized enumerator"; |
| 1803 | } |
| 1804 | |
| 1805 | std::vector<std::string> strings; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1806 | if(enumerator & VK_IMAGE_ASPECT_METADATA_BIT) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1807 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1808 | strings.push_back("VK_IMAGE_ASPECT_METADATA_BIT"); |
| 1809 | } |
| 1810 | if(enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) |
| 1811 | { |
| 1812 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1813 | } |
| 1814 | if(enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) |
| 1815 | { |
| 1816 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1817 | } |
| 1818 | if(enumerator & VK_IMAGE_ASPECT_COLOR_BIT) |
| 1819 | { |
| 1820 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1821 | } |
| 1822 | |
| 1823 | std::string enumeratorString; |
| 1824 | for(auto const& string : strings) |
| 1825 | { |
| 1826 | enumeratorString += string; |
| 1827 | |
| 1828 | if(string != strings.back()) |
| 1829 | { |
| 1830 | enumeratorString += '|'; |
| 1831 | } |
| 1832 | } |
| 1833 | |
| 1834 | return enumeratorString; |
| 1835 | } |
| 1836 | |
| 1837 | static |
| 1838 | bool ValidateEnumerator(VkQueryControlFlagBits const& enumerator) |
| 1839 | { |
| 1840 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_CONSERVATIVE_BIT); |
| 1841 | if(enumerator & (~allFlags)) |
| 1842 | { |
| 1843 | return false; |
| 1844 | } |
| 1845 | |
| 1846 | return true; |
| 1847 | } |
| 1848 | |
| 1849 | static |
| 1850 | std::string EnumeratorString(VkQueryControlFlagBits const& enumerator) |
| 1851 | { |
| 1852 | if(!ValidateEnumerator(enumerator)) |
| 1853 | { |
| 1854 | return "unrecognized enumerator"; |
| 1855 | } |
| 1856 | |
| 1857 | std::vector<std::string> strings; |
| 1858 | if(enumerator & VK_QUERY_CONTROL_CONSERVATIVE_BIT) |
| 1859 | { |
| 1860 | strings.push_back("VK_QUERY_CONTROL_CONSERVATIVE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1861 | } |
| 1862 | |
| 1863 | std::string enumeratorString; |
| 1864 | for(auto const& string : strings) |
| 1865 | { |
| 1866 | enumeratorString += string; |
| 1867 | |
| 1868 | if(string != strings.back()) |
| 1869 | { |
| 1870 | enumeratorString += '|'; |
| 1871 | } |
| 1872 | } |
| 1873 | |
| 1874 | return enumeratorString; |
| 1875 | } |
| 1876 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1877 | VK_LAYER_EXPORT VkResult VKAPI vkCreateInstance( |
| 1878 | const VkInstanceCreateInfo* pCreateInfo, |
| 1879 | VkInstance* pInstance) |
| 1880 | { |
| 1881 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, *pInstance); |
| 1882 | VkResult result = pTable->CreateInstance(pCreateInfo, pInstance); |
| 1883 | |
| 1884 | if (result == VK_SUCCESS) { |
| 1885 | layer_data *data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); |
| 1886 | data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->extensionCount, |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 1887 | pCreateInfo->ppEnabledExtensionNames); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1888 | |
| 1889 | InitParamChecker(data); |
| 1890 | } |
| 1891 | |
| 1892 | return result; |
| 1893 | } |
| 1894 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 1895 | VK_LAYER_EXPORT void VKAPI vkDestroyInstance( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1896 | VkInstance instance) |
| 1897 | { |
| 1898 | // Grab the key before the instance is destroyed. |
| 1899 | dispatch_key key = get_dispatch_key(instance); |
| 1900 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 1901 | pTable->DestroyInstance(instance); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1902 | |
| 1903 | // Clean up logging callback, if any |
| 1904 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 1905 | if(data->logging_callback) |
| 1906 | { |
| 1907 | layer_destroy_msg_callback(data->report_data, data->logging_callback); |
| 1908 | } |
| 1909 | |
| 1910 | layer_debug_report_destroy_instance(mid(instance)); |
| 1911 | layer_data_map.erase(pTable); |
| 1912 | |
| 1913 | pc_instance_table_map.erase(key); |
| 1914 | assert(pc_instance_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1915 | } |
| 1916 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1917 | bool PostEnumeratePhysicalDevices( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1918 | VkInstance instance, |
| 1919 | uint32_t* pPhysicalDeviceCount, |
| 1920 | VkPhysicalDevice* pPhysicalDevices, |
| 1921 | VkResult result) |
| 1922 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1923 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1924 | if(pPhysicalDeviceCount != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1925 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1926 | } |
| 1927 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1928 | if(pPhysicalDevices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1929 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1930 | } |
| 1931 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1932 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1933 | { |
| 1934 | std::string reason = "vkEnumeratePhysicalDevices parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1935 | log_msg(mid(instance), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1936 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1937 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1938 | |
| 1939 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1940 | } |
| 1941 | |
| 1942 | VK_LAYER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices( |
| 1943 | VkInstance instance, |
| 1944 | uint32_t* pPhysicalDeviceCount, |
| 1945 | VkPhysicalDevice* pPhysicalDevices) |
| 1946 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1947 | VkResult result = get_dispatch_table(pc_instance_table_map, instance)->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
| 1948 | |
| 1949 | PostEnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices, result); |
| 1950 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1951 | return result; |
| 1952 | } |
| 1953 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1954 | bool PostGetPhysicalDeviceFeatures( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1955 | VkPhysicalDevice physicalDevice, |
| 1956 | VkPhysicalDeviceFeatures* pFeatures, |
| 1957 | VkResult result) |
| 1958 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1959 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1960 | if(pFeatures != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1961 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1962 | } |
| 1963 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1964 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1965 | { |
| 1966 | std::string reason = "vkGetPhysicalDeviceFeatures parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1967 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 1968 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1969 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1970 | |
| 1971 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1972 | } |
| 1973 | |
| 1974 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFeatures( |
| 1975 | VkPhysicalDevice physicalDevice, |
| 1976 | VkPhysicalDeviceFeatures* pFeatures) |
| 1977 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1978 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
| 1979 | |
| 1980 | PostGetPhysicalDeviceFeatures(physicalDevice, pFeatures, result); |
| 1981 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1982 | return result; |
| 1983 | } |
| 1984 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 1985 | bool PostGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1986 | VkPhysicalDevice physicalDevice, |
| 1987 | VkFormat format, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1988 | VkFormatProperties* pFormatProperties, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1989 | VkResult result) |
| 1990 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1991 | |
| 1992 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 1993 | format > VK_FORMAT_END_RANGE) |
| 1994 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1995 | 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] | 1996 | "vkGetPhysicalDeviceFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1997 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1998 | } |
| 1999 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2000 | if(pFormatProperties != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2001 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2002 | } |
| 2003 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2004 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2005 | { |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 2006 | std::string reason = "vkGetPhysicalDeviceFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2007 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2008 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2009 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2010 | |
| 2011 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2012 | } |
| 2013 | |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 2014 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceFormatProperties( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2015 | VkPhysicalDevice physicalDevice, |
| 2016 | VkFormat format, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2017 | VkFormatProperties* pFormatProperties) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2018 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2019 | 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] | 2020 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2021 | PostGetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties, result); |
| 2022 | |
| 2023 | return result; |
| 2024 | } |
| 2025 | |
| 2026 | bool PostGetPhysicalDeviceImageFormatProperties( |
| 2027 | VkPhysicalDevice physicalDevice, |
| 2028 | VkFormat format, |
| 2029 | VkImageType type, |
| 2030 | VkImageTiling tiling, |
| 2031 | VkImageUsageFlags usage, |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 2032 | VkImageCreateFlags flags, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2033 | VkImageFormatProperties* pImageFormatProperties, |
| 2034 | VkResult result) |
| 2035 | { |
| 2036 | |
| 2037 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2038 | format > VK_FORMAT_END_RANGE) |
| 2039 | { |
| 2040 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2041 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
| 2042 | return false; |
| 2043 | } |
| 2044 | |
| 2045 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 2046 | type > VK_IMAGE_TYPE_END_RANGE) |
| 2047 | { |
| 2048 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2049 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkImageType type, is an unrecognized enumerator"); |
| 2050 | return false; |
| 2051 | } |
| 2052 | |
| 2053 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 2054 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 2055 | { |
| 2056 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2057 | "vkGetPhysicalDeviceImageFormatProperties parameter, VkImageTiling tiling, is an unrecognized enumerator"); |
| 2058 | return false; |
| 2059 | } |
| 2060 | |
| 2061 | |
| 2062 | if(pImageFormatProperties != nullptr) |
| 2063 | { |
| 2064 | } |
| 2065 | |
| 2066 | if(result < VK_SUCCESS) |
| 2067 | { |
| 2068 | std::string reason = "vkGetPhysicalDeviceImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2069 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2070 | return false; |
| 2071 | } |
| 2072 | |
| 2073 | return true; |
| 2074 | } |
| 2075 | |
| 2076 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceImageFormatProperties( |
| 2077 | VkPhysicalDevice physicalDevice, |
| 2078 | VkFormat format, |
| 2079 | VkImageType type, |
| 2080 | VkImageTiling tiling, |
| 2081 | VkImageUsageFlags usage, |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 2082 | VkImageCreateFlags flags, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2083 | VkImageFormatProperties* pImageFormatProperties) |
| 2084 | { |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 2085 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2086 | |
Courtney Goeltzenleuchter | a22097a | 2015-09-10 13:44:12 -0600 | [diff] [blame] | 2087 | PostGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2088 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2089 | return result; |
| 2090 | } |
| 2091 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2092 | bool PostGetPhysicalDeviceProperties( |
| 2093 | VkPhysicalDevice physicalDevice, |
| 2094 | VkPhysicalDeviceProperties* pProperties, |
| 2095 | VkResult result) |
| 2096 | { |
| 2097 | |
| 2098 | if(pProperties != nullptr) |
| 2099 | { |
| 2100 | if(pProperties->deviceType < VK_PHYSICAL_DEVICE_TYPE_BEGIN_RANGE || |
| 2101 | pProperties->deviceType > VK_PHYSICAL_DEVICE_TYPE_END_RANGE) |
| 2102 | { |
| 2103 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 2104 | "vkGetPhysicalDeviceProperties parameter, VkPhysicalDeviceType pProperties->deviceType, is an unrecognized enumerator"); |
| 2105 | return false; |
| 2106 | } |
| 2107 | } |
| 2108 | |
| 2109 | if(result < VK_SUCCESS) |
| 2110 | { |
| 2111 | std::string reason = "vkGetPhysicalDeviceProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2112 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2113 | return false; |
| 2114 | } |
| 2115 | |
| 2116 | return true; |
| 2117 | } |
| 2118 | |
| 2119 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties( |
| 2120 | VkPhysicalDevice physicalDevice, |
| 2121 | VkPhysicalDeviceProperties* pProperties) |
| 2122 | { |
| 2123 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties(physicalDevice, pProperties); |
| 2124 | |
| 2125 | PostGetPhysicalDeviceProperties(physicalDevice, pProperties, result); |
| 2126 | |
| 2127 | return result; |
| 2128 | } |
| 2129 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2130 | bool PostGetPhysicalDeviceQueueFamilyProperties( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2131 | VkPhysicalDevice physicalDevice, |
| 2132 | uint32_t* pCount, |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2133 | VkQueueFamilyProperties* pQueueProperties, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2134 | VkResult result) |
| 2135 | { |
| 2136 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2137 | if(pQueueProperties == nullptr && pCount != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2138 | { |
| 2139 | } |
| 2140 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2141 | if(pQueueProperties != nullptr) |
| 2142 | { |
| 2143 | } |
| 2144 | |
| 2145 | if(result < VK_SUCCESS) |
| 2146 | { |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2147 | std::string reason = "vkGetPhysicalDeviceQueueFamilyProperties parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2148 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2149 | return false; |
| 2150 | } |
| 2151 | |
| 2152 | return true; |
| 2153 | } |
| 2154 | |
| 2155 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceQueueProperties( |
| 2156 | VkPhysicalDevice physicalDevice, |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2157 | uint32_t* pCount, |
| 2158 | VkQueueFamilyProperties* pQueueProperties) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2159 | { |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2160 | 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] | 2161 | |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 2162 | PostGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pCount, pQueueProperties, result); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2163 | |
| 2164 | return result; |
| 2165 | } |
| 2166 | |
| 2167 | bool PostGetPhysicalDeviceMemoryProperties( |
| 2168 | VkPhysicalDevice physicalDevice, |
| 2169 | VkPhysicalDeviceMemoryProperties* pMemoryProperties, |
| 2170 | VkResult result) |
| 2171 | { |
| 2172 | |
| 2173 | if(pMemoryProperties != nullptr) |
| 2174 | { |
| 2175 | } |
| 2176 | |
| 2177 | if(result < VK_SUCCESS) |
| 2178 | { |
| 2179 | std::string reason = "vkGetPhysicalDeviceMemoryProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2180 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2181 | return false; |
| 2182 | } |
| 2183 | |
| 2184 | return true; |
| 2185 | } |
| 2186 | |
| 2187 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( |
| 2188 | VkPhysicalDevice physicalDevice, |
| 2189 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 2190 | { |
| 2191 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); |
| 2192 | |
| 2193 | PostGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties, result); |
| 2194 | |
| 2195 | return result; |
| 2196 | } |
| 2197 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2198 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDevice( |
| 2199 | VkPhysicalDevice physicalDevice, |
| 2200 | const VkDeviceCreateInfo* pCreateInfo, |
| 2201 | VkDevice* pDevice) |
| 2202 | { |
Courtney Goeltzenleuchter | bafcdf3 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 2203 | /* |
| 2204 | * NOTE: The loader fills in the ICD's device object in *pDevice. |
| 2205 | * Use that object to get the dispatch table. |
| 2206 | * |
| 2207 | * NOTE: We do not validate physicalDevice or any dispatchable |
| 2208 | * object as the first parameter. We couldn't get here if it was wrong! |
| 2209 | */ |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 2210 | VkLayerDispatchTable *pTable = get_dispatch_table(pc_device_table_map, *pDevice); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2211 | VkResult result = pTable->CreateDevice(physicalDevice, pCreateInfo, pDevice); |
| 2212 | if(result == VK_SUCCESS) |
| 2213 | { |
| 2214 | layer_data *instance_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
| 2215 | layer_data *device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); |
| 2216 | device_data->report_data = layer_debug_report_create_device(instance_data->report_data, *pDevice); |
| 2217 | } |
| 2218 | |
| 2219 | return result; |
| 2220 | } |
| 2221 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 2222 | VK_LAYER_EXPORT void VKAPI vkDestroyDevice( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2223 | VkDevice device) |
| 2224 | { |
| 2225 | layer_debug_report_destroy_device(device); |
| 2226 | |
| 2227 | dispatch_key key = get_dispatch_key(device); |
| 2228 | #if DISPATCH_MAP_DEBUG |
| 2229 | fprintf(stderr, "Device: %p, key: %p\n", device, key); |
| 2230 | #endif |
| 2231 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 2232 | get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2233 | pc_device_table_map.erase(key); |
| 2234 | assert(pc_device_table_map.size() == 0 && "Should not have any instance mappings hanging around"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2235 | } |
| 2236 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2237 | bool PostGetDeviceQueue( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2238 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2239 | uint32_t queueFamilyIndex, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2240 | uint32_t queueIndex, |
| 2241 | VkQueue* pQueue, |
| 2242 | VkResult result) |
| 2243 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2244 | |
| 2245 | |
| 2246 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2247 | if(pQueue != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2248 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2249 | } |
| 2250 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2251 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2252 | { |
| 2253 | std::string reason = "vkGetDeviceQueue parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2254 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2255 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2256 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2257 | |
| 2258 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2259 | } |
| 2260 | |
| 2261 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceQueue( |
| 2262 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2263 | uint32_t queueFamilyIndex, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2264 | uint32_t queueIndex, |
| 2265 | VkQueue* pQueue) |
| 2266 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2267 | 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] | 2268 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2269 | PostGetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2270 | |
| 2271 | return result; |
| 2272 | } |
| 2273 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2274 | bool PreQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2275 | VkQueue queue, |
| 2276 | const VkCmdBuffer* pCmdBuffers) |
| 2277 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2278 | if(pCmdBuffers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2279 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2280 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2281 | |
| 2282 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2283 | } |
| 2284 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2285 | bool PostQueueSubmit( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2286 | VkQueue queue, |
| 2287 | uint32_t cmdBufferCount, |
| 2288 | VkFence fence, |
| 2289 | VkResult result) |
| 2290 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2291 | |
| 2292 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2293 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2294 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2295 | { |
| 2296 | std::string reason = "vkQueueSubmit parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2297 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2298 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2299 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2300 | |
| 2301 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2302 | } |
| 2303 | |
| 2304 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSubmit( |
| 2305 | VkQueue queue, |
| 2306 | uint32_t cmdBufferCount, |
| 2307 | const VkCmdBuffer* pCmdBuffers, |
| 2308 | VkFence fence) |
| 2309 | { |
| 2310 | PreQueueSubmit(queue, pCmdBuffers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2311 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2312 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, cmdBufferCount, pCmdBuffers, fence); |
| 2313 | |
| 2314 | PostQueueSubmit(queue, cmdBufferCount, fence, result); |
| 2315 | |
| 2316 | return result; |
| 2317 | } |
| 2318 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2319 | bool PostQueueWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2320 | VkQueue queue, |
| 2321 | VkResult result) |
| 2322 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2323 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2324 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2325 | { |
| 2326 | std::string reason = "vkQueueWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2327 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2328 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2329 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2330 | |
| 2331 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2332 | } |
| 2333 | |
| 2334 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitIdle( |
| 2335 | VkQueue queue) |
| 2336 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2337 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue); |
| 2338 | |
| 2339 | PostQueueWaitIdle(queue, result); |
| 2340 | |
| 2341 | return result; |
| 2342 | } |
| 2343 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2344 | bool PostDeviceWaitIdle( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2345 | VkDevice device, |
| 2346 | VkResult result) |
| 2347 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2348 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2349 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2350 | { |
| 2351 | std::string reason = "vkDeviceWaitIdle parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2352 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2353 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2354 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2355 | |
| 2356 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2357 | } |
| 2358 | |
| 2359 | VK_LAYER_EXPORT VkResult VKAPI vkDeviceWaitIdle( |
| 2360 | VkDevice device) |
| 2361 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2362 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device); |
| 2363 | |
| 2364 | PostDeviceWaitIdle(device, result); |
| 2365 | |
| 2366 | return result; |
| 2367 | } |
| 2368 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2369 | bool PreAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2370 | VkDevice device, |
| 2371 | const VkMemoryAllocInfo* pAllocInfo) |
| 2372 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2373 | if(pAllocInfo != nullptr) |
| 2374 | { |
| 2375 | if(pAllocInfo->sType != VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2376 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2377 | 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] | 2378 | "vkAllocMemory parameter, VkStructureType pAllocInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2379 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2380 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2381 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2382 | |
| 2383 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2384 | } |
| 2385 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2386 | bool PostAllocMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2387 | VkDevice device, |
| 2388 | VkDeviceMemory* pMem, |
| 2389 | VkResult result) |
| 2390 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2391 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2392 | if(pMem != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2393 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2394 | } |
| 2395 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2396 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2397 | { |
| 2398 | std::string reason = "vkAllocMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2399 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2400 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2401 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2402 | |
| 2403 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2404 | } |
| 2405 | |
| 2406 | VK_LAYER_EXPORT VkResult VKAPI vkAllocMemory( |
| 2407 | VkDevice device, |
| 2408 | const VkMemoryAllocInfo* pAllocInfo, |
| 2409 | VkDeviceMemory* pMem) |
| 2410 | { |
| 2411 | PreAllocMemory(device, pAllocInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2412 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2413 | VkResult result = get_dispatch_table(pc_device_table_map, device)->AllocMemory(device, pAllocInfo, pMem); |
| 2414 | |
| 2415 | PostAllocMemory(device, pMem, result); |
| 2416 | |
| 2417 | return result; |
| 2418 | } |
| 2419 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2420 | bool PostMapMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2421 | VkDevice device, |
| 2422 | VkDeviceMemory mem, |
| 2423 | VkDeviceSize offset, |
| 2424 | VkDeviceSize size, |
| 2425 | VkMemoryMapFlags flags, |
| 2426 | void** ppData, |
| 2427 | VkResult result) |
| 2428 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2429 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2430 | |
| 2431 | |
| 2432 | |
| 2433 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2434 | if(ppData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2435 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2436 | } |
| 2437 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2438 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2439 | { |
| 2440 | std::string reason = "vkMapMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2441 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2442 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2443 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2444 | |
| 2445 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2446 | } |
| 2447 | |
| 2448 | VK_LAYER_EXPORT VkResult VKAPI vkMapMemory( |
| 2449 | VkDevice device, |
| 2450 | VkDeviceMemory mem, |
| 2451 | VkDeviceSize offset, |
| 2452 | VkDeviceSize size, |
| 2453 | VkMemoryMapFlags flags, |
| 2454 | void** ppData) |
| 2455 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2456 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, mem, offset, size, flags, ppData); |
| 2457 | |
| 2458 | PostMapMemory(device, mem, offset, size, flags, ppData, result); |
| 2459 | |
| 2460 | return result; |
| 2461 | } |
| 2462 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2463 | bool PreFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2464 | VkDevice device, |
| 2465 | const VkMappedMemoryRange* pMemRanges) |
| 2466 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2467 | if(pMemRanges != nullptr) |
| 2468 | { |
| 2469 | if(pMemRanges->sType != VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2470 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2471 | 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] | 2472 | "vkFlushMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2473 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2474 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2475 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2476 | |
| 2477 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2478 | } |
| 2479 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2480 | bool PostFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2481 | VkDevice device, |
| 2482 | uint32_t memRangeCount, |
| 2483 | VkResult result) |
| 2484 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2485 | |
| 2486 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2487 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2488 | { |
| 2489 | std::string reason = "vkFlushMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2490 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2491 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2492 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2493 | |
| 2494 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2495 | } |
| 2496 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2497 | VK_LAYER_EXPORT VkResult VKAPI vkFlushMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2498 | VkDevice device, |
| 2499 | uint32_t memRangeCount, |
| 2500 | const VkMappedMemoryRange* pMemRanges) |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2501 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2502 | PreFlushMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2503 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2504 | 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] | 2505 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2506 | PostFlushMappedMemoryRanges(device, memRangeCount, result); |
| 2507 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2508 | return result; |
| 2509 | } |
| 2510 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2511 | bool PreInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2512 | VkDevice device, |
| 2513 | const VkMappedMemoryRange* pMemRanges) |
| 2514 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2515 | if(pMemRanges != nullptr) |
| 2516 | { |
| 2517 | if(pMemRanges->sType != VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2518 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2519 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2520 | "vkInvalidateMappedMemoryRanges parameter, VkStructureType pMemRanges->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2521 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2522 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2523 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2524 | |
| 2525 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2526 | } |
| 2527 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2528 | bool PostInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2529 | VkDevice device, |
| 2530 | uint32_t memRangeCount, |
| 2531 | VkResult result) |
| 2532 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2533 | |
| 2534 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2535 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2536 | { |
| 2537 | std::string reason = "vkInvalidateMappedMemoryRanges parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2538 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2539 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2540 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2541 | |
| 2542 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2543 | } |
| 2544 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2545 | VK_LAYER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2546 | VkDevice device, |
| 2547 | uint32_t memRangeCount, |
| 2548 | const VkMappedMemoryRange* pMemRanges) |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 2549 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2550 | PreInvalidateMappedMemoryRanges(device, pMemRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2551 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2552 | 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] | 2553 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2554 | PostInvalidateMappedMemoryRanges(device, memRangeCount, result); |
| 2555 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2556 | return result; |
| 2557 | } |
| 2558 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2559 | bool PostGetDeviceMemoryCommitment( |
| 2560 | VkDevice device, |
| 2561 | VkDeviceMemory memory, |
| 2562 | VkDeviceSize* pCommittedMemoryInBytes, |
| 2563 | VkResult result) |
| 2564 | { |
| 2565 | |
| 2566 | |
| 2567 | if(pCommittedMemoryInBytes != nullptr) |
| 2568 | { |
| 2569 | } |
| 2570 | |
| 2571 | if(result < VK_SUCCESS) |
| 2572 | { |
| 2573 | std::string reason = "vkGetDeviceMemoryCommitment parameter, VkResult result, is " + EnumeratorString(result); |
| 2574 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2575 | return false; |
| 2576 | } |
| 2577 | |
| 2578 | return true; |
| 2579 | } |
| 2580 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2581 | VK_LAYER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2582 | VkDevice device, |
| 2583 | VkDeviceMemory memory, |
| 2584 | VkDeviceSize* pCommittedMemoryInBytes) |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2585 | { |
| 2586 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
| 2587 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2588 | PostGetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes, result); |
| 2589 | |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2590 | return result; |
| 2591 | } |
| 2592 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2593 | bool PostBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2594 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2595 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2596 | VkDeviceMemory mem, |
| 2597 | VkDeviceSize memOffset, |
| 2598 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2599 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2600 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -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 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2606 | std::string reason = "vkBindBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 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 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2614 | VK_LAYER_EXPORT VkResult VKAPI vkBindBufferMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2615 | VkDevice device, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2616 | VkBuffer buffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2617 | VkDeviceMemory mem, |
| 2618 | VkDeviceSize memOffset) |
| 2619 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2620 | 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] | 2621 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2622 | PostBindBufferMemory(device, buffer, mem, memOffset, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2623 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2624 | return result; |
| 2625 | } |
| 2626 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2627 | bool PostBindImageMemory( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2628 | VkDevice device, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2629 | VkImage image, |
| 2630 | VkDeviceMemory mem, |
| 2631 | VkDeviceSize memOffset, |
| 2632 | VkResult result) |
| 2633 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2634 | |
| 2635 | |
| 2636 | |
| 2637 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2638 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2639 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2640 | std::string reason = "vkBindImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2641 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2642 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2643 | } |
| 2644 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2645 | return true; |
| 2646 | } |
| 2647 | |
| 2648 | VK_LAYER_EXPORT VkResult VKAPI vkBindImageMemory( |
| 2649 | VkDevice device, |
| 2650 | VkImage image, |
| 2651 | VkDeviceMemory mem, |
| 2652 | VkDeviceSize memOffset) |
| 2653 | { |
| 2654 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, mem, memOffset); |
| 2655 | |
| 2656 | PostBindImageMemory(device, image, mem, memOffset, result); |
| 2657 | |
| 2658 | return result; |
| 2659 | } |
| 2660 | |
| 2661 | bool PostGetBufferMemoryRequirements( |
| 2662 | VkDevice device, |
| 2663 | VkBuffer buffer, |
| 2664 | VkMemoryRequirements* pMemoryRequirements, |
| 2665 | VkResult result) |
| 2666 | { |
| 2667 | |
| 2668 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2669 | if(pMemoryRequirements != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2670 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2671 | } |
| 2672 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2673 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2674 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2675 | std::string reason = "vkGetBufferMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2676 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2677 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2678 | } |
| 2679 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2680 | return true; |
| 2681 | } |
| 2682 | |
| 2683 | VK_LAYER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements( |
| 2684 | VkDevice device, |
| 2685 | VkBuffer buffer, |
| 2686 | VkMemoryRequirements* pMemoryRequirements) |
| 2687 | { |
| 2688 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
| 2689 | |
| 2690 | PostGetBufferMemoryRequirements(device, buffer, pMemoryRequirements, result); |
| 2691 | |
| 2692 | return result; |
| 2693 | } |
| 2694 | |
| 2695 | bool PostGetImageMemoryRequirements( |
| 2696 | VkDevice device, |
| 2697 | VkImage image, |
| 2698 | VkMemoryRequirements* pMemoryRequirements, |
| 2699 | VkResult result) |
| 2700 | { |
| 2701 | |
| 2702 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2703 | if(pMemoryRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2704 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2705 | } |
| 2706 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2707 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2708 | { |
| 2709 | std::string reason = "vkGetImageMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2710 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2711 | return false; |
| 2712 | } |
| 2713 | |
| 2714 | return true; |
| 2715 | } |
| 2716 | |
| 2717 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageMemoryRequirements( |
| 2718 | VkDevice device, |
| 2719 | VkImage image, |
| 2720 | VkMemoryRequirements* pMemoryRequirements) |
| 2721 | { |
| 2722 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
| 2723 | |
| 2724 | PostGetImageMemoryRequirements(device, image, pMemoryRequirements, result); |
| 2725 | |
| 2726 | return result; |
| 2727 | } |
| 2728 | |
| 2729 | bool PostGetImageSparseMemoryRequirements( |
| 2730 | VkDevice device, |
| 2731 | VkImage image, |
| 2732 | uint32_t* pNumRequirements, |
| 2733 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements, |
| 2734 | VkResult result) |
| 2735 | { |
| 2736 | |
| 2737 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2738 | if(pNumRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2739 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2740 | } |
| 2741 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2742 | if(pSparseMemoryRequirements != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2743 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2744 | if(pSparseMemoryRequirements->formatProps.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2745 | pSparseMemoryRequirements->formatProps.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2746 | { |
| 2747 | 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] | 2748 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect pSparseMemoryRequirements->formatProps.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2749 | return false; |
| 2750 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2751 | } |
| 2752 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2753 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2754 | { |
| 2755 | std::string reason = "vkGetImageSparseMemoryRequirements parameter, VkResult result, is " + EnumeratorString(result); |
| 2756 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2757 | return false; |
| 2758 | } |
| 2759 | |
| 2760 | return true; |
| 2761 | } |
| 2762 | |
| 2763 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSparseMemoryRequirements( |
| 2764 | VkDevice device, |
| 2765 | VkImage image, |
| 2766 | uint32_t* pNumRequirements, |
| 2767 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2768 | { |
| 2769 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements); |
| 2770 | |
| 2771 | PostGetImageSparseMemoryRequirements(device, image, pNumRequirements, pSparseMemoryRequirements, result); |
| 2772 | |
| 2773 | return result; |
| 2774 | } |
| 2775 | |
| 2776 | bool PostGetPhysicalDeviceSparseImageFormatProperties( |
| 2777 | VkPhysicalDevice physicalDevice, |
| 2778 | VkFormat format, |
| 2779 | VkImageType type, |
| 2780 | uint32_t samples, |
| 2781 | VkImageUsageFlags usage, |
| 2782 | VkImageTiling tiling, |
| 2783 | uint32_t* pNumProperties, |
| 2784 | VkSparseImageFormatProperties* pProperties, |
| 2785 | VkResult result) |
| 2786 | { |
| 2787 | |
| 2788 | if(format < VK_FORMAT_BEGIN_RANGE || |
| 2789 | format > VK_FORMAT_END_RANGE) |
| 2790 | { |
| 2791 | 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] | 2792 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkFormat format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2793 | return false; |
| 2794 | } |
| 2795 | |
| 2796 | if(type < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 2797 | type > VK_IMAGE_TYPE_END_RANGE) |
| 2798 | { |
| 2799 | 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] | 2800 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageType type, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2801 | return false; |
| 2802 | } |
| 2803 | |
| 2804 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2805 | |
| 2806 | if(tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 2807 | tiling > VK_IMAGE_TILING_END_RANGE) |
| 2808 | { |
| 2809 | 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] | 2810 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageTiling tiling, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2811 | return false; |
| 2812 | } |
| 2813 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2814 | if(pNumProperties != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2815 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2816 | } |
| 2817 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2818 | if(pProperties != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2819 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2820 | if(pProperties->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2821 | pProperties->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2822 | { |
| 2823 | 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] | 2824 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2825 | return false; |
| 2826 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2827 | } |
| 2828 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2829 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2830 | { |
| 2831 | std::string reason = "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkResult result, is " + EnumeratorString(result); |
| 2832 | log_msg(mdd(physicalDevice), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2833 | return false; |
| 2834 | } |
| 2835 | |
| 2836 | return true; |
| 2837 | } |
| 2838 | |
| 2839 | VK_LAYER_EXPORT VkResult VKAPI vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2840 | VkPhysicalDevice physicalDevice, |
| 2841 | VkFormat format, |
| 2842 | VkImageType type, |
| 2843 | uint32_t samples, |
| 2844 | VkImageUsageFlags usage, |
| 2845 | VkImageTiling tiling, |
| 2846 | uint32_t* pNumProperties, |
| 2847 | VkSparseImageFormatProperties* pProperties) |
| 2848 | { |
| 2849 | VkResult result = get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties); |
| 2850 | |
| 2851 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pNumProperties, pProperties, result); |
| 2852 | |
| 2853 | return result; |
| 2854 | } |
| 2855 | |
| 2856 | bool PreQueueBindSparseBufferMemory( |
| 2857 | VkQueue queue, |
| 2858 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2859 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2860 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2861 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2862 | } |
| 2863 | |
| 2864 | return true; |
| 2865 | } |
| 2866 | |
| 2867 | bool PostQueueBindSparseBufferMemory( |
| 2868 | VkQueue queue, |
| 2869 | VkBuffer buffer, |
| 2870 | uint32_t numBindings, |
| 2871 | VkResult result) |
| 2872 | { |
| 2873 | |
| 2874 | |
| 2875 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2876 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2877 | { |
| 2878 | std::string reason = "vkQueueBindSparseBufferMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2879 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2880 | return false; |
| 2881 | } |
| 2882 | |
| 2883 | return true; |
| 2884 | } |
| 2885 | |
| 2886 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseBufferMemory( |
| 2887 | VkQueue queue, |
| 2888 | VkBuffer buffer, |
| 2889 | uint32_t numBindings, |
| 2890 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2891 | { |
| 2892 | PreQueueBindSparseBufferMemory(queue, pBindInfo); |
| 2893 | |
| 2894 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseBufferMemory(queue, buffer, numBindings, pBindInfo); |
| 2895 | |
| 2896 | PostQueueBindSparseBufferMemory(queue, buffer, numBindings, result); |
| 2897 | |
| 2898 | return result; |
| 2899 | } |
| 2900 | |
| 2901 | bool PreQueueBindSparseImageOpaqueMemory( |
| 2902 | VkQueue queue, |
| 2903 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2904 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2905 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2906 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2907 | } |
| 2908 | |
| 2909 | return true; |
| 2910 | } |
| 2911 | |
| 2912 | bool PostQueueBindSparseImageOpaqueMemory( |
| 2913 | VkQueue queue, |
| 2914 | VkImage image, |
| 2915 | uint32_t numBindings, |
| 2916 | VkResult result) |
| 2917 | { |
| 2918 | |
| 2919 | |
| 2920 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2921 | if(result < VK_SUCCESS) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2922 | { |
| 2923 | std::string reason = "vkQueueBindSparseImageOpaqueMemory parameter, VkResult result, is " + EnumeratorString(result); |
| 2924 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2925 | return false; |
| 2926 | } |
| 2927 | |
| 2928 | return true; |
| 2929 | } |
| 2930 | |
| 2931 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageOpaqueMemory( |
| 2932 | VkQueue queue, |
| 2933 | VkImage image, |
| 2934 | uint32_t numBindings, |
| 2935 | const VkSparseMemoryBindInfo* pBindInfo) |
| 2936 | { |
| 2937 | PreQueueBindSparseImageOpaqueMemory(queue, pBindInfo); |
| 2938 | |
| 2939 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparseImageOpaqueMemory(queue, image, numBindings, pBindInfo); |
| 2940 | |
| 2941 | PostQueueBindSparseImageOpaqueMemory(queue, image, numBindings, result); |
| 2942 | |
| 2943 | return result; |
| 2944 | } |
| 2945 | |
| 2946 | bool PreQueueBindSparseImageMemory( |
| 2947 | VkQueue queue, |
| 2948 | const VkSparseImageMemoryBindInfo* pBindInfo) |
| 2949 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2950 | if(pBindInfo != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2951 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2952 | if(pBindInfo->subresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 2953 | pBindInfo->subresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 2954 | { |
| 2955 | 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] | 2956 | "vkQueueBindSparseImageMemory parameter, VkImageAspect pBindInfo->subresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2957 | return false; |
| 2958 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2959 | } |
| 2960 | |
| 2961 | return true; |
| 2962 | } |
| 2963 | |
| 2964 | bool PostQueueBindSparseImageMemory( |
| 2965 | VkQueue queue, |
| 2966 | VkImage image, |
| 2967 | uint32_t numBindings, |
| 2968 | VkResult result) |
| 2969 | { |
| 2970 | |
| 2971 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2972 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2973 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2974 | { |
| 2975 | std::string reason = "vkQueueBindSparseImageMemory parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2976 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 2977 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2978 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2979 | |
| 2980 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2981 | } |
| 2982 | |
| 2983 | VK_LAYER_EXPORT VkResult VKAPI vkQueueBindSparseImageMemory( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2984 | VkQueue queue, |
| 2985 | VkImage image, |
| 2986 | uint32_t numBindings, |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 2987 | const VkSparseImageMemoryBindInfo* pBindInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2988 | { |
| 2989 | PreQueueBindSparseImageMemory(queue, pBindInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2990 | |
Mark Lobodzinski | 16e8bef | 2015-07-03 15:58:09 -0600 | [diff] [blame] | 2991 | 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] | 2992 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2993 | PostQueueBindSparseImageMemory(queue, image, numBindings, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2994 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2995 | return result; |
| 2996 | } |
| 2997 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2998 | bool PreCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2999 | VkDevice device, |
| 3000 | const VkFenceCreateInfo* pCreateInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3001 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3002 | if(pCreateInfo != nullptr) |
| 3003 | { |
| 3004 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_FENCE_CREATE_INFO) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3005 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3006 | 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] | 3007 | "vkCreateFence parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3008 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3009 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3010 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3011 | |
| 3012 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3013 | } |
| 3014 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3015 | bool PostCreateFence( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3016 | VkDevice device, |
| 3017 | VkFence* pFence, |
| 3018 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3019 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3020 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3021 | if(pFence != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3022 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3023 | } |
| 3024 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3025 | if(result < VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3026 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3027 | std::string reason = "vkCreateFence parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3028 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3029 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3030 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3031 | |
| 3032 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3033 | } |
| 3034 | |
| 3035 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFence( |
| 3036 | VkDevice device, |
| 3037 | const VkFenceCreateInfo* pCreateInfo, |
| 3038 | VkFence* pFence) |
| 3039 | { |
| 3040 | PreCreateFence(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3041 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3042 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pFence); |
| 3043 | |
| 3044 | PostCreateFence(device, pFence, result); |
| 3045 | |
| 3046 | return result; |
| 3047 | } |
| 3048 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3049 | bool PreResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3050 | VkDevice device, |
| 3051 | const VkFence* pFences) |
| 3052 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3053 | if(pFences != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3054 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3055 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3056 | |
| 3057 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3058 | } |
| 3059 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3060 | bool PostResetFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3061 | VkDevice device, |
| 3062 | uint32_t fenceCount, |
| 3063 | VkResult result) |
| 3064 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3065 | |
| 3066 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3067 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3068 | { |
| 3069 | std::string reason = "vkResetFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3070 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3071 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3072 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3073 | |
| 3074 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3075 | } |
| 3076 | |
| 3077 | VK_LAYER_EXPORT VkResult VKAPI vkResetFences( |
| 3078 | VkDevice device, |
| 3079 | uint32_t fenceCount, |
| 3080 | const VkFence* pFences) |
| 3081 | { |
| 3082 | PreResetFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3083 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3084 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences); |
| 3085 | |
| 3086 | PostResetFences(device, fenceCount, result); |
| 3087 | |
| 3088 | return result; |
| 3089 | } |
| 3090 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3091 | bool PostGetFenceStatus( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3092 | VkDevice device, |
| 3093 | VkFence fence, |
| 3094 | VkResult result) |
| 3095 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3096 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3097 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3098 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3099 | { |
| 3100 | std::string reason = "vkGetFenceStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3101 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3102 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3103 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3104 | |
| 3105 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3106 | } |
| 3107 | |
| 3108 | VK_LAYER_EXPORT VkResult VKAPI vkGetFenceStatus( |
| 3109 | VkDevice device, |
| 3110 | VkFence fence) |
| 3111 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3112 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence); |
| 3113 | |
| 3114 | PostGetFenceStatus(device, fence, result); |
| 3115 | |
| 3116 | return result; |
| 3117 | } |
| 3118 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3119 | bool PreWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3120 | VkDevice device, |
| 3121 | const VkFence* pFences) |
| 3122 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3123 | if(pFences != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3124 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3125 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3126 | |
| 3127 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3128 | } |
| 3129 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3130 | bool PostWaitForFences( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3131 | VkDevice device, |
| 3132 | uint32_t fenceCount, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3133 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3134 | uint64_t timeout, |
| 3135 | VkResult result) |
| 3136 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3137 | |
| 3138 | |
| 3139 | |
| 3140 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3141 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3142 | { |
| 3143 | std::string reason = "vkWaitForFences parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3144 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3145 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3146 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3147 | |
| 3148 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3149 | } |
| 3150 | |
| 3151 | VK_LAYER_EXPORT VkResult VKAPI vkWaitForFences( |
| 3152 | VkDevice device, |
| 3153 | uint32_t fenceCount, |
| 3154 | const VkFence* pFences, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 3155 | VkBool32 waitAll, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3156 | uint64_t timeout) |
| 3157 | { |
| 3158 | PreWaitForFences(device, pFences); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3159 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3160 | VkResult result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 3161 | |
| 3162 | PostWaitForFences(device, fenceCount, waitAll, timeout, result); |
| 3163 | |
| 3164 | return result; |
| 3165 | } |
| 3166 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3167 | bool PreCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3168 | VkDevice device, |
| 3169 | const VkSemaphoreCreateInfo* pCreateInfo) |
| 3170 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3171 | if(pCreateInfo != nullptr) |
| 3172 | { |
| 3173 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3174 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3175 | 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] | 3176 | "vkCreateSemaphore parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3177 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3178 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3179 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3180 | |
| 3181 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3182 | } |
| 3183 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3184 | bool PostCreateSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3185 | VkDevice device, |
| 3186 | VkSemaphore* pSemaphore, |
| 3187 | VkResult result) |
| 3188 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3189 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3190 | if(pSemaphore != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3191 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3192 | } |
| 3193 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3194 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3195 | { |
| 3196 | std::string reason = "vkCreateSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3197 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3198 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3199 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3200 | |
| 3201 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3202 | } |
| 3203 | |
| 3204 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSemaphore( |
| 3205 | VkDevice device, |
| 3206 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 3207 | VkSemaphore* pSemaphore) |
| 3208 | { |
| 3209 | PreCreateSemaphore(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3210 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3211 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pSemaphore); |
| 3212 | |
| 3213 | PostCreateSemaphore(device, pSemaphore, result); |
| 3214 | |
| 3215 | return result; |
| 3216 | } |
| 3217 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3218 | bool PostQueueSignalSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3219 | VkQueue queue, |
| 3220 | VkSemaphore semaphore, |
| 3221 | VkResult result) |
| 3222 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3223 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3224 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3225 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3226 | { |
| 3227 | std::string reason = "vkQueueSignalSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3228 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3229 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3230 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3231 | |
| 3232 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3233 | } |
| 3234 | |
| 3235 | VK_LAYER_EXPORT VkResult VKAPI vkQueueSignalSemaphore( |
| 3236 | VkQueue queue, |
| 3237 | VkSemaphore semaphore) |
| 3238 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3239 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueSignalSemaphore(queue, semaphore); |
| 3240 | |
| 3241 | PostQueueSignalSemaphore(queue, semaphore, result); |
| 3242 | |
| 3243 | return result; |
| 3244 | } |
| 3245 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3246 | bool PostQueueWaitSemaphore( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3247 | VkQueue queue, |
| 3248 | VkSemaphore semaphore, |
| 3249 | VkResult result) |
| 3250 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3251 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3252 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3253 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3254 | { |
| 3255 | std::string reason = "vkQueueWaitSemaphore parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3256 | log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3257 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3258 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3259 | |
| 3260 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3261 | } |
| 3262 | |
| 3263 | VK_LAYER_EXPORT VkResult VKAPI vkQueueWaitSemaphore( |
| 3264 | VkQueue queue, |
| 3265 | VkSemaphore semaphore) |
| 3266 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3267 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitSemaphore(queue, semaphore); |
| 3268 | |
| 3269 | PostQueueWaitSemaphore(queue, semaphore, result); |
| 3270 | |
| 3271 | return result; |
| 3272 | } |
| 3273 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3274 | bool PreCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3275 | VkDevice device, |
| 3276 | const VkEventCreateInfo* pCreateInfo) |
| 3277 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3278 | if(pCreateInfo != nullptr) |
| 3279 | { |
| 3280 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_EVENT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3281 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3282 | 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] | 3283 | "vkCreateEvent parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3284 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3285 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3286 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3287 | |
| 3288 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3289 | } |
| 3290 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3291 | bool PostCreateEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3292 | VkDevice device, |
| 3293 | VkEvent* pEvent, |
| 3294 | VkResult result) |
| 3295 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3296 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3297 | if(pEvent != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3298 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3299 | } |
| 3300 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3301 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3302 | { |
| 3303 | std::string reason = "vkCreateEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3304 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3305 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3306 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3307 | |
| 3308 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3309 | } |
| 3310 | |
| 3311 | VK_LAYER_EXPORT VkResult VKAPI vkCreateEvent( |
| 3312 | VkDevice device, |
| 3313 | const VkEventCreateInfo* pCreateInfo, |
| 3314 | VkEvent* pEvent) |
| 3315 | { |
| 3316 | PreCreateEvent(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3317 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3318 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pEvent); |
| 3319 | |
| 3320 | PostCreateEvent(device, pEvent, result); |
| 3321 | |
| 3322 | return result; |
| 3323 | } |
| 3324 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3325 | bool PostGetEventStatus( |
| 3326 | VkDevice device, |
| 3327 | VkEvent event, |
| 3328 | VkResult result) |
| 3329 | { |
| 3330 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3331 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3332 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3333 | { |
| 3334 | std::string reason = "vkGetEventStatus parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3335 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3336 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3337 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3338 | |
| 3339 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3340 | } |
| 3341 | |
| 3342 | VK_LAYER_EXPORT VkResult VKAPI vkGetEventStatus( |
| 3343 | VkDevice device, |
| 3344 | VkEvent event) |
| 3345 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3346 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event); |
| 3347 | |
| 3348 | PostGetEventStatus(device, event, result); |
| 3349 | |
| 3350 | return result; |
| 3351 | } |
| 3352 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3353 | bool PostSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3354 | VkDevice device, |
| 3355 | VkEvent event, |
| 3356 | VkResult result) |
| 3357 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3358 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3359 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3360 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3361 | { |
| 3362 | std::string reason = "vkSetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3363 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3364 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3365 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3366 | |
| 3367 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3368 | } |
| 3369 | |
| 3370 | VK_LAYER_EXPORT VkResult VKAPI vkSetEvent( |
| 3371 | VkDevice device, |
| 3372 | VkEvent event) |
| 3373 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3374 | VkResult result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event); |
| 3375 | |
| 3376 | PostSetEvent(device, event, result); |
| 3377 | |
| 3378 | return result; |
| 3379 | } |
| 3380 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3381 | bool PostResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3382 | VkDevice device, |
| 3383 | VkEvent event, |
| 3384 | VkResult result) |
| 3385 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3386 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3387 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3388 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3389 | { |
| 3390 | std::string reason = "vkResetEvent parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3391 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3392 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3393 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3394 | |
| 3395 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3396 | } |
| 3397 | |
| 3398 | VK_LAYER_EXPORT VkResult VKAPI vkResetEvent( |
| 3399 | VkDevice device, |
| 3400 | VkEvent event) |
| 3401 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3402 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event); |
| 3403 | |
| 3404 | PostResetEvent(device, event, result); |
| 3405 | |
| 3406 | return result; |
| 3407 | } |
| 3408 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3409 | bool PreCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3410 | VkDevice device, |
| 3411 | const VkQueryPoolCreateInfo* pCreateInfo) |
| 3412 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3413 | if(pCreateInfo != nullptr) |
| 3414 | { |
| 3415 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3416 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3417 | 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] | 3418 | "vkCreateQueryPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3419 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3420 | } |
| 3421 | if(pCreateInfo->queryType < VK_QUERY_TYPE_BEGIN_RANGE || |
| 3422 | pCreateInfo->queryType > VK_QUERY_TYPE_END_RANGE) |
| 3423 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3424 | 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] | 3425 | "vkCreateQueryPool parameter, VkQueryType pCreateInfo->queryType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3426 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3427 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3428 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3429 | |
| 3430 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3431 | } |
| 3432 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3433 | bool PostCreateQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3434 | VkDevice device, |
| 3435 | VkQueryPool* pQueryPool, |
| 3436 | VkResult result) |
| 3437 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3438 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3439 | if(pQueryPool != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3440 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3441 | } |
| 3442 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3443 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3444 | { |
| 3445 | std::string reason = "vkCreateQueryPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3446 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3447 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3448 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3449 | |
| 3450 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3451 | } |
| 3452 | |
| 3453 | VK_LAYER_EXPORT VkResult VKAPI vkCreateQueryPool( |
| 3454 | VkDevice device, |
| 3455 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3456 | VkQueryPool* pQueryPool) |
| 3457 | { |
| 3458 | PreCreateQueryPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3459 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3460 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pQueryPool); |
| 3461 | |
| 3462 | PostCreateQueryPool(device, pQueryPool, result); |
| 3463 | |
| 3464 | return result; |
| 3465 | } |
| 3466 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3467 | bool PostGetQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3468 | VkDevice device, |
| 3469 | VkQueryPool queryPool, |
| 3470 | uint32_t startQuery, |
| 3471 | uint32_t queryCount, |
| 3472 | size_t* pDataSize, |
| 3473 | void* pData, |
| 3474 | VkQueryResultFlags flags, |
| 3475 | VkResult result) |
| 3476 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3477 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3478 | |
| 3479 | |
| 3480 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3481 | if(pDataSize != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3482 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3483 | } |
| 3484 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3485 | if(pData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3486 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3487 | } |
| 3488 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3489 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3490 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3491 | { |
| 3492 | std::string reason = "vkGetQueryPoolResults parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3493 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3494 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3495 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3496 | |
| 3497 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3498 | } |
| 3499 | |
| 3500 | VK_LAYER_EXPORT VkResult VKAPI vkGetQueryPoolResults( |
| 3501 | VkDevice device, |
| 3502 | VkQueryPool queryPool, |
| 3503 | uint32_t startQuery, |
| 3504 | uint32_t queryCount, |
| 3505 | size_t* pDataSize, |
| 3506 | void* pData, |
| 3507 | VkQueryResultFlags flags) |
| 3508 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3509 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags); |
| 3510 | |
| 3511 | PostGetQueryPoolResults(device, queryPool, startQuery, queryCount, pDataSize, pData, flags, result); |
| 3512 | |
| 3513 | return result; |
| 3514 | } |
| 3515 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3516 | bool PreCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3517 | VkDevice device, |
| 3518 | const VkBufferCreateInfo* pCreateInfo) |
| 3519 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3520 | if(pCreateInfo != nullptr) |
| 3521 | { |
| 3522 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3523 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3524 | 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] | 3525 | "vkCreateBuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3526 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3527 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3528 | if(pCreateInfo->sharingMode < VK_SHARING_MODE_BEGIN_RANGE || |
| 3529 | pCreateInfo->sharingMode > VK_SHARING_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3530 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3531 | 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] | 3532 | "vkCreateBuffer parameter, VkSharingMode pCreateInfo->sharingMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3533 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3534 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3535 | if(pCreateInfo->pQueueFamilyIndices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3536 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3537 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3538 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3539 | |
| 3540 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3541 | } |
| 3542 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3543 | bool PostCreateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3544 | VkDevice device, |
| 3545 | VkBuffer* pBuffer, |
| 3546 | VkResult result) |
| 3547 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3548 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3549 | if(pBuffer != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3550 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3551 | } |
| 3552 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3553 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3554 | { |
| 3555 | std::string reason = "vkCreateBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3556 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3557 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3558 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3559 | |
| 3560 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3561 | } |
| 3562 | |
| 3563 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBuffer( |
| 3564 | VkDevice device, |
| 3565 | const VkBufferCreateInfo* pCreateInfo, |
| 3566 | VkBuffer* pBuffer) |
| 3567 | { |
| 3568 | PreCreateBuffer(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3569 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3570 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pBuffer); |
| 3571 | |
| 3572 | PostCreateBuffer(device, pBuffer, result); |
| 3573 | |
| 3574 | return result; |
| 3575 | } |
| 3576 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3577 | bool PreCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3578 | VkDevice device, |
| 3579 | const VkBufferViewCreateInfo* pCreateInfo) |
| 3580 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3581 | if(pCreateInfo != nullptr) |
| 3582 | { |
| 3583 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3584 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3585 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3586 | "vkCreateBufferView parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3587 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3588 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3589 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3590 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3591 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3592 | 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] | 3593 | "vkCreateBufferView parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3594 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3595 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3596 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3597 | |
| 3598 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3599 | } |
| 3600 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3601 | bool PostCreateBufferView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3602 | VkDevice device, |
| 3603 | VkBufferView* pView, |
| 3604 | VkResult result) |
| 3605 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3606 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3607 | if(pView != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3608 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3609 | } |
| 3610 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3611 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3612 | { |
| 3613 | std::string reason = "vkCreateBufferView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3614 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3615 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3616 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3617 | |
| 3618 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3619 | } |
| 3620 | |
| 3621 | VK_LAYER_EXPORT VkResult VKAPI vkCreateBufferView( |
| 3622 | VkDevice device, |
| 3623 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3624 | VkBufferView* pView) |
| 3625 | { |
| 3626 | PreCreateBufferView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3627 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3628 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pView); |
| 3629 | |
| 3630 | PostCreateBufferView(device, pView, result); |
| 3631 | |
| 3632 | return result; |
| 3633 | } |
| 3634 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3635 | bool PreCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3636 | VkDevice device, |
| 3637 | const VkImageCreateInfo* pCreateInfo) |
| 3638 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3639 | if(pCreateInfo != nullptr) |
| 3640 | { |
| 3641 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3642 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3643 | 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] | 3644 | "vkCreateImage parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3645 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3646 | } |
| 3647 | if(pCreateInfo->imageType < VK_IMAGE_TYPE_BEGIN_RANGE || |
| 3648 | pCreateInfo->imageType > VK_IMAGE_TYPE_END_RANGE) |
| 3649 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3650 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3651 | "vkCreateImage parameter, VkImageType pCreateInfo->imageType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3652 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3653 | } |
| 3654 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3655 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3656 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3657 | 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] | 3658 | "vkCreateImage parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3659 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3660 | } |
| 3661 | if(pCreateInfo->tiling < VK_IMAGE_TILING_BEGIN_RANGE || |
| 3662 | pCreateInfo->tiling > VK_IMAGE_TILING_END_RANGE) |
| 3663 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3664 | 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] | 3665 | "vkCreateImage parameter, VkImageTiling pCreateInfo->tiling, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3666 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3667 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3668 | if(pCreateInfo->sharingMode < VK_SHARING_MODE_BEGIN_RANGE || |
| 3669 | pCreateInfo->sharingMode > VK_SHARING_MODE_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3670 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3671 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 3672 | "vkCreateImage parameter, VkSharingMode pCreateInfo->sharingMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3673 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3674 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3675 | if(pCreateInfo->pQueueFamilyIndices != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3676 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3677 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3678 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3679 | |
| 3680 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3681 | } |
| 3682 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3683 | bool PostCreateImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3684 | VkDevice device, |
| 3685 | VkImage* pImage, |
| 3686 | VkResult result) |
| 3687 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3688 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3689 | if(pImage != nullptr) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3690 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3691 | } |
| 3692 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3693 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3694 | { |
| 3695 | std::string reason = "vkCreateImage parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3696 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3697 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3698 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3699 | |
| 3700 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3701 | } |
| 3702 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3703 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImage( |
| 3704 | VkDevice device, |
| 3705 | const VkImageCreateInfo* pCreateInfo, |
| 3706 | VkImage* pImage) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3707 | { |
| 3708 | PreCreateImage(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3709 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3710 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pImage); |
| 3711 | |
| 3712 | PostCreateImage(device, pImage, result); |
| 3713 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3714 | return result; |
| 3715 | } |
| 3716 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3717 | bool PreGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3718 | VkDevice device, |
| 3719 | const VkImageSubresource* pSubresource) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3720 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3721 | if(pSubresource != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3722 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3723 | if(pSubresource->aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 3724 | pSubresource->aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 3725 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3726 | 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] | 3727 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3728 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3729 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3730 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3731 | |
| 3732 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3733 | } |
| 3734 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3735 | bool PostGetImageSubresourceLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3736 | VkDevice device, |
| 3737 | VkImage image, |
| 3738 | VkSubresourceLayout* pLayout, |
| 3739 | VkResult result) |
| 3740 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3741 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3742 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3743 | if(pLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3744 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3745 | } |
| 3746 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3747 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3748 | { |
| 3749 | std::string reason = "vkGetImageSubresourceLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3750 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3751 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3752 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3753 | |
| 3754 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3755 | } |
| 3756 | |
| 3757 | VK_LAYER_EXPORT VkResult VKAPI vkGetImageSubresourceLayout( |
| 3758 | VkDevice device, |
| 3759 | VkImage image, |
| 3760 | const VkImageSubresource* pSubresource, |
| 3761 | VkSubresourceLayout* pLayout) |
| 3762 | { |
| 3763 | PreGetImageSubresourceLayout(device, pSubresource); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3764 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3765 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
| 3766 | |
| 3767 | PostGetImageSubresourceLayout(device, image, pLayout, result); |
| 3768 | |
| 3769 | return result; |
| 3770 | } |
| 3771 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3772 | bool PreCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3773 | VkDevice device, |
| 3774 | const VkImageViewCreateInfo* pCreateInfo) |
| 3775 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3776 | if(pCreateInfo != nullptr) |
| 3777 | { |
| 3778 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3779 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3780 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3781 | "vkCreateImageView parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3782 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3783 | } |
| 3784 | if(pCreateInfo->viewType < VK_IMAGE_VIEW_TYPE_BEGIN_RANGE || |
| 3785 | pCreateInfo->viewType > VK_IMAGE_VIEW_TYPE_END_RANGE) |
| 3786 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3787 | 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] | 3788 | "vkCreateImageView parameter, VkImageViewType pCreateInfo->viewType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3789 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3790 | } |
| 3791 | if(pCreateInfo->format < VK_FORMAT_BEGIN_RANGE || |
| 3792 | pCreateInfo->format > VK_FORMAT_END_RANGE) |
| 3793 | { |
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", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3795 | "vkCreateImageView parameter, VkFormat pCreateInfo->format, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3796 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3797 | } |
| 3798 | if(pCreateInfo->channels.r < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 3799 | pCreateInfo->channels.r > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 3800 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3801 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3802 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.r, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3803 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3804 | } |
| 3805 | if(pCreateInfo->channels.g < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 3806 | pCreateInfo->channels.g > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 3807 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3808 | 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] | 3809 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.g, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3810 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3811 | } |
| 3812 | if(pCreateInfo->channels.b < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 3813 | pCreateInfo->channels.b > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 3814 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3815 | 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] | 3816 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.b, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3817 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3818 | } |
| 3819 | if(pCreateInfo->channels.a < VK_CHANNEL_SWIZZLE_BEGIN_RANGE || |
| 3820 | pCreateInfo->channels.a > VK_CHANNEL_SWIZZLE_END_RANGE) |
| 3821 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3822 | 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] | 3823 | "vkCreateImageView parameter, VkChannelSwizzle pCreateInfo->channels.a, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3824 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3825 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3826 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3827 | |
| 3828 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3829 | } |
| 3830 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3831 | bool PostCreateImageView( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3832 | VkDevice device, |
| 3833 | VkImageView* pView, |
| 3834 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3835 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3836 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3837 | if(pView != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3838 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3839 | } |
| 3840 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3841 | if(result < VK_SUCCESS) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3842 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3843 | std::string reason = "vkCreateImageView parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3844 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3845 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3846 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3847 | |
| 3848 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3849 | } |
| 3850 | |
| 3851 | VK_LAYER_EXPORT VkResult VKAPI vkCreateImageView( |
| 3852 | VkDevice device, |
| 3853 | const VkImageViewCreateInfo* pCreateInfo, |
| 3854 | VkImageView* pView) |
| 3855 | { |
| 3856 | PreCreateImageView(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3857 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3858 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pView); |
| 3859 | |
| 3860 | PostCreateImageView(device, pView, result); |
| 3861 | |
| 3862 | return result; |
| 3863 | } |
| 3864 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3865 | bool PreCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3866 | VkDevice device, |
| 3867 | const VkShaderCreateInfo* pCreateInfo) |
| 3868 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3869 | if(pCreateInfo != nullptr) |
| 3870 | { |
| 3871 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SHADER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3872 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3873 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3874 | "vkCreateShader parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3875 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3876 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3877 | if(pCreateInfo->pName != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3878 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3879 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3880 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3881 | |
| 3882 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3883 | } |
| 3884 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3885 | bool PostCreateShader( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3886 | VkDevice device, |
| 3887 | VkShader* pShader, |
| 3888 | VkResult result) |
| 3889 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3890 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3891 | if(pShader != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3892 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3893 | } |
| 3894 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3895 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3896 | { |
| 3897 | std::string reason = "vkCreateShader parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3898 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3899 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3900 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3901 | |
| 3902 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3903 | } |
| 3904 | |
| 3905 | VK_LAYER_EXPORT VkResult VKAPI vkCreateShader( |
| 3906 | VkDevice device, |
| 3907 | const VkShaderCreateInfo* pCreateInfo, |
| 3908 | VkShader* pShader) |
| 3909 | { |
| 3910 | PreCreateShader(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3911 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3912 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateShader(device, pCreateInfo, pShader); |
| 3913 | |
| 3914 | PostCreateShader(device, pShader, result); |
| 3915 | |
| 3916 | return result; |
| 3917 | } |
| 3918 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3919 | bool PreCreatePipelineCache( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3920 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3921 | const VkPipelineCacheCreateInfo* pCreateInfo) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3922 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3923 | if(pCreateInfo != nullptr) |
| 3924 | { |
| 3925 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3926 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3927 | 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] | 3928 | "vkCreatePipelineCache parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3929 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3930 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3931 | if(pCreateInfo->initialData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3932 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3933 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3934 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3935 | |
| 3936 | return true; |
| 3937 | } |
| 3938 | |
| 3939 | bool PostCreatePipelineCache( |
| 3940 | VkDevice device, |
| 3941 | VkPipelineCache* pPipelineCache, |
| 3942 | VkResult result) |
| 3943 | { |
| 3944 | |
| 3945 | if(pPipelineCache != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3946 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3947 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3948 | |
| 3949 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3950 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3951 | std::string reason = "vkCreatePipelineCache parameter, VkResult result, is " + EnumeratorString(result); |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 3952 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 3953 | return false; |
| 3954 | } |
| 3955 | |
| 3956 | return true; |
| 3957 | } |
| 3958 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3959 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineCache( |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 3960 | VkDevice device, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3961 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 3962 | VkPipelineCache* pPipelineCache) |
| 3963 | { |
| 3964 | PreCreatePipelineCache(device, pCreateInfo); |
| 3965 | |
| 3966 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineCache(device, pCreateInfo, pPipelineCache); |
| 3967 | |
| 3968 | PostCreatePipelineCache(device, pPipelineCache, result); |
| 3969 | |
| 3970 | return result; |
| 3971 | } |
| 3972 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3973 | bool PostGetPipelineCacheSize( |
| 3974 | VkDevice device, |
| 3975 | VkPipelineCache pipelineCache) |
| 3976 | { |
| 3977 | |
| 3978 | |
| 3979 | return true; |
| 3980 | } |
| 3981 | |
| 3982 | VK_LAYER_EXPORT size_t VKAPI vkGetPipelineCacheSize( |
| 3983 | VkDevice device, |
| 3984 | VkPipelineCache pipelineCache) |
| 3985 | { |
Jeremy Hayes | a663c70 | 2015-07-31 12:54:58 -0600 | [diff] [blame] | 3986 | 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] | 3987 | |
| 3988 | PostGetPipelineCacheSize(device, pipelineCache); |
Jeremy Hayes | a663c70 | 2015-07-31 12:54:58 -0600 | [diff] [blame] | 3989 | |
| 3990 | return result; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3991 | } |
| 3992 | |
| 3993 | bool PostGetPipelineCacheData( |
| 3994 | VkDevice device, |
| 3995 | VkPipelineCache pipelineCache, |
| 3996 | void* pData, |
| 3997 | VkResult result) |
| 3998 | { |
| 3999 | |
| 4000 | |
| 4001 | if(pData != nullptr) |
| 4002 | { |
| 4003 | } |
| 4004 | |
| 4005 | if(result < VK_SUCCESS) |
| 4006 | { |
| 4007 | std::string reason = "vkGetPipelineCacheData parameter, VkResult result, is " + EnumeratorString(result); |
| 4008 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4009 | return false; |
| 4010 | } |
| 4011 | |
| 4012 | return true; |
| 4013 | } |
| 4014 | |
| 4015 | VK_LAYER_EXPORT VkResult VKAPI vkGetPipelineCacheData( |
| 4016 | VkDevice device, |
| 4017 | VkPipelineCache pipelineCache, |
| 4018 | void* pData) |
| 4019 | { |
| 4020 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetPipelineCacheData(device, pipelineCache, pData); |
| 4021 | |
| 4022 | PostGetPipelineCacheData(device, pipelineCache, pData, result); |
| 4023 | |
| 4024 | return result; |
| 4025 | } |
| 4026 | |
| 4027 | bool PreMergePipelineCaches( |
| 4028 | VkDevice device, |
| 4029 | const VkPipelineCache* pSrcCaches) |
| 4030 | { |
| 4031 | if(pSrcCaches != nullptr) |
| 4032 | { |
| 4033 | } |
| 4034 | |
| 4035 | return true; |
| 4036 | } |
| 4037 | |
| 4038 | bool PostMergePipelineCaches( |
| 4039 | VkDevice device, |
| 4040 | VkPipelineCache destCache, |
| 4041 | uint32_t srcCacheCount, |
| 4042 | VkResult result) |
| 4043 | { |
| 4044 | |
| 4045 | |
| 4046 | |
| 4047 | if(result < VK_SUCCESS) |
| 4048 | { |
| 4049 | std::string reason = "vkMergePipelineCaches parameter, VkResult result, is " + EnumeratorString(result); |
| 4050 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4051 | return false; |
| 4052 | } |
| 4053 | |
| 4054 | return true; |
| 4055 | } |
| 4056 | |
| 4057 | VK_LAYER_EXPORT VkResult VKAPI vkMergePipelineCaches( |
| 4058 | VkDevice device, |
| 4059 | VkPipelineCache destCache, |
| 4060 | uint32_t srcCacheCount, |
| 4061 | const VkPipelineCache* pSrcCaches) |
| 4062 | { |
| 4063 | PreMergePipelineCaches(device, pSrcCaches); |
| 4064 | |
| 4065 | VkResult result = get_dispatch_table(pc_device_table_map, device)->MergePipelineCaches(device, destCache, srcCacheCount, pSrcCaches); |
| 4066 | |
| 4067 | PostMergePipelineCaches(device, destCache, srcCacheCount, result); |
| 4068 | |
| 4069 | return result; |
| 4070 | } |
| 4071 | |
| 4072 | bool PreCreateGraphicsPipelines( |
| 4073 | VkDevice device, |
| 4074 | const VkGraphicsPipelineCreateInfo* pCreateInfos) |
| 4075 | { |
| 4076 | if(pCreateInfos != nullptr) |
| 4077 | { |
| 4078 | if(pCreateInfos->sType != VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO) |
| 4079 | { |
| 4080 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4081 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->sType, is an invalid enumerator"); |
| 4082 | return false; |
| 4083 | } |
| 4084 | if(pCreateInfos->pStages != nullptr) |
| 4085 | { |
| 4086 | if(pCreateInfos->pStages->sType != VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO) |
| 4087 | { |
| 4088 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4089 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pStages->sType, is an invalid enumerator"); |
| 4090 | return false; |
| 4091 | } |
| 4092 | if(pCreateInfos->pStages->stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4093 | pCreateInfos->pStages->stage > VK_SHADER_STAGE_END_RANGE) |
| 4094 | { |
| 4095 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4096 | "vkCreateGraphicsPipelines parameter, VkShaderStage pCreateInfos->pStages->stage, is an unrecognized enumerator"); |
| 4097 | return false; |
| 4098 | } |
| 4099 | if(pCreateInfos->pStages->pSpecializationInfo != nullptr) |
| 4100 | { |
| 4101 | if(pCreateInfos->pStages->pSpecializationInfo->pMap != nullptr) |
| 4102 | { |
| 4103 | } |
| 4104 | if(pCreateInfos->pStages->pSpecializationInfo->pData != nullptr) |
| 4105 | { |
| 4106 | } |
| 4107 | } |
| 4108 | } |
| 4109 | if(pCreateInfos->pVertexInputState != nullptr) |
| 4110 | { |
| 4111 | if(pCreateInfos->pVertexInputState->sType != VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO) |
| 4112 | { |
| 4113 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4114 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pVertexInputState->sType, is an invalid enumerator"); |
| 4115 | return false; |
| 4116 | } |
| 4117 | if(pCreateInfos->pVertexInputState->pVertexBindingDescriptions != nullptr) |
| 4118 | { |
| 4119 | if(pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate < VK_VERTEX_INPUT_STEP_RATE_BEGIN_RANGE || |
| 4120 | pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate > VK_VERTEX_INPUT_STEP_RATE_END_RANGE) |
| 4121 | { |
| 4122 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4123 | "vkCreateGraphicsPipelines parameter, VkVertexInputStepRate pCreateInfos->pVertexInputState->pVertexBindingDescriptions->stepRate, is an unrecognized enumerator"); |
| 4124 | return false; |
| 4125 | } |
| 4126 | } |
| 4127 | if(pCreateInfos->pVertexInputState->pVertexAttributeDescriptions != nullptr) |
| 4128 | { |
| 4129 | if(pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format < VK_FORMAT_BEGIN_RANGE || |
| 4130 | pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format > VK_FORMAT_END_RANGE) |
| 4131 | { |
| 4132 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4133 | "vkCreateGraphicsPipelines parameter, VkFormat pCreateInfos->pVertexInputState->pVertexAttributeDescriptions->format, is an unrecognized enumerator"); |
| 4134 | return false; |
| 4135 | } |
| 4136 | } |
| 4137 | } |
| 4138 | if(pCreateInfos->pInputAssemblyState != nullptr) |
| 4139 | { |
| 4140 | if(pCreateInfos->pInputAssemblyState->sType != VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO) |
| 4141 | { |
| 4142 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4143 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pInputAssemblyState->sType, is an invalid enumerator"); |
| 4144 | return false; |
| 4145 | } |
| 4146 | if(pCreateInfos->pInputAssemblyState->topology < VK_PRIMITIVE_TOPOLOGY_BEGIN_RANGE || |
| 4147 | pCreateInfos->pInputAssemblyState->topology > VK_PRIMITIVE_TOPOLOGY_END_RANGE) |
| 4148 | { |
| 4149 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4150 | "vkCreateGraphicsPipelines parameter, VkPrimitiveTopology pCreateInfos->pInputAssemblyState->topology, is an unrecognized enumerator"); |
| 4151 | return false; |
| 4152 | } |
| 4153 | } |
| 4154 | if(pCreateInfos->pTessellationState != nullptr) |
| 4155 | { |
| 4156 | if(pCreateInfos->pTessellationState->sType != VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO) |
| 4157 | { |
| 4158 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4159 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pTessellationState->sType, is an invalid enumerator"); |
| 4160 | return false; |
| 4161 | } |
| 4162 | } |
| 4163 | if(pCreateInfos->pViewportState != nullptr) |
| 4164 | { |
| 4165 | if(pCreateInfos->pViewportState->sType != VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO) |
| 4166 | { |
| 4167 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4168 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pViewportState->sType, is an invalid enumerator"); |
| 4169 | return false; |
| 4170 | } |
| 4171 | } |
| 4172 | if(pCreateInfos->pRasterState != nullptr) |
| 4173 | { |
| 4174 | if(pCreateInfos->pRasterState->sType != VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO) |
| 4175 | { |
| 4176 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4177 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pRasterState->sType, is an invalid enumerator"); |
| 4178 | return false; |
| 4179 | } |
| 4180 | if(pCreateInfos->pRasterState->fillMode < VK_FILL_MODE_BEGIN_RANGE || |
| 4181 | pCreateInfos->pRasterState->fillMode > VK_FILL_MODE_END_RANGE) |
| 4182 | { |
| 4183 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4184 | "vkCreateGraphicsPipelines parameter, VkFillMode pCreateInfos->pRasterState->fillMode, is an unrecognized enumerator"); |
| 4185 | return false; |
| 4186 | } |
| 4187 | if(pCreateInfos->pRasterState->cullMode < VK_CULL_MODE_BEGIN_RANGE || |
| 4188 | pCreateInfos->pRasterState->cullMode > VK_CULL_MODE_END_RANGE) |
| 4189 | { |
| 4190 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4191 | "vkCreateGraphicsPipelines parameter, VkCullMode pCreateInfos->pRasterState->cullMode, is an unrecognized enumerator"); |
| 4192 | return false; |
| 4193 | } |
| 4194 | if(pCreateInfos->pRasterState->frontFace < VK_FRONT_FACE_BEGIN_RANGE || |
| 4195 | pCreateInfos->pRasterState->frontFace > VK_FRONT_FACE_END_RANGE) |
| 4196 | { |
| 4197 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4198 | "vkCreateGraphicsPipelines parameter, VkFrontFace pCreateInfos->pRasterState->frontFace, is an unrecognized enumerator"); |
| 4199 | return false; |
| 4200 | } |
| 4201 | } |
| 4202 | if(pCreateInfos->pMultisampleState != nullptr) |
| 4203 | { |
| 4204 | if(pCreateInfos->pMultisampleState->sType != VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO) |
| 4205 | { |
| 4206 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4207 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pMultisampleState->sType, is an invalid enumerator"); |
| 4208 | return false; |
| 4209 | } |
| 4210 | } |
| 4211 | if(pCreateInfos->pDepthStencilState != nullptr) |
| 4212 | { |
| 4213 | if(pCreateInfos->pDepthStencilState->sType != VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO) |
| 4214 | { |
| 4215 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4216 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pDepthStencilState->sType, is an invalid enumerator"); |
| 4217 | return false; |
| 4218 | } |
| 4219 | if(pCreateInfos->pDepthStencilState->depthCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4220 | pCreateInfos->pDepthStencilState->depthCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4221 | { |
| 4222 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4223 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->depthCompareOp, is an unrecognized enumerator"); |
| 4224 | return false; |
| 4225 | } |
| 4226 | if(pCreateInfos->pDepthStencilState->front.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4227 | pCreateInfos->pDepthStencilState->front.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 4228 | { |
| 4229 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4230 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilFailOp, is an unrecognized enumerator"); |
| 4231 | return false; |
| 4232 | } |
| 4233 | if(pCreateInfos->pDepthStencilState->front.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4234 | pCreateInfos->pDepthStencilState->front.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 4235 | { |
| 4236 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4237 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilPassOp, is an unrecognized enumerator"); |
| 4238 | return false; |
| 4239 | } |
| 4240 | if(pCreateInfos->pDepthStencilState->front.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4241 | pCreateInfos->pDepthStencilState->front.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 4242 | { |
| 4243 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4244 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->front.stencilDepthFailOp, is an unrecognized enumerator"); |
| 4245 | return false; |
| 4246 | } |
| 4247 | if(pCreateInfos->pDepthStencilState->front.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4248 | pCreateInfos->pDepthStencilState->front.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4249 | { |
| 4250 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4251 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->front.stencilCompareOp, is an unrecognized enumerator"); |
| 4252 | return false; |
| 4253 | } |
| 4254 | if(pCreateInfos->pDepthStencilState->back.stencilFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4255 | pCreateInfos->pDepthStencilState->back.stencilFailOp > VK_STENCIL_OP_END_RANGE) |
| 4256 | { |
| 4257 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4258 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilFailOp, is an unrecognized enumerator"); |
| 4259 | return false; |
| 4260 | } |
| 4261 | if(pCreateInfos->pDepthStencilState->back.stencilPassOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4262 | pCreateInfos->pDepthStencilState->back.stencilPassOp > VK_STENCIL_OP_END_RANGE) |
| 4263 | { |
| 4264 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4265 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilPassOp, is an unrecognized enumerator"); |
| 4266 | return false; |
| 4267 | } |
| 4268 | if(pCreateInfos->pDepthStencilState->back.stencilDepthFailOp < VK_STENCIL_OP_BEGIN_RANGE || |
| 4269 | pCreateInfos->pDepthStencilState->back.stencilDepthFailOp > VK_STENCIL_OP_END_RANGE) |
| 4270 | { |
| 4271 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4272 | "vkCreateGraphicsPipelines parameter, VkStencilOp pCreateInfos->pDepthStencilState->back.stencilDepthFailOp, is an unrecognized enumerator"); |
| 4273 | return false; |
| 4274 | } |
| 4275 | if(pCreateInfos->pDepthStencilState->back.stencilCompareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4276 | pCreateInfos->pDepthStencilState->back.stencilCompareOp > VK_COMPARE_OP_END_RANGE) |
| 4277 | { |
| 4278 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4279 | "vkCreateGraphicsPipelines parameter, VkCompareOp pCreateInfos->pDepthStencilState->back.stencilCompareOp, is an unrecognized enumerator"); |
| 4280 | return false; |
| 4281 | } |
| 4282 | } |
| 4283 | if(pCreateInfos->pColorBlendState != nullptr) |
| 4284 | { |
| 4285 | if(pCreateInfos->pColorBlendState->sType != VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO) |
| 4286 | { |
| 4287 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4288 | "vkCreateGraphicsPipelines parameter, VkStructureType pCreateInfos->pColorBlendState->sType, is an invalid enumerator"); |
| 4289 | return false; |
| 4290 | } |
| 4291 | if(pCreateInfos->pColorBlendState->logicOp < VK_LOGIC_OP_BEGIN_RANGE || |
| 4292 | pCreateInfos->pColorBlendState->logicOp > VK_LOGIC_OP_END_RANGE) |
| 4293 | { |
| 4294 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4295 | "vkCreateGraphicsPipelines parameter, VkLogicOp pCreateInfos->pColorBlendState->logicOp, is an unrecognized enumerator"); |
| 4296 | return false; |
| 4297 | } |
| 4298 | if(pCreateInfos->pColorBlendState->pAttachments != nullptr) |
| 4299 | { |
| 4300 | if(pCreateInfos->pColorBlendState->pAttachments->srcBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4301 | pCreateInfos->pColorBlendState->pAttachments->srcBlendColor > VK_BLEND_END_RANGE) |
| 4302 | { |
| 4303 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4304 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->srcBlendColor, is an unrecognized enumerator"); |
| 4305 | return false; |
| 4306 | } |
| 4307 | if(pCreateInfos->pColorBlendState->pAttachments->destBlendColor < VK_BLEND_BEGIN_RANGE || |
| 4308 | pCreateInfos->pColorBlendState->pAttachments->destBlendColor > VK_BLEND_END_RANGE) |
| 4309 | { |
| 4310 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4311 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->destBlendColor, is an unrecognized enumerator"); |
| 4312 | return false; |
| 4313 | } |
| 4314 | if(pCreateInfos->pColorBlendState->pAttachments->blendOpColor < VK_BLEND_OP_BEGIN_RANGE || |
| 4315 | pCreateInfos->pColorBlendState->pAttachments->blendOpColor > VK_BLEND_OP_END_RANGE) |
| 4316 | { |
| 4317 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4318 | "vkCreateGraphicsPipelines parameter, VkBlendOp pCreateInfos->pColorBlendState->pAttachments->blendOpColor, is an unrecognized enumerator"); |
| 4319 | return false; |
| 4320 | } |
| 4321 | if(pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4322 | pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha > VK_BLEND_END_RANGE) |
| 4323 | { |
| 4324 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4325 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->srcBlendAlpha, is an unrecognized enumerator"); |
| 4326 | return false; |
| 4327 | } |
| 4328 | if(pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha < VK_BLEND_BEGIN_RANGE || |
| 4329 | pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha > VK_BLEND_END_RANGE) |
| 4330 | { |
| 4331 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4332 | "vkCreateGraphicsPipelines parameter, VkBlend pCreateInfos->pColorBlendState->pAttachments->destBlendAlpha, is an unrecognized enumerator"); |
| 4333 | return false; |
| 4334 | } |
| 4335 | if(pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha < VK_BLEND_OP_BEGIN_RANGE || |
| 4336 | pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha > VK_BLEND_OP_END_RANGE) |
| 4337 | { |
| 4338 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4339 | "vkCreateGraphicsPipelines parameter, VkBlendOp pCreateInfos->pColorBlendState->pAttachments->blendOpAlpha, is an unrecognized enumerator"); |
| 4340 | return false; |
| 4341 | } |
| 4342 | } |
| 4343 | } |
Jeremy Hayes | f06ae82 | 2015-07-31 14:16:20 -0600 | [diff] [blame] | 4344 | if(pCreateInfos->renderPass == VK_NULL_HANDLE) |
| 4345 | { |
| 4346 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4347 | "vkCreateGraphicsPipelines parameter, VkRenderPass pCreateInfos->renderPass, is null pointer"); |
| 4348 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4349 | } |
| 4350 | |
| 4351 | return true; |
| 4352 | } |
| 4353 | |
| 4354 | bool PostCreateGraphicsPipelines( |
| 4355 | VkDevice device, |
| 4356 | VkPipelineCache pipelineCache, |
| 4357 | uint32_t count, |
| 4358 | VkPipeline* pPipelines, |
| 4359 | VkResult result) |
| 4360 | { |
| 4361 | |
| 4362 | |
| 4363 | |
| 4364 | if(pPipelines != nullptr) |
| 4365 | { |
| 4366 | } |
| 4367 | |
| 4368 | if(result < VK_SUCCESS) |
| 4369 | { |
| 4370 | std::string reason = "vkCreateGraphicsPipelines parameter, VkResult result, is " + EnumeratorString(result); |
| 4371 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4372 | return false; |
| 4373 | } |
| 4374 | |
| 4375 | return true; |
| 4376 | } |
| 4377 | |
| 4378 | VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines( |
| 4379 | VkDevice device, |
| 4380 | VkPipelineCache pipelineCache, |
| 4381 | uint32_t count, |
| 4382 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 4383 | VkPipeline* pPipelines) |
| 4384 | { |
| 4385 | PreCreateGraphicsPipelines(device, pCreateInfos); |
| 4386 | |
| 4387 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
| 4388 | |
| 4389 | PostCreateGraphicsPipelines(device, pipelineCache, count, pPipelines, result); |
| 4390 | |
| 4391 | return result; |
| 4392 | } |
| 4393 | |
| 4394 | bool PreCreateComputePipelines( |
| 4395 | VkDevice device, |
| 4396 | const VkComputePipelineCreateInfo* pCreateInfos) |
| 4397 | { |
| 4398 | if(pCreateInfos != nullptr) |
| 4399 | { |
| 4400 | if(pCreateInfos->sType != VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO) |
| 4401 | { |
| 4402 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4403 | "vkCreateComputePipelines parameter, VkStructureType pCreateInfos->sType, is an invalid enumerator"); |
| 4404 | return false; |
| 4405 | } |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4406 | if(pCreateInfos->stage.sType != VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4407 | { |
| 4408 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4409 | "vkCreateComputePipelines parameter, VkStructureType pCreateInfos->cs.sType, is an invalid enumerator"); |
| 4410 | return false; |
| 4411 | } |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4412 | if(pCreateInfos->stage.stage < VK_SHADER_STAGE_BEGIN_RANGE || |
| 4413 | pCreateInfos->stage.stage > VK_SHADER_STAGE_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4414 | { |
| 4415 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4416 | "vkCreateComputePipelines parameter, VkShaderStage pCreateInfos->cs.stage, is an unrecognized enumerator"); |
| 4417 | return false; |
| 4418 | } |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4419 | if(pCreateInfos->stage.pSpecializationInfo != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4420 | { |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4421 | if(pCreateInfos->stage.pSpecializationInfo->pMap != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4422 | { |
| 4423 | } |
Courtney Goeltzenleuchter | b1c9329 | 2015-09-02 13:07:51 -0600 | [diff] [blame] | 4424 | if(pCreateInfos->stage.pSpecializationInfo->pData != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4425 | { |
| 4426 | } |
| 4427 | } |
| 4428 | } |
| 4429 | |
| 4430 | return true; |
| 4431 | } |
| 4432 | |
| 4433 | bool PostCreateComputePipelines( |
| 4434 | VkDevice device, |
| 4435 | VkPipelineCache pipelineCache, |
| 4436 | uint32_t count, |
| 4437 | VkPipeline* pPipelines, |
| 4438 | VkResult result) |
| 4439 | { |
| 4440 | |
| 4441 | |
| 4442 | |
| 4443 | if(pPipelines != nullptr) |
| 4444 | { |
| 4445 | } |
| 4446 | |
| 4447 | if(result < VK_SUCCESS) |
| 4448 | { |
| 4449 | std::string reason = "vkCreateComputePipelines parameter, VkResult result, is " + EnumeratorString(result); |
| 4450 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4451 | return false; |
| 4452 | } |
| 4453 | |
| 4454 | return true; |
| 4455 | } |
| 4456 | |
| 4457 | VK_LAYER_EXPORT VkResult VKAPI vkCreateComputePipelines( |
| 4458 | VkDevice device, |
| 4459 | VkPipelineCache pipelineCache, |
| 4460 | uint32_t count, |
| 4461 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 4462 | VkPipeline* pPipelines) |
| 4463 | { |
| 4464 | PreCreateComputePipelines(device, pCreateInfos); |
| 4465 | |
| 4466 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pPipelines); |
| 4467 | |
| 4468 | PostCreateComputePipelines(device, pipelineCache, count, pPipelines, result); |
| 4469 | |
| 4470 | return result; |
| 4471 | } |
| 4472 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4473 | bool PreCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4474 | VkDevice device, |
| 4475 | const VkPipelineLayoutCreateInfo* pCreateInfo) |
| 4476 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4477 | if(pCreateInfo != nullptr) |
| 4478 | { |
| 4479 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4480 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4481 | 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] | 4482 | "vkCreatePipelineLayout parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 4483 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4484 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4485 | if(pCreateInfo->pSetLayouts != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4486 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4487 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4488 | if(pCreateInfo->pPushConstantRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4489 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4490 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4491 | } |
| 4492 | |
| 4493 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4494 | } |
| 4495 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4496 | bool PostCreatePipelineLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4497 | VkDevice device, |
| 4498 | VkPipelineLayout* pPipelineLayout, |
| 4499 | VkResult result) |
| 4500 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4501 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4502 | if(pPipelineLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4503 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4504 | } |
| 4505 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4506 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4507 | { |
| 4508 | std::string reason = "vkCreatePipelineLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4509 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4510 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4511 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4512 | |
| 4513 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4514 | } |
| 4515 | |
| 4516 | VK_LAYER_EXPORT VkResult VKAPI vkCreatePipelineLayout( |
| 4517 | VkDevice device, |
| 4518 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 4519 | VkPipelineLayout* pPipelineLayout) |
| 4520 | { |
| 4521 | PreCreatePipelineLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4522 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4523 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pPipelineLayout); |
| 4524 | |
| 4525 | PostCreatePipelineLayout(device, pPipelineLayout, result); |
| 4526 | |
| 4527 | return result; |
| 4528 | } |
| 4529 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4530 | bool PreCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4531 | VkDevice device, |
| 4532 | const VkSamplerCreateInfo* pCreateInfo) |
| 4533 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4534 | if(pCreateInfo != nullptr) |
| 4535 | { |
| 4536 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4537 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4538 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4539 | "vkCreateSampler parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4540 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4541 | } |
| 4542 | if(pCreateInfo->magFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 4543 | pCreateInfo->magFilter > VK_TEX_FILTER_END_RANGE) |
| 4544 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4545 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4546 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->magFilter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4547 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4548 | } |
| 4549 | if(pCreateInfo->minFilter < VK_TEX_FILTER_BEGIN_RANGE || |
| 4550 | pCreateInfo->minFilter > VK_TEX_FILTER_END_RANGE) |
| 4551 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4552 | 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] | 4553 | "vkCreateSampler parameter, VkTexFilter pCreateInfo->minFilter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4554 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4555 | } |
| 4556 | if(pCreateInfo->mipMode < VK_TEX_MIPMAP_MODE_BEGIN_RANGE || |
| 4557 | pCreateInfo->mipMode > VK_TEX_MIPMAP_MODE_END_RANGE) |
| 4558 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4559 | 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] | 4560 | "vkCreateSampler parameter, VkTexMipmapMode pCreateInfo->mipMode, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4561 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4562 | } |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4563 | if(pCreateInfo->addressModeU < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 4564 | pCreateInfo->addressModeU > VK_TEX_ADDRESS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4565 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4566 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4567 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressModeU, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4568 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4569 | } |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4570 | if(pCreateInfo->addressModeV < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 4571 | pCreateInfo->addressModeV > VK_TEX_ADDRESS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4572 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4573 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4574 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressModeV, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4575 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4576 | } |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4577 | if(pCreateInfo->addressModeW < VK_TEX_ADDRESS_BEGIN_RANGE || |
| 4578 | pCreateInfo->addressModeW > VK_TEX_ADDRESS_END_RANGE) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4579 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4580 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Courtney Goeltzenleuchter | 9795335 | 2015-09-10 14:08:50 -0600 | [diff] [blame] | 4581 | "vkCreateSampler parameter, VkTexAddress pCreateInfo->addressModeW, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4582 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4583 | } |
| 4584 | if(pCreateInfo->compareOp < VK_COMPARE_OP_BEGIN_RANGE || |
| 4585 | pCreateInfo->compareOp > VK_COMPARE_OP_END_RANGE) |
| 4586 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4587 | 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] | 4588 | "vkCreateSampler parameter, VkCompareOp pCreateInfo->compareOp, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4589 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4590 | } |
| 4591 | if(pCreateInfo->borderColor < VK_BORDER_COLOR_BEGIN_RANGE || |
| 4592 | pCreateInfo->borderColor > VK_BORDER_COLOR_END_RANGE) |
| 4593 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4594 | 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] | 4595 | "vkCreateSampler parameter, VkBorderColor pCreateInfo->borderColor, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4596 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4597 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4598 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4599 | |
| 4600 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4601 | } |
| 4602 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4603 | bool PostCreateSampler( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4604 | VkDevice device, |
| 4605 | VkSampler* pSampler, |
| 4606 | VkResult result) |
| 4607 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4608 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4609 | if(pSampler != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4610 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4611 | } |
| 4612 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4613 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4614 | { |
| 4615 | std::string reason = "vkCreateSampler parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4616 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4617 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4618 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4619 | |
| 4620 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4621 | } |
| 4622 | |
| 4623 | VK_LAYER_EXPORT VkResult VKAPI vkCreateSampler( |
| 4624 | VkDevice device, |
| 4625 | const VkSamplerCreateInfo* pCreateInfo, |
| 4626 | VkSampler* pSampler) |
| 4627 | { |
| 4628 | PreCreateSampler(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4629 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4630 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pSampler); |
| 4631 | |
| 4632 | PostCreateSampler(device, pSampler, result); |
| 4633 | |
| 4634 | return result; |
| 4635 | } |
| 4636 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4637 | bool PreCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4638 | VkDevice device, |
| 4639 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo) |
| 4640 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4641 | if(pCreateInfo != nullptr) |
| 4642 | { |
| 4643 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4644 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4645 | 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] | 4646 | "vkCreateDescriptorSetLayout parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4647 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4648 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4649 | if(pCreateInfo->pBinding != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4650 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4651 | if(pCreateInfo->pBinding->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 4652 | pCreateInfo->pBinding->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 4653 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4654 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4655 | "vkCreateDescriptorSetLayout parameter, VkDescriptorType pCreateInfo->pBinding->descriptorType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4656 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4657 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4658 | if(pCreateInfo->pBinding->pImmutableSamplers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4659 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4660 | } |
| 4661 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4662 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4663 | |
| 4664 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4665 | } |
| 4666 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4667 | bool PostCreateDescriptorSetLayout( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4668 | VkDevice device, |
| 4669 | VkDescriptorSetLayout* pSetLayout, |
| 4670 | VkResult result) |
| 4671 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4672 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4673 | if(pSetLayout != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4674 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4675 | } |
| 4676 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4677 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4678 | { |
| 4679 | std::string reason = "vkCreateDescriptorSetLayout parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4680 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4681 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4682 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4683 | |
| 4684 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4685 | } |
| 4686 | |
| 4687 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout( |
| 4688 | VkDevice device, |
| 4689 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 4690 | VkDescriptorSetLayout* pSetLayout) |
| 4691 | { |
| 4692 | PreCreateDescriptorSetLayout(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4693 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4694 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pSetLayout); |
| 4695 | |
| 4696 | PostCreateDescriptorSetLayout(device, pSetLayout, result); |
| 4697 | |
| 4698 | return result; |
| 4699 | } |
| 4700 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4701 | bool PreCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4702 | VkDevice device, |
| 4703 | const VkDescriptorPoolCreateInfo* pCreateInfo) |
| 4704 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4705 | if(pCreateInfo != nullptr) |
| 4706 | { |
| 4707 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4708 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4709 | 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] | 4710 | "vkCreateDescriptorPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4711 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4712 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4713 | if(pCreateInfo->pTypeCount != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4714 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4715 | if(pCreateInfo->pTypeCount->type < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 4716 | pCreateInfo->pTypeCount->type > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 4717 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4718 | 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] | 4719 | "vkCreateDescriptorPool parameter, VkDescriptorType pCreateInfo->pTypeCount->type, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4720 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4721 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4722 | } |
| 4723 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4724 | |
| 4725 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4726 | } |
| 4727 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4728 | bool PostCreateDescriptorPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4729 | VkDevice device, |
| 4730 | VkDescriptorPoolUsage poolUsage, |
| 4731 | uint32_t maxSets, |
| 4732 | VkDescriptorPool* pDescriptorPool, |
| 4733 | VkResult result) |
| 4734 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4735 | |
| 4736 | if(poolUsage < VK_DESCRIPTOR_POOL_USAGE_BEGIN_RANGE || |
| 4737 | poolUsage > VK_DESCRIPTOR_POOL_USAGE_END_RANGE) |
| 4738 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4739 | 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] | 4740 | "vkCreateDescriptorPool parameter, VkDescriptorPoolUsage poolUsage, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4741 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4742 | } |
| 4743 | |
Courtney Goeltzenleuchter | fe908d3 | 2015-09-16 16:12:45 -0600 | [diff] [blame] | 4744 | /* TODOVV: How do we validate maxSets? Probably belongs in the limits layer? */ |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4745 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4746 | if(pDescriptorPool != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4747 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4748 | } |
| 4749 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4750 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4751 | { |
| 4752 | std::string reason = "vkCreateDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4753 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4754 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4755 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4756 | |
| 4757 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4758 | } |
| 4759 | |
| 4760 | VK_LAYER_EXPORT VkResult VKAPI vkCreateDescriptorPool( |
| 4761 | VkDevice device, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4762 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 4763 | VkDescriptorPool* pDescriptorPool) |
| 4764 | { |
| 4765 | PreCreateDescriptorPool(device, pCreateInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4766 | |
Courtney Goeltzenleuchter | fe908d3 | 2015-09-16 16:12:45 -0600 | [diff] [blame] | 4767 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4768 | |
Courtney Goeltzenleuchter | fe908d3 | 2015-09-16 16:12:45 -0600 | [diff] [blame] | 4769 | PostCreateDescriptorPool(device, pCreateInfo->poolUsage, pCreateInfo->maxSets, pDescriptorPool, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4770 | |
| 4771 | return result; |
| 4772 | } |
| 4773 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4774 | bool PostResetDescriptorPool( |
| 4775 | VkDevice device, |
| 4776 | VkDescriptorPool descriptorPool, |
| 4777 | VkResult result) |
| 4778 | { |
| 4779 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4780 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4781 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4782 | { |
| 4783 | std::string reason = "vkResetDescriptorPool parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4784 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4785 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4786 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4787 | |
| 4788 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4789 | } |
| 4790 | |
| 4791 | VK_LAYER_EXPORT VkResult VKAPI vkResetDescriptorPool( |
| 4792 | VkDevice device, |
| 4793 | VkDescriptorPool descriptorPool) |
| 4794 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4795 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool); |
| 4796 | |
| 4797 | PostResetDescriptorPool(device, descriptorPool, result); |
| 4798 | |
| 4799 | return result; |
| 4800 | } |
| 4801 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4802 | bool PreAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4803 | VkDevice device, |
| 4804 | const VkDescriptorSetLayout* pSetLayouts) |
| 4805 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4806 | if(pSetLayouts != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4807 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4808 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4809 | |
| 4810 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4811 | } |
| 4812 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4813 | bool PostAllocDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4814 | VkDevice device, |
| 4815 | VkDescriptorPool descriptorPool, |
| 4816 | VkDescriptorSetUsage setUsage, |
| 4817 | uint32_t count, |
| 4818 | VkDescriptorSet* pDescriptorSets, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4819 | VkResult result) |
| 4820 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4821 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4822 | |
| 4823 | if(setUsage < VK_DESCRIPTOR_SET_USAGE_BEGIN_RANGE || |
| 4824 | setUsage > VK_DESCRIPTOR_SET_USAGE_END_RANGE) |
| 4825 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4826 | 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] | 4827 | "vkAllocDescriptorSets parameter, VkDescriptorSetUsage setUsage, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4828 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4829 | } |
| 4830 | |
| 4831 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4832 | if(pDescriptorSets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4833 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4834 | } |
| 4835 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4836 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4837 | { |
| 4838 | std::string reason = "vkAllocDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4839 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4840 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4841 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4842 | |
| 4843 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4844 | } |
| 4845 | |
| 4846 | VK_LAYER_EXPORT VkResult VKAPI vkAllocDescriptorSets( |
| 4847 | VkDevice device, |
| 4848 | VkDescriptorPool descriptorPool, |
| 4849 | VkDescriptorSetUsage setUsage, |
| 4850 | uint32_t count, |
| 4851 | const VkDescriptorSetLayout* pSetLayouts, |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 4852 | VkDescriptorSet* pDescriptorSets) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4853 | { |
| 4854 | PreAllocDescriptorSets(device, pSetLayouts); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4855 | |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 4856 | 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] | 4857 | |
Cody Northrop | 1e4f802 | 2015-08-03 12:47:29 -0600 | [diff] [blame] | 4858 | PostAllocDescriptorSets(device, descriptorPool, setUsage, count, pDescriptorSets, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4859 | |
| 4860 | return result; |
| 4861 | } |
| 4862 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4863 | bool PreFreeDescriptorSets( |
| 4864 | VkDevice device, |
| 4865 | const VkDescriptorSet* pDescriptorSets) |
| 4866 | { |
| 4867 | if(pDescriptorSets != nullptr) |
| 4868 | { |
| 4869 | } |
| 4870 | |
| 4871 | return true; |
| 4872 | } |
| 4873 | |
| 4874 | bool PostFreeDescriptorSets( |
| 4875 | VkDevice device, |
| 4876 | VkDescriptorPool descriptorPool, |
| 4877 | uint32_t count, |
| 4878 | VkResult result) |
| 4879 | { |
| 4880 | |
| 4881 | |
| 4882 | |
| 4883 | if(result < VK_SUCCESS) |
| 4884 | { |
| 4885 | std::string reason = "vkFreeDescriptorSets parameter, VkResult result, is " + EnumeratorString(result); |
| 4886 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4887 | return false; |
| 4888 | } |
| 4889 | |
| 4890 | return true; |
| 4891 | } |
| 4892 | |
| 4893 | VK_LAYER_EXPORT VkResult VKAPI vkFreeDescriptorSets( |
| 4894 | VkDevice device, |
| 4895 | VkDescriptorPool descriptorPool, |
| 4896 | uint32_t count, |
| 4897 | const VkDescriptorSet* pDescriptorSets) |
| 4898 | { |
| 4899 | PreFreeDescriptorSets(device, pDescriptorSets); |
| 4900 | |
| 4901 | VkResult result = get_dispatch_table(pc_device_table_map, device)->FreeDescriptorSets(device, descriptorPool, count, pDescriptorSets); |
| 4902 | |
| 4903 | PostFreeDescriptorSets(device, descriptorPool, count, result); |
| 4904 | |
| 4905 | return result; |
| 4906 | } |
| 4907 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4908 | bool PreUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4909 | VkDevice device, |
| 4910 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 4911 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 4912 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4913 | if(pDescriptorWrites != nullptr) |
| 4914 | { |
| 4915 | if(pDescriptorWrites->sType != VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4916 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4917 | 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] | 4918 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorWrites->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4919 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4920 | } |
| 4921 | if(pDescriptorWrites->descriptorType < VK_DESCRIPTOR_TYPE_BEGIN_RANGE || |
| 4922 | pDescriptorWrites->descriptorType > VK_DESCRIPTOR_TYPE_END_RANGE) |
| 4923 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4924 | 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] | 4925 | "vkUpdateDescriptorSets parameter, VkDescriptorType pDescriptorWrites->descriptorType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4926 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4927 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4928 | if(pDescriptorWrites->pDescriptors != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4929 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4930 | if(pDescriptorWrites->pDescriptors->imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 4931 | pDescriptorWrites->pDescriptors->imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 4932 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4933 | 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] | 4934 | "vkUpdateDescriptorSets parameter, VkImageLayout pDescriptorWrites->pDescriptors->imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4935 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4936 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4937 | } |
| 4938 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4939 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4940 | if(pDescriptorCopies != nullptr) |
| 4941 | { |
| 4942 | if(pDescriptorCopies->sType != VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4943 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4944 | 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] | 4945 | "vkUpdateDescriptorSets parameter, VkStructureType pDescriptorCopies->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4946 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4947 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4948 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4949 | |
| 4950 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4951 | } |
| 4952 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 4953 | VK_LAYER_EXPORT void VKAPI vkUpdateDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4954 | VkDevice device, |
| 4955 | uint32_t writeCount, |
| 4956 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 4957 | uint32_t copyCount, |
| 4958 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 4959 | { |
| 4960 | PreUpdateDescriptorSets(device, pDescriptorWrites, pDescriptorCopies); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4961 | |
Mark Lobodzinski | 2141f65 | 2015-09-07 13:59:43 -0600 | [diff] [blame] | 4962 | get_dispatch_table(pc_device_table_map, device)->UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4963 | } |
| 4964 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4965 | bool PreCreateFramebuffer( |
| 4966 | VkDevice device, |
| 4967 | const VkFramebufferCreateInfo* pCreateInfo) |
| 4968 | { |
| 4969 | if(pCreateInfo != nullptr) |
| 4970 | { |
| 4971 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO) |
| 4972 | { |
| 4973 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 4974 | "vkCreateFramebuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 4975 | return false; |
| 4976 | } |
| 4977 | if(pCreateInfo->pAttachments != nullptr) |
| 4978 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4979 | } |
| 4980 | } |
| 4981 | |
| 4982 | return true; |
| 4983 | } |
| 4984 | |
| 4985 | bool PostCreateFramebuffer( |
| 4986 | VkDevice device, |
| 4987 | VkFramebuffer* pFramebuffer, |
| 4988 | VkResult result) |
| 4989 | { |
| 4990 | |
| 4991 | if(pFramebuffer != nullptr) |
| 4992 | { |
| 4993 | } |
| 4994 | |
| 4995 | if(result < VK_SUCCESS) |
| 4996 | { |
| 4997 | std::string reason = "vkCreateFramebuffer parameter, VkResult result, is " + EnumeratorString(result); |
| 4998 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 4999 | return false; |
| 5000 | } |
| 5001 | |
| 5002 | return true; |
| 5003 | } |
| 5004 | |
| 5005 | VK_LAYER_EXPORT VkResult VKAPI vkCreateFramebuffer( |
| 5006 | VkDevice device, |
| 5007 | const VkFramebufferCreateInfo* pCreateInfo, |
| 5008 | VkFramebuffer* pFramebuffer) |
| 5009 | { |
| 5010 | PreCreateFramebuffer(device, pCreateInfo); |
| 5011 | |
| 5012 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pFramebuffer); |
| 5013 | |
| 5014 | PostCreateFramebuffer(device, pFramebuffer, result); |
| 5015 | |
| 5016 | return result; |
| 5017 | } |
| 5018 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5019 | bool PreCreateRenderPass( |
| 5020 | VkDevice device, |
| 5021 | const VkRenderPassCreateInfo* pCreateInfo) |
| 5022 | { |
| 5023 | if(pCreateInfo != nullptr) |
| 5024 | { |
| 5025 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO) |
| 5026 | { |
| 5027 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5028 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 5029 | return false; |
| 5030 | } |
| 5031 | if(pCreateInfo->pAttachments != nullptr) |
| 5032 | { |
| 5033 | if(pCreateInfo->pAttachments->sType != VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION) |
| 5034 | { |
| 5035 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5036 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pAttachments->sType, is an invalid enumerator"); |
| 5037 | return false; |
| 5038 | } |
| 5039 | if(pCreateInfo->pAttachments->format < VK_FORMAT_BEGIN_RANGE || |
| 5040 | pCreateInfo->pAttachments->format > VK_FORMAT_END_RANGE) |
| 5041 | { |
| 5042 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5043 | "vkCreateRenderPass parameter, VkFormat pCreateInfo->pAttachments->format, is an unrecognized enumerator"); |
| 5044 | return false; |
| 5045 | } |
| 5046 | if(pCreateInfo->pAttachments->loadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || |
| 5047 | pCreateInfo->pAttachments->loadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 5048 | { |
| 5049 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5050 | "vkCreateRenderPass parameter, VkAttachmentLoadOp pCreateInfo->pAttachments->loadOp, is an unrecognized enumerator"); |
| 5051 | return false; |
| 5052 | } |
| 5053 | if(pCreateInfo->pAttachments->storeOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || |
| 5054 | pCreateInfo->pAttachments->storeOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 5055 | { |
| 5056 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5057 | "vkCreateRenderPass parameter, VkAttachmentStoreOp pCreateInfo->pAttachments->storeOp, is an unrecognized enumerator"); |
| 5058 | return false; |
| 5059 | } |
| 5060 | if(pCreateInfo->pAttachments->stencilLoadOp < VK_ATTACHMENT_LOAD_OP_BEGIN_RANGE || |
| 5061 | pCreateInfo->pAttachments->stencilLoadOp > VK_ATTACHMENT_LOAD_OP_END_RANGE) |
| 5062 | { |
| 5063 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5064 | "vkCreateRenderPass parameter, VkAttachmentLoadOp pCreateInfo->pAttachments->stencilLoadOp, is an unrecognized enumerator"); |
| 5065 | return false; |
| 5066 | } |
| 5067 | if(pCreateInfo->pAttachments->stencilStoreOp < VK_ATTACHMENT_STORE_OP_BEGIN_RANGE || |
| 5068 | pCreateInfo->pAttachments->stencilStoreOp > VK_ATTACHMENT_STORE_OP_END_RANGE) |
| 5069 | { |
| 5070 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5071 | "vkCreateRenderPass parameter, VkAttachmentStoreOp pCreateInfo->pAttachments->stencilStoreOp, is an unrecognized enumerator"); |
| 5072 | return false; |
| 5073 | } |
| 5074 | if(pCreateInfo->pAttachments->initialLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5075 | pCreateInfo->pAttachments->initialLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5076 | { |
| 5077 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5078 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pAttachments->initialLayout, is an unrecognized enumerator"); |
| 5079 | return false; |
| 5080 | } |
| 5081 | if(pCreateInfo->pAttachments->finalLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5082 | pCreateInfo->pAttachments->finalLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5083 | { |
| 5084 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5085 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pAttachments->finalLayout, is an unrecognized enumerator"); |
| 5086 | return false; |
| 5087 | } |
| 5088 | } |
| 5089 | if(pCreateInfo->pSubpasses != nullptr) |
| 5090 | { |
| 5091 | if(pCreateInfo->pSubpasses->sType != VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION) |
| 5092 | { |
| 5093 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5094 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pSubpasses->sType, is an invalid enumerator"); |
| 5095 | return false; |
| 5096 | } |
| 5097 | if(pCreateInfo->pSubpasses->pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 5098 | pCreateInfo->pSubpasses->pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 5099 | { |
| 5100 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5101 | "vkCreateRenderPass parameter, VkPipelineBindPoint pCreateInfo->pSubpasses->pipelineBindPoint, is an unrecognized enumerator"); |
| 5102 | return false; |
| 5103 | } |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5104 | if(pCreateInfo->pSubpasses->pInputAttachments != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5105 | { |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5106 | if(pCreateInfo->pSubpasses->pInputAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5107 | pCreateInfo->pSubpasses->pInputAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5108 | { |
| 5109 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5110 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->pInputAttachments->layout, is an unrecognized enumerator"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5111 | return false; |
| 5112 | } |
| 5113 | } |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5114 | if(pCreateInfo->pSubpasses->pColorAttachments != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5115 | { |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5116 | if(pCreateInfo->pSubpasses->pColorAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5117 | pCreateInfo->pSubpasses->pColorAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5118 | { |
| 5119 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5120 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->pColorAttachments->layout, is an unrecognized enumerator"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5121 | return false; |
| 5122 | } |
| 5123 | } |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5124 | if(pCreateInfo->pSubpasses->pResolveAttachments != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5125 | { |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5126 | if(pCreateInfo->pSubpasses->pResolveAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5127 | pCreateInfo->pSubpasses->pResolveAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5128 | { |
| 5129 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5130 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->pResolveAttachments->layout, is an unrecognized enumerator"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5131 | return false; |
| 5132 | } |
| 5133 | } |
| 5134 | if(pCreateInfo->pSubpasses->depthStencilAttachment.layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5135 | pCreateInfo->pSubpasses->depthStencilAttachment.layout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5136 | { |
| 5137 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5138 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->depthStencilAttachment.layout, is an unrecognized enumerator"); |
| 5139 | return false; |
| 5140 | } |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5141 | if(pCreateInfo->pSubpasses->pPreserveAttachments != nullptr) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5142 | { |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5143 | if(pCreateInfo->pSubpasses->pPreserveAttachments->layout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5144 | pCreateInfo->pSubpasses->pPreserveAttachments->layout > VK_IMAGE_LAYOUT_END_RANGE) |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5145 | { |
| 5146 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Cody Northrop | a505dda | 2015-08-04 11:16:41 -0600 | [diff] [blame] | 5147 | "vkCreateRenderPass parameter, VkImageLayout pCreateInfo->pSubpasses->pPreserveAttachments->layout, is an unrecognized enumerator"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5148 | return false; |
| 5149 | } |
| 5150 | } |
| 5151 | } |
| 5152 | if(pCreateInfo->pDependencies != nullptr) |
| 5153 | { |
| 5154 | if(pCreateInfo->pDependencies->sType != VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY) |
| 5155 | { |
| 5156 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5157 | "vkCreateRenderPass parameter, VkStructureType pCreateInfo->pDependencies->sType, is an invalid enumerator"); |
| 5158 | return false; |
| 5159 | } |
| 5160 | } |
| 5161 | } |
| 5162 | |
| 5163 | return true; |
| 5164 | } |
| 5165 | |
| 5166 | bool PostCreateRenderPass( |
| 5167 | VkDevice device, |
| 5168 | VkRenderPass* pRenderPass, |
| 5169 | VkResult result) |
| 5170 | { |
| 5171 | |
| 5172 | if(pRenderPass != nullptr) |
| 5173 | { |
| 5174 | } |
| 5175 | |
| 5176 | if(result < VK_SUCCESS) |
| 5177 | { |
| 5178 | std::string reason = "vkCreateRenderPass parameter, VkResult result, is " + EnumeratorString(result); |
| 5179 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5180 | return false; |
| 5181 | } |
| 5182 | |
| 5183 | return true; |
| 5184 | } |
| 5185 | |
| 5186 | VK_LAYER_EXPORT VkResult VKAPI vkCreateRenderPass( |
| 5187 | VkDevice device, |
| 5188 | const VkRenderPassCreateInfo* pCreateInfo, |
| 5189 | VkRenderPass* pRenderPass) |
| 5190 | { |
| 5191 | PreCreateRenderPass(device, pCreateInfo); |
| 5192 | |
| 5193 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pRenderPass); |
| 5194 | |
| 5195 | PostCreateRenderPass(device, pRenderPass, result); |
| 5196 | |
| 5197 | return result; |
| 5198 | } |
| 5199 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5200 | bool PostGetRenderAreaGranularity( |
| 5201 | VkDevice device, |
| 5202 | VkRenderPass renderPass, |
| 5203 | VkExtent2D* pGranularity, |
| 5204 | VkResult result) |
| 5205 | { |
| 5206 | |
| 5207 | |
| 5208 | if(pGranularity != nullptr) |
| 5209 | { |
| 5210 | } |
| 5211 | |
| 5212 | if(result < VK_SUCCESS) |
| 5213 | { |
| 5214 | std::string reason = "vkGetRenderAreaGranularity parameter, VkResult result, is " + EnumeratorString(result); |
| 5215 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5216 | return false; |
| 5217 | } |
| 5218 | |
| 5219 | return true; |
| 5220 | } |
| 5221 | |
| 5222 | VK_LAYER_EXPORT VkResult VKAPI vkGetRenderAreaGranularity( |
| 5223 | VkDevice device, |
| 5224 | VkRenderPass renderPass, |
| 5225 | VkExtent2D* pGranularity) |
| 5226 | { |
| 5227 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetRenderAreaGranularity(device, renderPass, pGranularity); |
| 5228 | |
| 5229 | PostGetRenderAreaGranularity(device, renderPass, pGranularity, result); |
| 5230 | |
| 5231 | return result; |
| 5232 | } |
| 5233 | |
| 5234 | bool PreCreateCommandPool( |
| 5235 | VkDevice device, |
| 5236 | const VkCmdPoolCreateInfo* pCreateInfo) |
| 5237 | { |
| 5238 | if(pCreateInfo != nullptr) |
| 5239 | { |
| 5240 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO) |
| 5241 | { |
| 5242 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 5243 | "vkCreateCommandPool parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
| 5244 | return false; |
| 5245 | } |
| 5246 | } |
| 5247 | |
| 5248 | return true; |
| 5249 | } |
| 5250 | |
| 5251 | bool PostCreateCommandPool( |
| 5252 | VkDevice device, |
| 5253 | VkCmdPool* pCmdPool, |
| 5254 | VkResult result) |
| 5255 | { |
| 5256 | |
| 5257 | if(pCmdPool != nullptr) |
| 5258 | { |
| 5259 | } |
| 5260 | |
| 5261 | if(result < VK_SUCCESS) |
| 5262 | { |
| 5263 | std::string reason = "vkCreateCommandPool parameter, VkResult result, is " + EnumeratorString(result); |
| 5264 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5265 | return false; |
| 5266 | } |
| 5267 | |
| 5268 | return true; |
| 5269 | } |
| 5270 | |
| 5271 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandPool( |
| 5272 | VkDevice device, |
| 5273 | const VkCmdPoolCreateInfo* pCreateInfo, |
| 5274 | VkCmdPool* pCmdPool) |
| 5275 | { |
| 5276 | PreCreateCommandPool(device, pCreateInfo); |
| 5277 | |
| 5278 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandPool(device, pCreateInfo, pCmdPool); |
| 5279 | |
| 5280 | PostCreateCommandPool(device, pCmdPool, result); |
| 5281 | |
| 5282 | return result; |
| 5283 | } |
| 5284 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5285 | bool PostResetCommandPool( |
| 5286 | VkDevice device, |
| 5287 | VkCmdPool cmdPool, |
| 5288 | VkCmdPoolResetFlags flags, |
| 5289 | VkResult result) |
| 5290 | { |
| 5291 | |
| 5292 | |
| 5293 | |
| 5294 | if(result < VK_SUCCESS) |
| 5295 | { |
| 5296 | std::string reason = "vkResetCommandPool parameter, VkResult result, is " + EnumeratorString(result); |
| 5297 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5298 | return false; |
| 5299 | } |
| 5300 | |
| 5301 | return true; |
| 5302 | } |
| 5303 | |
| 5304 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandPool( |
| 5305 | VkDevice device, |
| 5306 | VkCmdPool cmdPool, |
| 5307 | VkCmdPoolResetFlags flags) |
| 5308 | { |
| 5309 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetCommandPool(device, cmdPool, flags); |
| 5310 | |
| 5311 | PostResetCommandPool(device, cmdPool, flags, result); |
| 5312 | |
| 5313 | return result; |
| 5314 | } |
| 5315 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5316 | bool PreCreateCommandBuffer( |
| 5317 | VkDevice device, |
| 5318 | const VkCmdBufferCreateInfo* pCreateInfo) |
| 5319 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5320 | if(pCreateInfo != nullptr) |
| 5321 | { |
| 5322 | if(pCreateInfo->sType != VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5323 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5324 | 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] | 5325 | "vkCreateCommandBuffer parameter, VkStructureType pCreateInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5326 | return false; |
| 5327 | } |
| 5328 | if(pCreateInfo->level < VK_CMD_BUFFER_LEVEL_BEGIN_RANGE || |
| 5329 | pCreateInfo->level > VK_CMD_BUFFER_LEVEL_END_RANGE) |
| 5330 | { |
| 5331 | 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] | 5332 | "vkCreateCommandBuffer parameter, VkCmdBufferLevel pCreateInfo->level, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5333 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5334 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5335 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5336 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5337 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5338 | } |
| 5339 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5340 | bool PostCreateCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5341 | VkDevice device, |
| 5342 | VkCmdBuffer* pCmdBuffer, |
| 5343 | VkResult result) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5344 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5345 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5346 | if(pCmdBuffer != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5347 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5348 | } |
| 5349 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5350 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5351 | { |
| 5352 | std::string reason = "vkCreateCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5353 | log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5354 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5355 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5356 | |
| 5357 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5358 | } |
| 5359 | |
| 5360 | VK_LAYER_EXPORT VkResult VKAPI vkCreateCommandBuffer( |
| 5361 | VkDevice device, |
| 5362 | const VkCmdBufferCreateInfo* pCreateInfo, |
| 5363 | VkCmdBuffer* pCmdBuffer) |
| 5364 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5365 | PreCreateCommandBuffer(device, pCreateInfo); |
| 5366 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5367 | VkResult result = get_dispatch_table(pc_device_table_map, device)->CreateCommandBuffer(device, pCreateInfo, pCmdBuffer); |
| 5368 | |
| 5369 | PostCreateCommandBuffer(device, pCmdBuffer, result); |
| 5370 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5371 | return result; |
| 5372 | } |
| 5373 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5374 | bool PreBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5375 | VkCmdBuffer cmdBuffer, |
| 5376 | const VkCmdBufferBeginInfo* pBeginInfo) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5377 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5378 | if(pBeginInfo != nullptr) |
| 5379 | { |
| 5380 | if(pBeginInfo->sType != VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5381 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5382 | 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] | 5383 | "vkBeginCommandBuffer parameter, VkStructureType pBeginInfo->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5384 | return false; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5385 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5386 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5387 | |
| 5388 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5389 | } |
| 5390 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5391 | bool PostBeginCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5392 | VkCmdBuffer cmdBuffer, |
| 5393 | VkResult result) |
| 5394 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5395 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5396 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5397 | { |
| 5398 | std::string reason = "vkBeginCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5399 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5400 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5401 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5402 | |
| 5403 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5404 | } |
| 5405 | |
| 5406 | VK_LAYER_EXPORT VkResult VKAPI vkBeginCommandBuffer( |
| 5407 | VkCmdBuffer cmdBuffer, |
| 5408 | const VkCmdBufferBeginInfo* pBeginInfo) |
| 5409 | { |
| 5410 | PreBeginCommandBuffer(cmdBuffer, pBeginInfo); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5411 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5412 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->BeginCommandBuffer(cmdBuffer, pBeginInfo); |
| 5413 | |
| 5414 | PostBeginCommandBuffer(cmdBuffer, result); |
| 5415 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5416 | return result; |
| 5417 | } |
| 5418 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5419 | bool PostEndCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5420 | VkCmdBuffer cmdBuffer, |
| 5421 | VkResult result) |
| 5422 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5423 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5424 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5425 | { |
| 5426 | std::string reason = "vkEndCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5427 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5428 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5429 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5430 | |
| 5431 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5432 | } |
| 5433 | |
| 5434 | VK_LAYER_EXPORT VkResult VKAPI vkEndCommandBuffer( |
| 5435 | VkCmdBuffer cmdBuffer) |
| 5436 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5437 | VkResult result = get_dispatch_table(pc_device_table_map, cmdBuffer)->EndCommandBuffer(cmdBuffer); |
| 5438 | |
| 5439 | PostEndCommandBuffer(cmdBuffer, result); |
| 5440 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5441 | return result; |
| 5442 | } |
| 5443 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5444 | bool PostResetCommandBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5445 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5446 | VkCmdBufferResetFlags flags, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5447 | VkResult result) |
| 5448 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5449 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5450 | |
| 5451 | if(result < VK_SUCCESS) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5452 | { |
| 5453 | std::string reason = "vkResetCommandBuffer parameter, VkResult result, is " + EnumeratorString(result); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5454 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", reason.c_str()); |
| 5455 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5456 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5457 | |
| 5458 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5459 | } |
| 5460 | |
| 5461 | VK_LAYER_EXPORT VkResult VKAPI vkResetCommandBuffer( |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 5462 | VkCmdBuffer cmdBuffer, |
| 5463 | VkCmdBufferResetFlags flags) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5464 | { |
Courtney Goeltzenleuchter | ee5d80b | 2015-07-10 19:50:17 -0600 | [diff] [blame] | 5465 | 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] | 5466 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5467 | PostResetCommandBuffer(cmdBuffer, flags, result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5468 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5469 | return result; |
| 5470 | } |
| 5471 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5472 | bool PostCmdBindPipeline( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5473 | VkCmdBuffer cmdBuffer, |
| 5474 | VkPipelineBindPoint pipelineBindPoint, |
| 5475 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5476 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5477 | |
| 5478 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 5479 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 5480 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5481 | 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] | 5482 | "vkCmdBindPipeline parameter, VkPipelineBindPoint pipelineBindPoint, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5483 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5484 | } |
| 5485 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5486 | |
| 5487 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5488 | } |
| 5489 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5490 | VK_LAYER_EXPORT void VKAPI vkCmdBindPipeline( |
| 5491 | VkCmdBuffer cmdBuffer, |
| 5492 | VkPipelineBindPoint pipelineBindPoint, |
| 5493 | VkPipeline pipeline) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5494 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5495 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 5496 | |
| 5497 | PostCmdBindPipeline(cmdBuffer, pipelineBindPoint, pipeline); |
| 5498 | } |
| 5499 | |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5500 | VK_LAYER_EXPORT void VKAPI vkCmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportAndScissorCount, const VkViewport* pViewports, const VkRect2D* pScissors) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5501 | { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5502 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetViewport(cmdBuffer, viewportAndScissorCount, pViewports, pScissors); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5503 | } |
| 5504 | |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5505 | VK_LAYER_EXPORT void VKAPI vkCmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5506 | { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5507 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetLineWidth(cmdBuffer, lineWidth); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5508 | } |
| 5509 | |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5510 | VK_LAYER_EXPORT void VKAPI vkCmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5511 | { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5512 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetDepthBias(cmdBuffer, depthBias, depthBiasClamp, slopeScaledDepthBias); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5513 | } |
| 5514 | |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5515 | VK_LAYER_EXPORT void VKAPI vkCmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4]) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5516 | { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5517 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetBlendConstants(cmdBuffer, blendConst); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5518 | } |
| 5519 | |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5520 | VK_LAYER_EXPORT void VKAPI vkCmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5521 | { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5522 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetDepthBounds(cmdBuffer, minDepthBounds, maxDepthBounds); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5523 | } |
| 5524 | |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5525 | VK_LAYER_EXPORT void VKAPI vkCmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 5526 | { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5527 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetStencilCompareMask(cmdBuffer, faceMask, stencilCompareMask); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5528 | } |
| 5529 | |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5530 | VK_LAYER_EXPORT void VKAPI vkCmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5531 | { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5532 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetStencilWriteMask(cmdBuffer, faceMask, stencilWriteMask); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5533 | } |
| 5534 | |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5535 | VK_LAYER_EXPORT void VKAPI vkCmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5536 | { |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 5537 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetStencilReference(cmdBuffer, faceMask, stencilReference); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5538 | } |
| 5539 | |
| 5540 | bool PreCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5541 | VkCmdBuffer cmdBuffer, |
| 5542 | const VkDescriptorSet* pDescriptorSets, |
| 5543 | const uint32_t* pDynamicOffsets) |
| 5544 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5545 | if(pDescriptorSets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5546 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5547 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5548 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5549 | if(pDynamicOffsets != nullptr) |
| 5550 | { |
| 5551 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5552 | |
| 5553 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5554 | } |
| 5555 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5556 | bool PostCmdBindDescriptorSets( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5557 | VkCmdBuffer cmdBuffer, |
| 5558 | VkPipelineBindPoint pipelineBindPoint, |
| 5559 | VkPipelineLayout layout, |
| 5560 | uint32_t firstSet, |
| 5561 | uint32_t setCount, |
| 5562 | uint32_t dynamicOffsetCount) |
| 5563 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5564 | |
| 5565 | if(pipelineBindPoint < VK_PIPELINE_BIND_POINT_BEGIN_RANGE || |
| 5566 | pipelineBindPoint > VK_PIPELINE_BIND_POINT_END_RANGE) |
| 5567 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5568 | 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] | 5569 | "vkCmdBindDescriptorSets parameter, VkPipelineBindPoint pipelineBindPoint, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5570 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5571 | } |
| 5572 | |
| 5573 | |
| 5574 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5575 | |
| 5576 | |
| 5577 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5578 | } |
| 5579 | |
| 5580 | VK_LAYER_EXPORT void VKAPI vkCmdBindDescriptorSets( |
| 5581 | VkCmdBuffer cmdBuffer, |
| 5582 | VkPipelineBindPoint pipelineBindPoint, |
| 5583 | VkPipelineLayout layout, |
| 5584 | uint32_t firstSet, |
| 5585 | uint32_t setCount, |
| 5586 | const VkDescriptorSet* pDescriptorSets, |
| 5587 | uint32_t dynamicOffsetCount, |
| 5588 | const uint32_t* pDynamicOffsets) |
| 5589 | { |
| 5590 | PreCmdBindDescriptorSets(cmdBuffer, pDescriptorSets, pDynamicOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5591 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5592 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
| 5593 | |
| 5594 | PostCmdBindDescriptorSets(cmdBuffer, pipelineBindPoint, layout, firstSet, setCount, dynamicOffsetCount); |
| 5595 | } |
| 5596 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5597 | bool PostCmdBindIndexBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5598 | VkCmdBuffer cmdBuffer, |
| 5599 | VkBuffer buffer, |
| 5600 | VkDeviceSize offset, |
| 5601 | VkIndexType indexType) |
| 5602 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5603 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5604 | |
| 5605 | |
| 5606 | if(indexType < VK_INDEX_TYPE_BEGIN_RANGE || |
| 5607 | indexType > VK_INDEX_TYPE_END_RANGE) |
| 5608 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5609 | 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] | 5610 | "vkCmdBindIndexBuffer parameter, VkIndexType indexType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5611 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5612 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5613 | |
| 5614 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5615 | } |
| 5616 | |
| 5617 | VK_LAYER_EXPORT void VKAPI vkCmdBindIndexBuffer( |
| 5618 | VkCmdBuffer cmdBuffer, |
| 5619 | VkBuffer buffer, |
| 5620 | VkDeviceSize offset, |
| 5621 | VkIndexType indexType) |
| 5622 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5623 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 5624 | |
| 5625 | PostCmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType); |
| 5626 | } |
| 5627 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5628 | bool PreCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5629 | VkCmdBuffer cmdBuffer, |
| 5630 | const VkBuffer* pBuffers, |
| 5631 | const VkDeviceSize* pOffsets) |
| 5632 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5633 | if(pBuffers != nullptr) |
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 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5637 | if(pOffsets != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5638 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5639 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5640 | |
| 5641 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5642 | } |
| 5643 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5644 | bool PostCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5645 | VkCmdBuffer cmdBuffer, |
| 5646 | uint32_t startBinding, |
| 5647 | uint32_t bindingCount) |
| 5648 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5649 | |
| 5650 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5651 | |
| 5652 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5653 | } |
| 5654 | |
Courtney Goeltzenleuchter | f68ad72 | 2015-04-16 13:38:46 -0600 | [diff] [blame] | 5655 | VK_LAYER_EXPORT void VKAPI vkCmdBindVertexBuffers( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5656 | VkCmdBuffer cmdBuffer, |
| 5657 | uint32_t startBinding, |
| 5658 | uint32_t bindingCount, |
| 5659 | const VkBuffer* pBuffers, |
| 5660 | const VkDeviceSize* pOffsets) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5661 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5662 | PreCmdBindVertexBuffers(cmdBuffer, pBuffers, pOffsets); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5663 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5664 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount, pBuffers, pOffsets); |
| 5665 | |
| 5666 | PostCmdBindVertexBuffers(cmdBuffer, startBinding, bindingCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5667 | } |
| 5668 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5669 | bool PostCmdDraw( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5670 | VkCmdBuffer cmdBuffer, |
| 5671 | uint32_t firstVertex, |
| 5672 | uint32_t vertexCount, |
| 5673 | uint32_t firstInstance, |
| 5674 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5675 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5676 | |
| 5677 | |
| 5678 | |
| 5679 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5680 | |
| 5681 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5682 | } |
| 5683 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5684 | VK_LAYER_EXPORT void VKAPI vkCmdDraw( |
| 5685 | VkCmdBuffer cmdBuffer, |
| 5686 | uint32_t firstVertex, |
| 5687 | uint32_t vertexCount, |
| 5688 | uint32_t firstInstance, |
| 5689 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5690 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5691 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
| 5692 | |
| 5693 | PostCmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5694 | } |
| 5695 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5696 | bool PostCmdDrawIndexed( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5697 | VkCmdBuffer cmdBuffer, |
| 5698 | uint32_t firstIndex, |
| 5699 | uint32_t indexCount, |
| 5700 | int32_t vertexOffset, |
| 5701 | uint32_t firstInstance, |
| 5702 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5703 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5704 | |
| 5705 | |
| 5706 | |
| 5707 | |
| 5708 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5709 | |
| 5710 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5711 | } |
| 5712 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5713 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexed( |
| 5714 | VkCmdBuffer cmdBuffer, |
| 5715 | uint32_t firstIndex, |
| 5716 | uint32_t indexCount, |
| 5717 | int32_t vertexOffset, |
| 5718 | uint32_t firstInstance, |
| 5719 | uint32_t instanceCount) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5720 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5721 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 5722 | |
| 5723 | PostCmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount); |
| 5724 | } |
| 5725 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5726 | bool PostCmdDrawIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5727 | VkCmdBuffer cmdBuffer, |
| 5728 | VkBuffer buffer, |
| 5729 | VkDeviceSize offset, |
| 5730 | uint32_t count, |
| 5731 | uint32_t stride) |
| 5732 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5733 | |
| 5734 | |
| 5735 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5736 | |
| 5737 | |
| 5738 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5739 | } |
| 5740 | |
| 5741 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndirect( |
| 5742 | VkCmdBuffer cmdBuffer, |
| 5743 | VkBuffer buffer, |
| 5744 | VkDeviceSize offset, |
| 5745 | uint32_t count, |
| 5746 | uint32_t stride) |
| 5747 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5748 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 5749 | |
| 5750 | PostCmdDrawIndirect(cmdBuffer, buffer, offset, count, stride); |
| 5751 | } |
| 5752 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5753 | bool PostCmdDrawIndexedIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5754 | VkCmdBuffer cmdBuffer, |
| 5755 | VkBuffer buffer, |
| 5756 | VkDeviceSize offset, |
| 5757 | uint32_t count, |
| 5758 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5759 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5760 | |
| 5761 | |
| 5762 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5763 | |
| 5764 | |
| 5765 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5766 | } |
| 5767 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5768 | VK_LAYER_EXPORT void VKAPI vkCmdDrawIndexedIndirect( |
| 5769 | VkCmdBuffer cmdBuffer, |
| 5770 | VkBuffer buffer, |
| 5771 | VkDeviceSize offset, |
| 5772 | uint32_t count, |
| 5773 | uint32_t stride) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5774 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5775 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 5776 | |
| 5777 | PostCmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride); |
| 5778 | } |
| 5779 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5780 | bool PostCmdDispatch( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5781 | VkCmdBuffer cmdBuffer, |
| 5782 | uint32_t x, |
| 5783 | uint32_t y, |
| 5784 | uint32_t z) |
| 5785 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5786 | |
| 5787 | |
| 5788 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5789 | |
| 5790 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5791 | } |
| 5792 | |
| 5793 | VK_LAYER_EXPORT void VKAPI vkCmdDispatch( |
| 5794 | VkCmdBuffer cmdBuffer, |
| 5795 | uint32_t x, |
| 5796 | uint32_t y, |
| 5797 | uint32_t z) |
| 5798 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5799 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatch(cmdBuffer, x, y, z); |
| 5800 | |
| 5801 | PostCmdDispatch(cmdBuffer, x, y, z); |
| 5802 | } |
| 5803 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5804 | bool PostCmdDispatchIndirect( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5805 | VkCmdBuffer cmdBuffer, |
| 5806 | VkBuffer buffer, |
| 5807 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5808 | { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5809 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5810 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5811 | |
| 5812 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5813 | } |
| 5814 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5815 | VK_LAYER_EXPORT void VKAPI vkCmdDispatchIndirect( |
| 5816 | VkCmdBuffer cmdBuffer, |
| 5817 | VkBuffer buffer, |
| 5818 | VkDeviceSize offset) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5819 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5820 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdDispatchIndirect(cmdBuffer, buffer, offset); |
| 5821 | |
| 5822 | PostCmdDispatchIndirect(cmdBuffer, buffer, offset); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5823 | } |
| 5824 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5825 | bool PreCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5826 | VkCmdBuffer cmdBuffer, |
| 5827 | const VkBufferCopy* pRegions) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5828 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5829 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5830 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5831 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5832 | |
| 5833 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5834 | } |
| 5835 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5836 | bool PostCmdCopyBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5837 | VkCmdBuffer cmdBuffer, |
| 5838 | VkBuffer srcBuffer, |
| 5839 | VkBuffer destBuffer, |
| 5840 | uint32_t regionCount) |
| 5841 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5842 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5843 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5844 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5845 | |
| 5846 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5847 | } |
| 5848 | |
| 5849 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBuffer( |
| 5850 | VkCmdBuffer cmdBuffer, |
| 5851 | VkBuffer srcBuffer, |
| 5852 | VkBuffer destBuffer, |
| 5853 | uint32_t regionCount, |
| 5854 | const VkBufferCopy* pRegions) |
| 5855 | { |
| 5856 | PreCmdCopyBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5857 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5858 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions); |
| 5859 | |
| 5860 | PostCmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount); |
| 5861 | } |
| 5862 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5863 | bool PreCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5864 | VkCmdBuffer cmdBuffer, |
| 5865 | const VkImageCopy* pRegions) |
| 5866 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5867 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5868 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5869 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 5870 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 5871 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5872 | 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] | 5873 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5874 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5875 | } |
| 5876 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 5877 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 5878 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5879 | 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] | 5880 | "vkCmdCopyImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5881 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5882 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5883 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5884 | |
| 5885 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5886 | } |
| 5887 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5888 | bool PostCmdCopyImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5889 | VkCmdBuffer cmdBuffer, |
| 5890 | VkImage srcImage, |
| 5891 | VkImageLayout srcImageLayout, |
| 5892 | VkImage destImage, |
| 5893 | VkImageLayout destImageLayout, |
| 5894 | uint32_t regionCount) |
| 5895 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5896 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5897 | |
| 5898 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5899 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5900 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5901 | 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] | 5902 | "vkCmdCopyImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5903 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5904 | } |
| 5905 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5906 | |
| 5907 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5908 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5909 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5910 | 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] | 5911 | "vkCmdCopyImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5912 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5913 | } |
| 5914 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5915 | |
| 5916 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5917 | } |
| 5918 | |
| 5919 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImage( |
| 5920 | VkCmdBuffer cmdBuffer, |
| 5921 | VkImage srcImage, |
| 5922 | VkImageLayout srcImageLayout, |
| 5923 | VkImage destImage, |
| 5924 | VkImageLayout destImageLayout, |
| 5925 | uint32_t regionCount, |
| 5926 | const VkImageCopy* pRegions) |
| 5927 | { |
| 5928 | PreCmdCopyImage(cmdBuffer, pRegions); |
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 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 5931 | |
| 5932 | PostCmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 5933 | } |
| 5934 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5935 | bool PreCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5936 | VkCmdBuffer cmdBuffer, |
| 5937 | const VkImageBlit* pRegions) |
| 5938 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5939 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5940 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5941 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 5942 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 5943 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5944 | 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] | 5945 | "vkCmdBlitImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5946 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5947 | } |
| 5948 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 5949 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 5950 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5951 | 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] | 5952 | "vkCmdBlitImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5953 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5954 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5955 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5956 | |
| 5957 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5958 | } |
| 5959 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5960 | bool PostCmdBlitImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5961 | VkCmdBuffer cmdBuffer, |
| 5962 | VkImage srcImage, |
| 5963 | VkImageLayout srcImageLayout, |
| 5964 | VkImage destImage, |
| 5965 | VkImageLayout destImageLayout, |
| 5966 | uint32_t regionCount, |
| 5967 | VkTexFilter filter) |
| 5968 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5969 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5970 | |
| 5971 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5972 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5973 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5974 | 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] | 5975 | "vkCmdBlitImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5976 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5977 | } |
| 5978 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5979 | |
| 5980 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 5981 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 5982 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5983 | 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] | 5984 | "vkCmdBlitImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5985 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5986 | } |
| 5987 | |
| 5988 | |
| 5989 | if(filter < VK_TEX_FILTER_BEGIN_RANGE || |
| 5990 | filter > VK_TEX_FILTER_END_RANGE) |
| 5991 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5992 | 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] | 5993 | "vkCmdBlitImage parameter, VkTexFilter filter, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5994 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5995 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5996 | |
| 5997 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5998 | } |
| 5999 | |
| 6000 | VK_LAYER_EXPORT void VKAPI vkCmdBlitImage( |
| 6001 | VkCmdBuffer cmdBuffer, |
| 6002 | VkImage srcImage, |
| 6003 | VkImageLayout srcImageLayout, |
| 6004 | VkImage destImage, |
| 6005 | VkImageLayout destImageLayout, |
| 6006 | uint32_t regionCount, |
| 6007 | const VkImageBlit* pRegions, |
| 6008 | VkTexFilter filter) |
| 6009 | { |
| 6010 | PreCmdBlitImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6011 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6012 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter); |
| 6013 | |
| 6014 | PostCmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, filter); |
| 6015 | } |
| 6016 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6017 | bool PreCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6018 | VkCmdBuffer cmdBuffer, |
| 6019 | const VkBufferImageCopy* pRegions) |
| 6020 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6021 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6022 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6023 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6024 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6025 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6026 | 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] | 6027 | "vkCmdCopyBufferToImage parameter, VkImageAspect pRegions->imageSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6028 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6029 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6030 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6031 | |
| 6032 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6033 | } |
| 6034 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6035 | bool PostCmdCopyBufferToImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6036 | VkCmdBuffer cmdBuffer, |
| 6037 | VkBuffer srcBuffer, |
| 6038 | VkImage destImage, |
| 6039 | VkImageLayout destImageLayout, |
| 6040 | uint32_t regionCount) |
| 6041 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6042 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6043 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6044 | |
| 6045 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6046 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6047 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6048 | 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] | 6049 | "vkCmdCopyBufferToImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6050 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6051 | } |
| 6052 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6053 | |
| 6054 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6055 | } |
| 6056 | |
| 6057 | VK_LAYER_EXPORT void VKAPI vkCmdCopyBufferToImage( |
| 6058 | VkCmdBuffer cmdBuffer, |
| 6059 | VkBuffer srcBuffer, |
| 6060 | VkImage destImage, |
| 6061 | VkImageLayout destImageLayout, |
| 6062 | uint32_t regionCount, |
| 6063 | const VkBufferImageCopy* pRegions) |
| 6064 | { |
| 6065 | PreCmdCopyBufferToImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6066 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6067 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions); |
| 6068 | |
| 6069 | PostCmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount); |
| 6070 | } |
| 6071 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6072 | bool PreCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6073 | VkCmdBuffer cmdBuffer, |
| 6074 | const VkBufferImageCopy* pRegions) |
| 6075 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6076 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6077 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6078 | if(pRegions->imageSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6079 | pRegions->imageSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6080 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6081 | 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] | 6082 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6083 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6084 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6085 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6086 | |
| 6087 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6088 | } |
| 6089 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6090 | bool PostCmdCopyImageToBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6091 | VkCmdBuffer cmdBuffer, |
| 6092 | VkImage srcImage, |
| 6093 | VkImageLayout srcImageLayout, |
| 6094 | VkBuffer destBuffer, |
| 6095 | uint32_t regionCount) |
| 6096 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6097 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6098 | |
| 6099 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6100 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6101 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6102 | 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] | 6103 | "vkCmdCopyImageToBuffer parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6104 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6105 | } |
| 6106 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6107 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6108 | |
| 6109 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6110 | } |
| 6111 | |
| 6112 | VK_LAYER_EXPORT void VKAPI vkCmdCopyImageToBuffer( |
| 6113 | VkCmdBuffer cmdBuffer, |
| 6114 | VkImage srcImage, |
| 6115 | VkImageLayout srcImageLayout, |
| 6116 | VkBuffer destBuffer, |
| 6117 | uint32_t regionCount, |
| 6118 | const VkBufferImageCopy* pRegions) |
| 6119 | { |
| 6120 | PreCmdCopyImageToBuffer(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6121 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6122 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions); |
| 6123 | |
| 6124 | PostCmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount); |
| 6125 | } |
| 6126 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6127 | bool PreCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6128 | VkCmdBuffer cmdBuffer, |
| 6129 | const uint32_t* pData) |
| 6130 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6131 | if(pData != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6132 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6133 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6134 | |
| 6135 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6136 | } |
| 6137 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6138 | bool PostCmdUpdateBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6139 | VkCmdBuffer cmdBuffer, |
| 6140 | VkBuffer destBuffer, |
| 6141 | VkDeviceSize destOffset, |
| 6142 | VkDeviceSize dataSize) |
| 6143 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6144 | |
| 6145 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6146 | |
| 6147 | |
| 6148 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6149 | } |
| 6150 | |
| 6151 | VK_LAYER_EXPORT void VKAPI vkCmdUpdateBuffer( |
| 6152 | VkCmdBuffer cmdBuffer, |
| 6153 | VkBuffer destBuffer, |
| 6154 | VkDeviceSize destOffset, |
| 6155 | VkDeviceSize dataSize, |
| 6156 | const uint32_t* pData) |
| 6157 | { |
| 6158 | PreCmdUpdateBuffer(cmdBuffer, pData); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6159 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6160 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData); |
| 6161 | |
| 6162 | PostCmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize); |
| 6163 | } |
| 6164 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6165 | bool PostCmdFillBuffer( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6166 | VkCmdBuffer cmdBuffer, |
| 6167 | VkBuffer destBuffer, |
| 6168 | VkDeviceSize destOffset, |
| 6169 | VkDeviceSize fillSize, |
| 6170 | uint32_t data) |
| 6171 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6172 | |
| 6173 | |
| 6174 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6175 | |
| 6176 | |
| 6177 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6178 | } |
| 6179 | |
| 6180 | VK_LAYER_EXPORT void VKAPI vkCmdFillBuffer( |
| 6181 | VkCmdBuffer cmdBuffer, |
| 6182 | VkBuffer destBuffer, |
| 6183 | VkDeviceSize destOffset, |
| 6184 | VkDeviceSize fillSize, |
| 6185 | uint32_t data) |
| 6186 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6187 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 6188 | |
| 6189 | PostCmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data); |
| 6190 | } |
| 6191 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6192 | bool PreCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6193 | VkCmdBuffer cmdBuffer, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 6194 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6195 | const VkImageSubresourceRange* pRanges) |
| 6196 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6197 | if(pColor != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6198 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6199 | } |
| 6200 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6201 | if(pRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6202 | { |
Courtney Goeltzenleuchter | ba72451 | 2015-09-10 17:58:54 -0600 | [diff] [blame] | 6203 | /* TODO: How should we validate pRanges->aspectMask */ |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6204 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6205 | |
| 6206 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6207 | } |
| 6208 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6209 | bool PostCmdClearColorImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6210 | VkCmdBuffer cmdBuffer, |
| 6211 | VkImage image, |
| 6212 | VkImageLayout imageLayout, |
| 6213 | uint32_t rangeCount) |
| 6214 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6215 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6216 | |
| 6217 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6218 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6219 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6220 | 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] | 6221 | "vkCmdClearColorImage parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6222 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6223 | } |
| 6224 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6225 | |
| 6226 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6227 | } |
| 6228 | |
| 6229 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorImage( |
| 6230 | VkCmdBuffer cmdBuffer, |
| 6231 | VkImage image, |
| 6232 | VkImageLayout imageLayout, |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 6233 | const VkClearColorValue* pColor, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6234 | uint32_t rangeCount, |
| 6235 | const VkImageSubresourceRange* pRanges) |
| 6236 | { |
| 6237 | PreCmdClearColorImage(cmdBuffer, pColor, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6238 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6239 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
| 6240 | |
| 6241 | PostCmdClearColorImage(cmdBuffer, image, imageLayout, rangeCount); |
| 6242 | } |
| 6243 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6244 | bool PreCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6245 | VkCmdBuffer cmdBuffer, |
| 6246 | const VkImageSubresourceRange* pRanges) |
| 6247 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6248 | if(pRanges != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6249 | { |
Courtney Goeltzenleuchter | ba72451 | 2015-09-10 17:58:54 -0600 | [diff] [blame] | 6250 | /* |
| 6251 | * TODO: How do we validation pRanges->aspectMask? |
| 6252 | * Allows values are: VK_IMAGE_ASPECT_DEPTH_BIT and |
| 6253 | * VK_IMAGE_ASPECT_STENCIL_BIT. |
| 6254 | */ |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6255 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6256 | |
| 6257 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6258 | } |
| 6259 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6260 | bool PostCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6261 | VkCmdBuffer cmdBuffer, |
| 6262 | VkImage image, |
| 6263 | VkImageLayout imageLayout, |
Courtney Goeltzenleuchter | 45df9e1 | 2015-09-15 18:03:22 -0600 | [diff] [blame] | 6264 | const VkClearDepthStencilValue* pDepthStencil, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6265 | uint32_t rangeCount) |
| 6266 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6267 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6268 | |
| 6269 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6270 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6271 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6272 | 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] | 6273 | "vkCmdClearDepthStencilImage parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6274 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6275 | } |
| 6276 | |
| 6277 | |
| 6278 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6279 | |
| 6280 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6281 | } |
| 6282 | |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 6283 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6284 | VkCmdBuffer cmdBuffer, |
| 6285 | VkImage image, |
| 6286 | VkImageLayout imageLayout, |
Courtney Goeltzenleuchter | 45df9e1 | 2015-09-15 18:03:22 -0600 | [diff] [blame] | 6287 | const VkClearDepthStencilValue* pDepthStencil, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6288 | uint32_t rangeCount, |
| 6289 | const VkImageSubresourceRange* pRanges) |
| 6290 | { |
Chris Forbes | d9be82b | 2015-06-22 17:21:59 +1200 | [diff] [blame] | 6291 | PreCmdClearDepthStencilImage(cmdBuffer, pRanges); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6292 | |
Courtney Goeltzenleuchter | 45df9e1 | 2015-09-15 18:03:22 -0600 | [diff] [blame] | 6293 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6294 | |
Courtney Goeltzenleuchter | 45df9e1 | 2015-09-15 18:03:22 -0600 | [diff] [blame] | 6295 | PostCmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6296 | } |
| 6297 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6298 | bool PreCmdClearColorAttachment( |
| 6299 | VkCmdBuffer cmdBuffer, |
| 6300 | const VkClearColorValue* pColor, |
| 6301 | const VkRect3D* pRects) |
| 6302 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6303 | if(pColor != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6304 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6305 | } |
| 6306 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6307 | if(pRects != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6308 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6309 | } |
| 6310 | |
| 6311 | return true; |
| 6312 | } |
| 6313 | |
| 6314 | bool PostCmdClearColorAttachment( |
| 6315 | VkCmdBuffer cmdBuffer, |
| 6316 | uint32_t colorAttachment, |
| 6317 | VkImageLayout imageLayout, |
| 6318 | uint32_t rectCount) |
| 6319 | { |
| 6320 | |
| 6321 | |
| 6322 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6323 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6324 | { |
| 6325 | 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] | 6326 | "vkCmdClearColorAttachment parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6327 | return false; |
| 6328 | } |
| 6329 | |
| 6330 | |
| 6331 | return true; |
| 6332 | } |
| 6333 | |
| 6334 | VK_LAYER_EXPORT void VKAPI vkCmdClearColorAttachment( |
| 6335 | VkCmdBuffer cmdBuffer, |
| 6336 | uint32_t colorAttachment, |
| 6337 | VkImageLayout imageLayout, |
| 6338 | const VkClearColorValue* pColor, |
| 6339 | uint32_t rectCount, |
| 6340 | const VkRect3D* pRects) |
| 6341 | { |
| 6342 | PreCmdClearColorAttachment(cmdBuffer, pColor, pRects); |
| 6343 | |
| 6344 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects); |
| 6345 | |
| 6346 | PostCmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, rectCount); |
| 6347 | } |
| 6348 | |
| 6349 | bool PreCmdClearDepthStencilAttachment( |
| 6350 | VkCmdBuffer cmdBuffer, |
| 6351 | const VkRect3D* pRects) |
| 6352 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6353 | if(pRects != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6354 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6355 | } |
| 6356 | |
| 6357 | return true; |
| 6358 | } |
| 6359 | |
| 6360 | bool PostCmdClearDepthStencilAttachment( |
| 6361 | VkCmdBuffer cmdBuffer, |
| 6362 | VkImageAspectFlags imageAspectMask, |
| 6363 | VkImageLayout imageLayout, |
Courtney Goeltzenleuchter | 45df9e1 | 2015-09-15 18:03:22 -0600 | [diff] [blame] | 6364 | const VkClearDepthStencilValue* pDepthStencil, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6365 | uint32_t rectCount) |
| 6366 | { |
| 6367 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6368 | |
| 6369 | if(imageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6370 | imageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6371 | { |
| 6372 | 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] | 6373 | "vkCmdClearDepthStencilAttachment parameter, VkImageLayout imageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6374 | return false; |
| 6375 | } |
| 6376 | |
| 6377 | |
| 6378 | |
| 6379 | |
| 6380 | return true; |
| 6381 | } |
| 6382 | |
| 6383 | VK_LAYER_EXPORT void VKAPI vkCmdClearDepthStencilAttachment( |
| 6384 | VkCmdBuffer cmdBuffer, |
| 6385 | VkImageAspectFlags imageAspectMask, |
| 6386 | VkImageLayout imageLayout, |
Courtney Goeltzenleuchter | 45df9e1 | 2015-09-15 18:03:22 -0600 | [diff] [blame] | 6387 | const VkClearDepthStencilValue* pDepthStencil, |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6388 | uint32_t rectCount, |
| 6389 | const VkRect3D* pRects) |
| 6390 | { |
| 6391 | PreCmdClearDepthStencilAttachment(cmdBuffer, pRects); |
| 6392 | |
Courtney Goeltzenleuchter | 45df9e1 | 2015-09-15 18:03:22 -0600 | [diff] [blame] | 6393 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6394 | |
Courtney Goeltzenleuchter | 45df9e1 | 2015-09-15 18:03:22 -0600 | [diff] [blame] | 6395 | PostCmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6396 | } |
| 6397 | |
| 6398 | bool PreCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6399 | VkCmdBuffer cmdBuffer, |
| 6400 | const VkImageResolve* pRegions) |
| 6401 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6402 | if(pRegions != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6403 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6404 | if(pRegions->srcSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6405 | pRegions->srcSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6406 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6407 | 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] | 6408 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6409 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6410 | } |
| 6411 | if(pRegions->destSubresource.aspect < VK_IMAGE_ASPECT_BEGIN_RANGE || |
| 6412 | pRegions->destSubresource.aspect > VK_IMAGE_ASPECT_END_RANGE) |
| 6413 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6414 | 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] | 6415 | "vkCmdResolveImage parameter, VkImageAspect pRegions->destSubresource.aspect, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6416 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6417 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6418 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6419 | |
| 6420 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6421 | } |
| 6422 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6423 | bool PostCmdResolveImage( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6424 | VkCmdBuffer cmdBuffer, |
| 6425 | VkImage srcImage, |
| 6426 | VkImageLayout srcImageLayout, |
| 6427 | VkImage destImage, |
| 6428 | VkImageLayout destImageLayout, |
| 6429 | uint32_t regionCount) |
| 6430 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6431 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6432 | |
| 6433 | if(srcImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6434 | srcImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6435 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6436 | 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] | 6437 | "vkCmdResolveImage parameter, VkImageLayout srcImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6438 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6439 | } |
| 6440 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6441 | |
| 6442 | if(destImageLayout < VK_IMAGE_LAYOUT_BEGIN_RANGE || |
| 6443 | destImageLayout > VK_IMAGE_LAYOUT_END_RANGE) |
| 6444 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6445 | 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] | 6446 | "vkCmdResolveImage parameter, VkImageLayout destImageLayout, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6447 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6448 | } |
| 6449 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6450 | |
| 6451 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6452 | } |
| 6453 | |
| 6454 | VK_LAYER_EXPORT void VKAPI vkCmdResolveImage( |
| 6455 | VkCmdBuffer cmdBuffer, |
| 6456 | VkImage srcImage, |
| 6457 | VkImageLayout srcImageLayout, |
| 6458 | VkImage destImage, |
| 6459 | VkImageLayout destImageLayout, |
| 6460 | uint32_t regionCount, |
| 6461 | const VkImageResolve* pRegions) |
| 6462 | { |
| 6463 | PreCmdResolveImage(cmdBuffer, pRegions); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6464 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6465 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions); |
| 6466 | |
| 6467 | PostCmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount); |
| 6468 | } |
| 6469 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6470 | bool PostCmdSetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6471 | VkCmdBuffer cmdBuffer, |
| 6472 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6473 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6474 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6475 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6476 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6477 | |
| 6478 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6479 | } |
| 6480 | |
| 6481 | VK_LAYER_EXPORT void VKAPI vkCmdSetEvent( |
| 6482 | VkCmdBuffer cmdBuffer, |
| 6483 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6484 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6485 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6486 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6487 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6488 | PostCmdSetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6489 | } |
| 6490 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6491 | bool PostCmdResetEvent( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6492 | VkCmdBuffer cmdBuffer, |
| 6493 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6494 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6495 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6496 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6497 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6498 | |
| 6499 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6500 | } |
| 6501 | |
| 6502 | VK_LAYER_EXPORT void VKAPI vkCmdResetEvent( |
| 6503 | VkCmdBuffer cmdBuffer, |
| 6504 | VkEvent event, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6505 | VkPipelineStageFlags stageMask) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6506 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6507 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6508 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6509 | PostCmdResetEvent(cmdBuffer, event, stageMask); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6510 | } |
| 6511 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6512 | bool PreCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6513 | VkCmdBuffer cmdBuffer, |
| 6514 | const VkEvent* pEvents, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 6515 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6516 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6517 | if(pEvents != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6518 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6519 | } |
| 6520 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6521 | if(ppMemBarriers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6522 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6523 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6524 | |
| 6525 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6526 | } |
| 6527 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6528 | bool PostCmdWaitEvents( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6529 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6530 | uint32_t eventCount, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6531 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6532 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6533 | uint32_t memBarrierCount) |
| 6534 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6535 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6536 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6537 | |
| 6538 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6539 | |
| 6540 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6541 | } |
| 6542 | |
| 6543 | VK_LAYER_EXPORT void VKAPI vkCmdWaitEvents( |
| 6544 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6545 | uint32_t eventCount, |
| 6546 | const VkEvent* pEvents, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6547 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6548 | VkPipelineStageFlags destStageMask, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6549 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | dbd2032 | 2015-07-12 12:58:58 -0600 | [diff] [blame] | 6550 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6551 | { |
| 6552 | PreCmdWaitEvents(cmdBuffer, pEvents, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6553 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6554 | 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] | 6555 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6556 | PostCmdWaitEvents(cmdBuffer, eventCount, srcStageMask, destStageMask, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6557 | } |
| 6558 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6559 | bool PreCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6560 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 6561 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6562 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6563 | if(ppMemBarriers != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6564 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6565 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6566 | |
| 6567 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6568 | } |
| 6569 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6570 | bool PostCmdPipelineBarrier( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6571 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 6572 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6573 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 6574 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6575 | uint32_t memBarrierCount) |
| 6576 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6577 | |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6578 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6579 | |
| 6580 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6581 | |
| 6582 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6583 | } |
| 6584 | |
| 6585 | VK_LAYER_EXPORT void VKAPI vkCmdPipelineBarrier( |
| 6586 | VkCmdBuffer cmdBuffer, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 6587 | VkPipelineStageFlags srcStageMask, |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6588 | VkPipelineStageFlags destStageMask, |
Courtney Goeltzenleuchter | cd2a099 | 2015-07-09 11:44:38 -0600 | [diff] [blame] | 6589 | VkBool32 byRegion, |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6590 | uint32_t memBarrierCount, |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 6591 | const void* const* ppMemBarriers) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6592 | { |
Tony Barbour | 0b2cfb2 | 2015-06-29 16:20:35 -0600 | [diff] [blame] | 6593 | PreCmdPipelineBarrier(cmdBuffer, ppMemBarriers); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6594 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 6595 | 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] | 6596 | |
Courtney Goeltzenleuchter | ceebbb1 | 2015-07-12 13:07:46 -0600 | [diff] [blame] | 6597 | PostCmdPipelineBarrier(cmdBuffer, srcStageMask, destStageMask, byRegion, memBarrierCount); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6598 | } |
| 6599 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6600 | bool PostCmdBeginQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6601 | VkCmdBuffer cmdBuffer, |
| 6602 | VkQueryPool queryPool, |
| 6603 | uint32_t slot, |
| 6604 | VkQueryControlFlags flags) |
| 6605 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6606 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6607 | |
| 6608 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6609 | |
| 6610 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6611 | } |
| 6612 | |
| 6613 | VK_LAYER_EXPORT void VKAPI vkCmdBeginQuery( |
| 6614 | VkCmdBuffer cmdBuffer, |
| 6615 | VkQueryPool queryPool, |
| 6616 | uint32_t slot, |
| 6617 | VkQueryControlFlags flags) |
| 6618 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6619 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 6620 | |
| 6621 | PostCmdBeginQuery(cmdBuffer, queryPool, slot, flags); |
| 6622 | } |
| 6623 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6624 | bool PostCmdEndQuery( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6625 | VkCmdBuffer cmdBuffer, |
| 6626 | VkQueryPool queryPool, |
| 6627 | uint32_t slot) |
| 6628 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6629 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6630 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6631 | |
| 6632 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6633 | } |
| 6634 | |
| 6635 | VK_LAYER_EXPORT void VKAPI vkCmdEndQuery( |
| 6636 | VkCmdBuffer cmdBuffer, |
| 6637 | VkQueryPool queryPool, |
| 6638 | uint32_t slot) |
| 6639 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6640 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndQuery(cmdBuffer, queryPool, slot); |
| 6641 | |
| 6642 | PostCmdEndQuery(cmdBuffer, queryPool, slot); |
| 6643 | } |
| 6644 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6645 | bool PostCmdResetQueryPool( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6646 | VkCmdBuffer cmdBuffer, |
| 6647 | VkQueryPool queryPool, |
| 6648 | uint32_t startQuery, |
| 6649 | uint32_t queryCount) |
| 6650 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6651 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6652 | |
| 6653 | |
| 6654 | |
| 6655 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6656 | } |
| 6657 | |
| 6658 | VK_LAYER_EXPORT void VKAPI vkCmdResetQueryPool( |
| 6659 | VkCmdBuffer cmdBuffer, |
| 6660 | VkQueryPool queryPool, |
| 6661 | uint32_t startQuery, |
| 6662 | uint32_t queryCount) |
| 6663 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6664 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 6665 | |
| 6666 | PostCmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount); |
| 6667 | } |
| 6668 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6669 | bool PostCmdWriteTimestamp( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6670 | VkCmdBuffer cmdBuffer, |
| 6671 | VkTimestampType timestampType, |
| 6672 | VkBuffer destBuffer, |
| 6673 | VkDeviceSize destOffset) |
| 6674 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6675 | |
| 6676 | if(timestampType < VK_TIMESTAMP_TYPE_BEGIN_RANGE || |
| 6677 | timestampType > VK_TIMESTAMP_TYPE_END_RANGE) |
| 6678 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6679 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6680 | "vkCmdWriteTimestamp parameter, VkTimestampType timestampType, is an unrecognized enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6681 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6682 | } |
| 6683 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6684 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6685 | |
| 6686 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6687 | } |
| 6688 | |
| 6689 | VK_LAYER_EXPORT void VKAPI vkCmdWriteTimestamp( |
| 6690 | VkCmdBuffer cmdBuffer, |
| 6691 | VkTimestampType timestampType, |
| 6692 | VkBuffer destBuffer, |
| 6693 | VkDeviceSize destOffset) |
| 6694 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6695 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 6696 | |
| 6697 | PostCmdWriteTimestamp(cmdBuffer, timestampType, destBuffer, destOffset); |
| 6698 | } |
| 6699 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6700 | bool PostCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6701 | VkCmdBuffer cmdBuffer, |
| 6702 | VkQueryPool queryPool, |
| 6703 | uint32_t startQuery, |
| 6704 | uint32_t queryCount, |
| 6705 | VkBuffer destBuffer, |
| 6706 | VkDeviceSize destOffset, |
| 6707 | VkDeviceSize destStride, |
| 6708 | VkQueryResultFlags flags) |
| 6709 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6710 | |
| 6711 | |
| 6712 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6713 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6714 | |
| 6715 | |
| 6716 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6717 | |
| 6718 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6719 | } |
| 6720 | |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 6721 | VK_LAYER_EXPORT void VKAPI vkCmdCopyQueryPoolResults( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6722 | VkCmdBuffer cmdBuffer, |
| 6723 | VkQueryPool queryPool, |
| 6724 | uint32_t startQuery, |
| 6725 | uint32_t queryCount, |
| 6726 | VkBuffer destBuffer, |
| 6727 | VkDeviceSize destOffset, |
| 6728 | VkDeviceSize destStride, |
| 6729 | VkQueryResultFlags flags) |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 6730 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6731 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
| 6732 | |
| 6733 | PostCmdCopyQueryPoolResults(cmdBuffer, queryPool, startQuery, queryCount, destBuffer, destOffset, destStride, flags); |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 6734 | } |
| 6735 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6736 | bool PreCmdPushConstants( |
| 6737 | VkCmdBuffer cmdBuffer, |
| 6738 | const void* values) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6739 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6740 | if(values != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6741 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6742 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6743 | |
| 6744 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6745 | } |
| 6746 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6747 | bool PostCmdPushConstants( |
| 6748 | VkCmdBuffer cmdBuffer, |
| 6749 | VkPipelineLayout layout, |
| 6750 | VkShaderStageFlags stageFlags, |
| 6751 | uint32_t start, |
| 6752 | uint32_t length) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6753 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6754 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6755 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6756 | |
| 6757 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6758 | |
| 6759 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6760 | } |
| 6761 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6762 | VK_LAYER_EXPORT void VKAPI vkCmdPushConstants( |
| 6763 | VkCmdBuffer cmdBuffer, |
| 6764 | VkPipelineLayout layout, |
| 6765 | VkShaderStageFlags stageFlags, |
| 6766 | uint32_t start, |
| 6767 | uint32_t length, |
| 6768 | const void* values) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6769 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6770 | PreCmdPushConstants(cmdBuffer, values); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6771 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6772 | 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] | 6773 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6774 | PostCmdPushConstants(cmdBuffer, layout, stageFlags, start, length); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6775 | } |
| 6776 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6777 | bool PreCmdBeginRenderPass( |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6778 | VkCmdBuffer cmdBuffer, |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6779 | const VkRenderPassBeginInfo* pRenderPassBegin) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6780 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6781 | if(pRenderPassBegin != nullptr) |
| 6782 | { |
| 6783 | if(pRenderPassBegin->sType != VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6784 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6785 | 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] | 6786 | "vkCmdBeginRenderPass parameter, VkStructureType pRenderPassBegin->sType, is an invalid enumerator"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6787 | return false; |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 6788 | } |
Cody Northrop | 23dd89d | 2015-08-04 11:51:03 -0600 | [diff] [blame] | 6789 | if(pRenderPassBegin->pClearValues != nullptr) |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6790 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6791 | } |
Jon Ashburn | e68a9ff | 2015-05-25 14:11:37 -0600 | [diff] [blame] | 6792 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6793 | |
| 6794 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6795 | } |
| 6796 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6797 | bool PostCmdBeginRenderPass( |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6798 | VkCmdBuffer cmdBuffer, |
| 6799 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6800 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6801 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6802 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
| 6803 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
| 6804 | { |
| 6805 | log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, 1, "PARAMCHECK", |
| 6806 | "vkCmdBeginRenderPass parameter, VkRenderPassContents contents, is an unrecognized enumerator"); |
| 6807 | return false; |
| 6808 | } |
| 6809 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6810 | return true; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6811 | } |
| 6812 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6813 | VK_LAYER_EXPORT void VKAPI vkCmdBeginRenderPass( |
| 6814 | VkCmdBuffer cmdBuffer, |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 6815 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 6816 | VkRenderPassContents contents) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6817 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6818 | PreCmdBeginRenderPass(cmdBuffer, pRenderPassBegin); |
| 6819 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 6820 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdBeginRenderPass(cmdBuffer, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6821 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6822 | PostCmdBeginRenderPass(cmdBuffer, contents); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6823 | } |
| 6824 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6825 | bool PostCmdNextSubpass( |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 6826 | VkCmdBuffer cmdBuffer, |
| 6827 | VkRenderPassContents contents) |
| 6828 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6829 | |
| 6830 | if(contents < VK_RENDER_PASS_CONTENTS_BEGIN_RANGE || |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6831 | contents > VK_RENDER_PASS_CONTENTS_END_RANGE) |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 6832 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6833 | 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] | 6834 | "vkCmdNextSubpass parameter, VkRenderPassContents contents, is an unrecognized enumerator"); |
| 6835 | return false; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 6836 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6837 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6838 | return true; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 6839 | } |
| 6840 | |
| 6841 | VK_LAYER_EXPORT void VKAPI vkCmdNextSubpass( |
| 6842 | VkCmdBuffer cmdBuffer, |
| 6843 | VkRenderPassContents contents) |
| 6844 | { |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 6845 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdNextSubpass(cmdBuffer, contents); |
| 6846 | |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6847 | PostCmdNextSubpass(cmdBuffer, contents); |
| 6848 | } |
| 6849 | |
| 6850 | bool PostCmdEndRenderPass( |
| 6851 | VkCmdBuffer cmdBuffer) |
| 6852 | { |
| 6853 | |
| 6854 | return true; |
| 6855 | } |
| 6856 | |
| 6857 | VK_LAYER_EXPORT void VKAPI vkCmdEndRenderPass( |
| 6858 | VkCmdBuffer cmdBuffer) |
| 6859 | { |
| 6860 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdEndRenderPass(cmdBuffer); |
| 6861 | |
| 6862 | PostCmdEndRenderPass(cmdBuffer); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 6863 | } |
| 6864 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6865 | bool PreCmdExecuteCommands( |
| 6866 | VkCmdBuffer cmdBuffer, |
| 6867 | const VkCmdBuffer* pCmdBuffers) |
| 6868 | { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 6869 | if(pCmdBuffers != nullptr) |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6870 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6871 | } |
| 6872 | |
| 6873 | return true; |
| 6874 | } |
| 6875 | |
| 6876 | bool PostCmdExecuteCommands( |
| 6877 | VkCmdBuffer cmdBuffer, |
| 6878 | uint32_t cmdBuffersCount) |
| 6879 | { |
| 6880 | |
| 6881 | |
| 6882 | return true; |
| 6883 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6884 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 6885 | VK_LAYER_EXPORT void VKAPI vkCmdExecuteCommands( |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6886 | VkCmdBuffer cmdBuffer, |
| 6887 | uint32_t cmdBuffersCount, |
| 6888 | const VkCmdBuffer* pCmdBuffers) |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 6889 | { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6890 | PreCmdExecuteCommands(cmdBuffer, pCmdBuffers); |
| 6891 | |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 6892 | get_dispatch_table(pc_device_table_map, cmdBuffer)->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers); |
| 6893 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 6894 | PostCmdExecuteCommands(cmdBuffer, cmdBuffersCount); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 6895 | } |
| 6896 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6897 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr(VkDevice device, const char* funcName) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6898 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 6899 | if (device == NULL) { |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6900 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 6901 | } |
| 6902 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 6903 | /* loader uses this to force layer initialization; device object is wrapped */ |
| 6904 | if (!strcmp(funcName, "vkGetDeviceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6905 | initDeviceTable(pc_device_table_map, (const VkBaseLayerObject *) device); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6906 | return (PFN_vkVoidFunction) vkGetDeviceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 6907 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6908 | |
Courtney Goeltzenleuchter | ca173b8 | 2015-06-25 18:01:43 -0600 | [diff] [blame] | 6909 | if (!strcmp(funcName, "vkCreateDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6910 | return (PFN_vkVoidFunction) vkCreateDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6911 | if (!strcmp(funcName, "vkDestroyDevice")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6912 | return (PFN_vkVoidFunction) vkDestroyDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6913 | if (!strcmp(funcName, "vkGetDeviceQueue")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6914 | return (PFN_vkVoidFunction) vkGetDeviceQueue; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6915 | if (!strcmp(funcName, "vkQueueSubmit")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6916 | return (PFN_vkVoidFunction) vkQueueSubmit; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6917 | if (!strcmp(funcName, "vkQueueWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6918 | return (PFN_vkVoidFunction) vkQueueWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6919 | if (!strcmp(funcName, "vkDeviceWaitIdle")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6920 | return (PFN_vkVoidFunction) vkDeviceWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6921 | if (!strcmp(funcName, "vkAllocMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6922 | return (PFN_vkVoidFunction) vkAllocMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6923 | if (!strcmp(funcName, "vkMapMemory")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6924 | return (PFN_vkVoidFunction) vkMapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6925 | if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6926 | return (PFN_vkVoidFunction) vkFlushMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6927 | if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6928 | return (PFN_vkVoidFunction) vkInvalidateMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6929 | if (!strcmp(funcName, "vkCreateFence")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6930 | return (PFN_vkVoidFunction) vkCreateFence; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6931 | if (!strcmp(funcName, "vkResetFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6932 | return (PFN_vkVoidFunction) vkResetFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6933 | if (!strcmp(funcName, "vkGetFenceStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6934 | return (PFN_vkVoidFunction) vkGetFenceStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6935 | if (!strcmp(funcName, "vkWaitForFences")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6936 | return (PFN_vkVoidFunction) vkWaitForFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6937 | if (!strcmp(funcName, "vkCreateSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6938 | return (PFN_vkVoidFunction) vkCreateSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6939 | if (!strcmp(funcName, "vkQueueSignalSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6940 | return (PFN_vkVoidFunction) vkQueueSignalSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6941 | if (!strcmp(funcName, "vkQueueWaitSemaphore")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6942 | return (PFN_vkVoidFunction) vkQueueWaitSemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6943 | if (!strcmp(funcName, "vkCreateEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6944 | return (PFN_vkVoidFunction) vkCreateEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6945 | if (!strcmp(funcName, "vkGetEventStatus")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6946 | return (PFN_vkVoidFunction) vkGetEventStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6947 | if (!strcmp(funcName, "vkSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6948 | return (PFN_vkVoidFunction) vkSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6949 | if (!strcmp(funcName, "vkResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6950 | return (PFN_vkVoidFunction) vkResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6951 | if (!strcmp(funcName, "vkCreateQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6952 | return (PFN_vkVoidFunction) vkCreateQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6953 | if (!strcmp(funcName, "vkGetQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6954 | return (PFN_vkVoidFunction) vkGetQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6955 | if (!strcmp(funcName, "vkCreateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6956 | return (PFN_vkVoidFunction) vkCreateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6957 | if (!strcmp(funcName, "vkCreateBufferView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6958 | return (PFN_vkVoidFunction) vkCreateBufferView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6959 | if (!strcmp(funcName, "vkCreateImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6960 | return (PFN_vkVoidFunction) vkCreateImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6961 | if (!strcmp(funcName, "vkGetImageSubresourceLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6962 | return (PFN_vkVoidFunction) vkGetImageSubresourceLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6963 | if (!strcmp(funcName, "vkCreateImageView")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6964 | return (PFN_vkVoidFunction) vkCreateImageView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6965 | if (!strcmp(funcName, "vkCreateShader")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6966 | return (PFN_vkVoidFunction) vkCreateShader; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 6967 | if (!strcmp(funcName, "vkCreateGraphicsPipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6968 | return (PFN_vkVoidFunction) vkCreateGraphicsPipelines; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 6969 | if (!strcmp(funcName, "vkCreateComputePipelines")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6970 | return (PFN_vkVoidFunction) vkCreateComputePipelines; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6971 | if (!strcmp(funcName, "vkCreatePipelineLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6972 | return (PFN_vkVoidFunction) vkCreatePipelineLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6973 | if (!strcmp(funcName, "vkCreateSampler")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6974 | return (PFN_vkVoidFunction) vkCreateSampler; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6975 | if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6976 | return (PFN_vkVoidFunction) vkCreateDescriptorSetLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6977 | if (!strcmp(funcName, "vkCreateDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6978 | return (PFN_vkVoidFunction) vkCreateDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6979 | if (!strcmp(funcName, "vkResetDescriptorPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6980 | return (PFN_vkVoidFunction) vkResetDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6981 | if (!strcmp(funcName, "vkAllocDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 6982 | return (PFN_vkVoidFunction) vkAllocDescriptorSets; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame^] | 6983 | if (!strcmp(funcName, "vkCmdSetViewport")) |
| 6984 | return (PFN_vkVoidFunction) vkCmdSetViewport; |
| 6985 | if (!strcmp(funcName, "vkCmdSetLineWidth")) |
| 6986 | return (PFN_vkVoidFunction) vkCmdSetLineWidth; |
| 6987 | if (!strcmp(funcName, "vkCmdSetDepthBias")) |
| 6988 | return (PFN_vkVoidFunction) vkCmdSetDepthBias; |
| 6989 | if (!strcmp(funcName, "vkCmdSetBlendConstants")) |
| 6990 | return (PFN_vkVoidFunction) vkCmdSetBlendConstants; |
| 6991 | if (!strcmp(funcName, "vkCmdSetDepthBounds")) |
| 6992 | return (PFN_vkVoidFunction) vkCmdSetDepthBounds; |
| 6993 | if (!strcmp(funcName, "vkCmdSetStencilCompareMask")) |
| 6994 | return (PFN_vkVoidFunction) vkCmdSetStencilCompareMask; |
| 6995 | if (!strcmp(funcName, "vkCmdSetStencilWriteMask")) |
| 6996 | return (PFN_vkVoidFunction) vkCmdSetStencilWriteMask; |
| 6997 | if (!strcmp(funcName, "vkCmdSetStencilReference")) |
| 6998 | return (PFN_vkVoidFunction) vkCmdSetStencilReference; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 6999 | if (!strcmp(funcName, "vkCreateCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7000 | return (PFN_vkVoidFunction) vkCreateCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7001 | if (!strcmp(funcName, "vkBeginCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7002 | return (PFN_vkVoidFunction) vkBeginCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7003 | if (!strcmp(funcName, "vkEndCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7004 | return (PFN_vkVoidFunction) vkEndCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7005 | if (!strcmp(funcName, "vkResetCommandBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7006 | return (PFN_vkVoidFunction) vkResetCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7007 | if (!strcmp(funcName, "vkCmdBindPipeline")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7008 | return (PFN_vkVoidFunction) vkCmdBindPipeline; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7009 | if (!strcmp(funcName, "vkCmdBindDescriptorSets")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7010 | return (PFN_vkVoidFunction) vkCmdBindDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7011 | if (!strcmp(funcName, "vkCmdBindVertexBuffers")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7012 | return (PFN_vkVoidFunction) vkCmdBindVertexBuffers; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7013 | if (!strcmp(funcName, "vkCmdBindIndexBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7014 | return (PFN_vkVoidFunction) vkCmdBindIndexBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7015 | if (!strcmp(funcName, "vkCmdDraw")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7016 | return (PFN_vkVoidFunction) vkCmdDraw; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7017 | if (!strcmp(funcName, "vkCmdDrawIndexed")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7018 | return (PFN_vkVoidFunction) vkCmdDrawIndexed; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7019 | if (!strcmp(funcName, "vkCmdDrawIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7020 | return (PFN_vkVoidFunction) vkCmdDrawIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7021 | if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7022 | return (PFN_vkVoidFunction) vkCmdDrawIndexedIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7023 | if (!strcmp(funcName, "vkCmdDispatch")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7024 | return (PFN_vkVoidFunction) vkCmdDispatch; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7025 | if (!strcmp(funcName, "vkCmdDispatchIndirect")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7026 | return (PFN_vkVoidFunction) vkCmdDispatchIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7027 | if (!strcmp(funcName, "vkCmdCopyBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7028 | return (PFN_vkVoidFunction) vkCmdCopyBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7029 | if (!strcmp(funcName, "vkCmdCopyImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7030 | return (PFN_vkVoidFunction) vkCmdCopyImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7031 | if (!strcmp(funcName, "vkCmdBlitImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7032 | return (PFN_vkVoidFunction) vkCmdBlitImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7033 | if (!strcmp(funcName, "vkCmdCopyBufferToImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7034 | return (PFN_vkVoidFunction) vkCmdCopyBufferToImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7035 | if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7036 | return (PFN_vkVoidFunction) vkCmdCopyImageToBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7037 | if (!strcmp(funcName, "vkCmdUpdateBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7038 | return (PFN_vkVoidFunction) vkCmdUpdateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7039 | if (!strcmp(funcName, "vkCmdFillBuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7040 | return (PFN_vkVoidFunction) vkCmdFillBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7041 | if (!strcmp(funcName, "vkCmdClearColorImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7042 | return (PFN_vkVoidFunction) vkCmdClearColorImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7043 | if (!strcmp(funcName, "vkCmdResolveImage")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7044 | return (PFN_vkVoidFunction) vkCmdResolveImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7045 | if (!strcmp(funcName, "vkCmdSetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7046 | return (PFN_vkVoidFunction) vkCmdSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7047 | if (!strcmp(funcName, "vkCmdResetEvent")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7048 | return (PFN_vkVoidFunction) vkCmdResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7049 | if (!strcmp(funcName, "vkCmdWaitEvents")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7050 | return (PFN_vkVoidFunction) vkCmdWaitEvents; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7051 | if (!strcmp(funcName, "vkCmdPipelineBarrier")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7052 | return (PFN_vkVoidFunction) vkCmdPipelineBarrier; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7053 | if (!strcmp(funcName, "vkCmdBeginQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7054 | return (PFN_vkVoidFunction) vkCmdBeginQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7055 | if (!strcmp(funcName, "vkCmdEndQuery")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7056 | return (PFN_vkVoidFunction) vkCmdEndQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7057 | if (!strcmp(funcName, "vkCmdResetQueryPool")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7058 | return (PFN_vkVoidFunction) vkCmdResetQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7059 | if (!strcmp(funcName, "vkCmdWriteTimestamp")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7060 | return (PFN_vkVoidFunction) vkCmdWriteTimestamp; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7061 | if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7062 | return (PFN_vkVoidFunction) vkCmdCopyQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7063 | if (!strcmp(funcName, "vkCreateFramebuffer")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7064 | return (PFN_vkVoidFunction) vkCreateFramebuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7065 | if (!strcmp(funcName, "vkCreateRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7066 | return (PFN_vkVoidFunction) vkCreateRenderPass; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7067 | if (!strcmp(funcName, "vkCmdBeginRenderPass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7068 | return (PFN_vkVoidFunction) vkCmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 7069 | if (!strcmp(funcName, "vkCmdNextSubpass")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7070 | return (PFN_vkVoidFunction) vkCmdNextSubpass; |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 7071 | |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 7072 | { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7073 | if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL) |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7074 | return NULL; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7075 | return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7076 | } |
| 7077 | } |
| 7078 | |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7079 | VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetInstanceProcAddr(VkInstance instance, const char* funcName) |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7080 | { |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 7081 | if (instance == NULL) { |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7082 | return NULL; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 7083 | } |
| 7084 | |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 7085 | /* loader uses this to force layer initialization; instance object is wrapped */ |
| 7086 | if (!strcmp(funcName, "vkGetInstanceProcAddr")) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7087 | initInstanceTable(pc_instance_table_map, (const VkBaseLayerObject *) instance); |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7088 | return (PFN_vkVoidFunction) vkGetInstanceProcAddr; |
Jon Ashburn | 8fd0825 | 2015-05-28 16:25:02 -0600 | [diff] [blame] | 7089 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7090 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7091 | if (!strcmp(funcName, "vkCreateInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7092 | return (PFN_vkVoidFunction) vkCreateInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7093 | if (!strcmp(funcName, "vkDestroyInstance")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7094 | return (PFN_vkVoidFunction) vkDestroyInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7095 | if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7096 | return (PFN_vkVoidFunction) vkEnumeratePhysicalDevices; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7097 | if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7098 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7099 | if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7100 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 7101 | if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) |
Courtney Goeltzenleuchter | 2d3ba63 | 2015-07-12 14:35:22 -0600 | [diff] [blame] | 7102 | return (PFN_vkVoidFunction) vkGetPhysicalDeviceFormatProperties; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 7103 | if (!strcmp(funcName, "vkEnumerateInstanceLayerProperties")) |
| 7104 | return (PFN_vkVoidFunction) vkEnumerateInstanceLayerProperties; |
| 7105 | if (!strcmp(funcName, "vkEnumerateInstanceExtensionProperties")) |
| 7106 | return (PFN_vkVoidFunction) vkEnumerateInstanceExtensionProperties; |
| 7107 | if (!strcmp(funcName, "vkEnumerateDeviceLayerProperties")) |
| 7108 | return (PFN_vkVoidFunction) vkEnumerateDeviceLayerProperties; |
| 7109 | if (!strcmp(funcName, "vkEnumerateDeviceExtensionProperties")) |
| 7110 | return (PFN_vkVoidFunction) vkEnumerateDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 7111 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7112 | 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] | 7113 | 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] | 7114 | if(fptr) |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 7115 | return fptr; |
| 7116 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 7117 | { |
| 7118 | if (get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr == NULL) |
| 7119 | return NULL; |
| 7120 | return get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr(instance, funcName); |
| 7121 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7122 | } |