Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2015-2016 The Khronos Group Inc. |
| 2 | * Copyright (c) 2015-2016 Valve Corporation |
| 3 | * Copyright (c) 2015-2016 LunarG, Inc. |
| 4 | * Copyright (C) 2015-2016 Google Inc. |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and/or associated documentation files (the "Materials"), to |
| 8 | * deal in the Materials without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Materials, and to permit persons to whom the Materials |
| 11 | * are furnished to do so, subject to the following conditions: |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 12 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 13 | * The above copyright notice(s) and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Materials. |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 15 | * |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 16 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Mark Lobodzinski | 288e4f7 | 2016-02-02 15:55:36 -0700 | [diff] [blame] | 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 19 | * |
| 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 21 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 22 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 23 | * USE OR OTHER DEALINGS IN THE MATERIALS |
Courtney Goeltzenleuchter | 96cd795 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 24 | * |
| 25 | * Author: Jeremy Hayes <jeremy@lunarg.com> |
| 26 | * Author: Tony Barbour <tony@LunarG.com> |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 27 | * Author: Mark Lobodzinski <mark@LunarG.com> |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 28 | * Author: Dustin Graves <dustin@lunarg.com> |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 29 | */ |
| 30 | |
| 31 | #include <stdio.h> |
| 32 | #include <stdlib.h> |
| 33 | #include <string.h> |
| 34 | |
| 35 | #include <iostream> |
| 36 | #include <string> |
| 37 | #include <sstream> |
Mark Lobodzinski | 3723c51 | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 38 | #include <unordered_map> |
Michael Lentine | 84db6f5 | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 39 | #include <unordered_set> |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 40 | #include <vector> |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 41 | |
Tobin Ehlis | 7a51d90 | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 42 | #include "vk_loader_platform.h" |
David Pinedo | 329ca9e | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 43 | #include "vulkan/vk_layer.h" |
Tobin Ehlis | 56d204a | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 44 | #include "vk_layer_config.h" |
Courtney Goeltzenleuchter | 9cc421e | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 45 | #include "vk_enum_validate_helper.h" |
| 46 | #include "vk_struct_validate_helper.h" |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 47 | |
Tobin Ehlis | 56d204a | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 48 | #include "vk_layer_table.h" |
| 49 | #include "vk_layer_data.h" |
| 50 | #include "vk_layer_logging.h" |
Courtney Goeltzenleuchter | 24d5abb | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 51 | #include "vk_layer_extension_utils.h" |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 52 | #include "vk_layer_utils.h" |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 53 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 54 | #include "parameter_validation.h" |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 55 | |
Cody Northrop | 73bb657 | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 56 | struct layer_data { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 57 | debug_report_data *report_data; |
Courtney Goeltzenleuchter | acb1359 | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 58 | std::vector<VkDebugReportCallbackEXT> logging_callback; |
Cody Northrop | 73bb657 | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 59 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 60 | // TODO: Split instance/device structs |
| 61 | // Device Data |
| 62 | // Map for queue family index to queue count |
Michael Lentine | 1595771 | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 63 | std::unordered_map<uint32_t, uint32_t> queueFamilyIndexMap; |
| 64 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 65 | layer_data() : report_data(nullptr){}; |
Cody Northrop | 73bb657 | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 66 | }; |
Mark Lobodzinski | 3723c51 | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 67 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 68 | static std::unordered_map<void *, layer_data *> layer_data_map; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 69 | static device_table_map pc_device_table_map; |
| 70 | static instance_table_map pc_instance_table_map; |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 71 | |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 72 | // "my instance data" |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 73 | debug_report_data *mid(VkInstance object) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 74 | dispatch_key key = get_dispatch_key(object); |
Tobin Ehlis | 8354e02 | 2015-09-01 11:46:36 -0600 | [diff] [blame] | 75 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 76 | #if DISPATCH_MAP_DEBUG |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 77 | fprintf(stderr, "MID: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, data); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 78 | #endif |
Courtney Goeltzenleuchter | eb456c6 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 79 | assert(data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 80 | |
| 81 | return data->report_data; |
| 82 | } |
| 83 | |
| 84 | // "my device data" |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 85 | debug_report_data *mdd(void *object) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 86 | dispatch_key key = get_dispatch_key(object); |
| 87 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 88 | #if DISPATCH_MAP_DEBUG |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 89 | fprintf(stderr, "MDD: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, data); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 90 | #endif |
Courtney Goeltzenleuchter | eb456c6 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 91 | assert(data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 92 | return data->report_data; |
| 93 | } |
| 94 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 95 | static void init_parameter_validation(layer_data *my_data, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 96 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 97 | layer_debug_actions(my_data->report_data, my_data->logging_callback, pAllocator, "lunarg_parameter_validation"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 98 | } |
| 99 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 100 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 101 | vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 102 | const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pMsgCallback) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 103 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 104 | VkResult result = pTable->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 105 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 106 | if (result == VK_SUCCESS) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 107 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 108 | result = layer_create_msg_callback(data->report_data, pCreateInfo, pAllocator, pMsgCallback); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | return result; |
| 112 | } |
| 113 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 114 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, |
| 115 | VkDebugReportCallbackEXT msgCallback, |
| 116 | const VkAllocationCallbacks *pAllocator) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 117 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
Courtney Goeltzenleuchter | acb1359 | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 118 | pTable->DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 119 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 120 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
Courtney Goeltzenleuchter | f6a6e22 | 2015-11-30 12:13:14 -0700 | [diff] [blame] | 121 | layer_destroy_msg_callback(data->report_data, msgCallback, pAllocator); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 122 | } |
| 123 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 124 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 125 | vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType, uint64_t object, |
| 126 | size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 127 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 128 | pTable->DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); |
Courtney Goeltzenleuchter | 5a424ce | 2015-12-01 14:10:55 -0700 | [diff] [blame] | 129 | } |
| 130 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 131 | static const VkExtensionProperties instance_extensions[] = {{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}}; |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 132 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 133 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 134 | vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, VkExtensionProperties *pProperties) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 135 | return util_GetExtensionProperties(1, instance_extensions, pCount, pProperties); |
Jon Ashburn | eb2728b | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 136 | } |
| 137 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 138 | static const VkLayerProperties pc_global_layers[] = {{ |
Jon Ashburn | f1ea418 | 2016-03-22 12:57:13 -0600 | [diff] [blame] | 139 | "VK_LAYER_LUNARG_parameter_validation", VK_LAYER_API_VERSION, 1, "LunarG Validation Layer", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 140 | }}; |
Courtney Goeltzenleuchter | d89520d | 2015-12-01 14:08:28 -0700 | [diff] [blame] | 141 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 142 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 143 | vkEnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) { |
| 144 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, pCount, pProperties); |
Tony Barbour | 426b905 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 145 | } |
| 146 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 147 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, |
| 148 | const char *pLayerName, uint32_t *pCount, |
| 149 | VkExtensionProperties *pProperties) { |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 150 | /* parameter_validation does not have any physical device extensions */ |
Jon Ashburn | aff81ff | 2015-11-02 17:37:20 -0700 | [diff] [blame] | 151 | if (pLayerName == NULL) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 152 | return get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 153 | ->EnumerateDeviceExtensionProperties(physicalDevice, NULL, pCount, pProperties); |
Jon Ashburn | aff81ff | 2015-11-02 17:37:20 -0700 | [diff] [blame] | 154 | } else { |
| 155 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
| 156 | } |
Jeremy Hayes | cf46913 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 157 | } |
| 158 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 159 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 160 | vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, VkLayerProperties *pProperties) { |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 161 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 162 | /* parameter_validation's physical device layers are the same as global */ |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 163 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, pCount, pProperties); |
Courtney Goeltzenleuchter | 24d5abb | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 164 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 165 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 166 | static bool ValidateEnumerator(VkFormatFeatureFlagBits const &enumerator) { |
Courtney Goeltzenleuchter | 7529579 | 2015-09-10 16:25:49 -0600 | [diff] [blame] | 167 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)( |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 168 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 169 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 170 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 171 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
| 172 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT | |
Jon Ashburn | bd897d8 | 2016-01-22 15:39:20 -0700 | [diff] [blame] | 173 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 174 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 175 | return false; |
| 176 | } |
| 177 | |
| 178 | return true; |
| 179 | } |
| 180 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 181 | static std::string EnumeratorString(VkFormatFeatureFlagBits const &enumerator) { |
| 182 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 183 | return "unrecognized enumerator"; |
| 184 | } |
| 185 | |
| 186 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 187 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 188 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 189 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 190 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 191 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 192 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 193 | if (enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 194 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 195 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 196 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 197 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 198 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 199 | if (enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 200 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 201 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 202 | if (enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 203 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 204 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 205 | if (enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 206 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 207 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 208 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 209 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 210 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 211 | if (enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 212 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 213 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 214 | if (enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 215 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 216 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 217 | if (enumerator & VK_FORMAT_FEATURE_BLIT_SRC_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 218 | strings.push_back("VK_FORMAT_FEATURE_BLIT_SRC_BIT"); |
Cody Northrop | 9e8b03f | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 219 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 220 | if (enumerator & VK_FORMAT_FEATURE_BLIT_DST_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 221 | strings.push_back("VK_FORMAT_FEATURE_BLIT_DST_BIT"); |
Cody Northrop | 9e8b03f | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 222 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 223 | if (enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) { |
Jon Ashburn | bd897d8 | 2016-01-22 15:39:20 -0700 | [diff] [blame] | 224 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT"); |
| 225 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 226 | |
| 227 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 228 | for (auto const &string : strings) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 229 | enumeratorString += string; |
| 230 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 231 | if (string != strings.back()) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 232 | enumeratorString += '|'; |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | return enumeratorString; |
| 237 | } |
| 238 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 239 | static bool ValidateEnumerator(VkImageUsageFlagBits const &enumerator) { |
| 240 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)( |
| 241 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 242 | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | |
| 243 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT); |
| 244 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 245 | return false; |
| 246 | } |
| 247 | |
| 248 | return true; |
| 249 | } |
| 250 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 251 | static std::string EnumeratorString(VkImageUsageFlagBits const &enumerator) { |
| 252 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 253 | return "unrecognized enumerator"; |
| 254 | } |
| 255 | |
| 256 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 257 | if (enumerator & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 258 | strings.push_back("VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT"); |
| 259 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 260 | if (enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { |
Courtney Goeltzenleuchter | c3b8eea | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 261 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 262 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 263 | if (enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 264 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 265 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 266 | if (enumerator & VK_IMAGE_USAGE_STORAGE_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 267 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 268 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 269 | if (enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 270 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 271 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 272 | if (enumerator & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 273 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DST_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 274 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 275 | if (enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 276 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 277 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 278 | if (enumerator & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 279 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SRC_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 280 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 281 | |
| 282 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 283 | for (auto const &string : strings) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 284 | enumeratorString += string; |
| 285 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 286 | if (string != strings.back()) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 287 | enumeratorString += '|'; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | return enumeratorString; |
| 292 | } |
| 293 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 294 | static bool ValidateEnumerator(VkQueueFlagBits const &enumerator) { |
| 295 | VkQueueFlagBits allFlags = |
| 296 | (VkQueueFlagBits)(VK_QUEUE_TRANSFER_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_SPARSE_BINDING_BIT | VK_QUEUE_GRAPHICS_BIT); |
| 297 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 298 | return false; |
| 299 | } |
| 300 | |
| 301 | return true; |
| 302 | } |
| 303 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 304 | static std::string EnumeratorString(VkQueueFlagBits const &enumerator) { |
| 305 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 306 | return "unrecognized enumerator"; |
| 307 | } |
| 308 | |
| 309 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 310 | if (enumerator & VK_QUEUE_TRANSFER_BIT) { |
Chia-I Wu | c51b121 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 311 | strings.push_back("VK_QUEUE_TRANSFER_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 312 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 313 | if (enumerator & VK_QUEUE_COMPUTE_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 314 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 315 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 316 | if (enumerator & VK_QUEUE_SPARSE_BINDING_BIT) { |
Chia-I Wu | 7e47070 | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 317 | strings.push_back("VK_QUEUE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 318 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 319 | if (enumerator & VK_QUEUE_GRAPHICS_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 320 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 321 | } |
| 322 | |
| 323 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 324 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 325 | enumeratorString += string; |
| 326 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 327 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 328 | enumeratorString += '|'; |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | return enumeratorString; |
| 333 | } |
| 334 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 335 | static bool ValidateEnumerator(VkMemoryPropertyFlagBits const &enumerator) { |
| 336 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)( |
| 337 | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 338 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); |
| 339 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 340 | return false; |
| 341 | } |
| 342 | |
| 343 | return true; |
| 344 | } |
| 345 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 346 | static std::string EnumeratorString(VkMemoryPropertyFlagBits const &enumerator) { |
| 347 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 348 | return "unrecognized enumerator"; |
| 349 | } |
| 350 | |
| 351 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 352 | if (enumerator & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 353 | strings.push_back("VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT"); |
| 354 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 355 | if (enumerator & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) { |
Chia-I Wu | 27d8ed9 | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 356 | strings.push_back("VK_MEMORY_PROPERTY_HOST_COHERENT_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 357 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 358 | if (enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 359 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 360 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 361 | if (enumerator & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { |
Chia-I Wu | 27d8ed9 | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 362 | strings.push_back("VK_MEMORY_PROPERTY_HOST_CACHED_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 363 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 364 | if (enumerator & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { |
Chia-I Wu | 27d8ed9 | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 365 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 369 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 370 | enumeratorString += string; |
| 371 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 372 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 373 | enumeratorString += '|'; |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | return enumeratorString; |
| 378 | } |
| 379 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 380 | static bool ValidateEnumerator(VkMemoryHeapFlagBits const &enumerator) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 381 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_DEVICE_LOCAL_BIT); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 382 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 383 | return false; |
| 384 | } |
| 385 | |
| 386 | return true; |
| 387 | } |
| 388 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 389 | static std::string EnumeratorString(VkMemoryHeapFlagBits const &enumerator) { |
| 390 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 391 | return "unrecognized enumerator"; |
| 392 | } |
| 393 | |
| 394 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 395 | if (enumerator & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) { |
Chia-I Wu | 27d8ed9 | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 396 | strings.push_back("VK_MEMORY_HEAP_DEVICE_LOCAL_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 397 | } |
| 398 | |
| 399 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 400 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 401 | enumeratorString += string; |
| 402 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 403 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 404 | enumeratorString += '|'; |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | return enumeratorString; |
| 409 | } |
| 410 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 411 | static bool ValidateEnumerator(VkSparseImageFormatFlagBits const &enumerator) { |
| 412 | VkSparseImageFormatFlagBits allFlags = |
| 413 | (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT | |
| 414 | VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT | VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT); |
| 415 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 416 | return false; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 417 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 418 | |
| 419 | return true; |
| 420 | } |
| 421 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 422 | static std::string EnumeratorString(VkSparseImageFormatFlagBits const &enumerator) { |
| 423 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 424 | return "unrecognized enumerator"; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 425 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 426 | |
| 427 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 428 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT) { |
Chia-I Wu | 7e47070 | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 429 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 430 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 431 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT) { |
Chia-I Wu | 7e47070 | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 432 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 433 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 434 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) { |
Chia-I Wu | 7e47070 | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 435 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 436 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 437 | |
| 438 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 439 | for (auto const &string : strings) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 440 | enumeratorString += string; |
| 441 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 442 | if (string != strings.back()) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 443 | enumeratorString += '|'; |
| 444 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 445 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 446 | |
| 447 | return enumeratorString; |
| 448 | } |
| 449 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 450 | static bool ValidateEnumerator(VkFenceCreateFlagBits const &enumerator) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 451 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 452 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 453 | return false; |
| 454 | } |
| 455 | |
| 456 | return true; |
| 457 | } |
| 458 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 459 | static std::string EnumeratorString(VkFenceCreateFlagBits const &enumerator) { |
| 460 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 461 | return "unrecognized enumerator"; |
| 462 | } |
| 463 | |
| 464 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 465 | if (enumerator & VK_FENCE_CREATE_SIGNALED_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 466 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 467 | } |
| 468 | |
| 469 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 470 | for (auto const &string : strings) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 471 | enumeratorString += string; |
| 472 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 473 | if (string != strings.back()) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 474 | enumeratorString += '|'; |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | return enumeratorString; |
| 479 | } |
| 480 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 481 | static bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const &enumerator) { |
| 482 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)( |
| 483 | VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT | |
| 484 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT | |
| 485 | VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT | |
| 486 | VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT | |
Courtney Goeltzenleuchter | b93427c | 2015-10-15 16:57:32 -0600 | [diff] [blame] | 487 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT | |
| 488 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT | |
| 489 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 490 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 491 | return false; |
| 492 | } |
| 493 | |
| 494 | return true; |
| 495 | } |
| 496 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 497 | static std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const &enumerator) { |
| 498 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 499 | return "unrecognized enumerator"; |
| 500 | } |
| 501 | |
| 502 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 503 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 504 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 505 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 506 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 507 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 508 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 509 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 510 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 511 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 512 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 513 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 514 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 515 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 516 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 517 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 518 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 519 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 520 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 521 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 522 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 523 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 524 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 525 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 526 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 527 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 528 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 529 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 530 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 531 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 532 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 533 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 534 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 535 | } |
| 536 | |
| 537 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 538 | for (auto const &string : strings) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 539 | enumeratorString += string; |
| 540 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 541 | if (string != strings.back()) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 542 | enumeratorString += '|'; |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | return enumeratorString; |
| 547 | } |
| 548 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 549 | static bool ValidateEnumerator(VkQueryResultFlagBits const &enumerator) { |
| 550 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 551 | VK_QUERY_RESULT_WAIT_BIT | VK_QUERY_RESULT_64_BIT); |
| 552 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 553 | return false; |
| 554 | } |
| 555 | |
| 556 | return true; |
| 557 | } |
| 558 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 559 | static std::string EnumeratorString(VkQueryResultFlagBits const &enumerator) { |
| 560 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 561 | return "unrecognized enumerator"; |
| 562 | } |
| 563 | |
| 564 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 565 | if (enumerator & VK_QUERY_RESULT_PARTIAL_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 566 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 567 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 568 | if (enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 569 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 570 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 571 | if (enumerator & VK_QUERY_RESULT_WAIT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 572 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 573 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 574 | if (enumerator & VK_QUERY_RESULT_64_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 575 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 576 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 577 | |
| 578 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 579 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 580 | enumeratorString += string; |
| 581 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 582 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 583 | enumeratorString += '|'; |
| 584 | } |
| 585 | } |
| 586 | |
| 587 | return enumeratorString; |
| 588 | } |
| 589 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 590 | static bool ValidateEnumerator(VkBufferUsageFlagBits const &enumerator) { |
| 591 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)( |
| 592 | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 593 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | |
| 594 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); |
| 595 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 596 | return false; |
| 597 | } |
| 598 | |
| 599 | return true; |
| 600 | } |
| 601 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 602 | static std::string EnumeratorString(VkBufferUsageFlagBits const &enumerator) { |
| 603 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 604 | return "unrecognized enumerator"; |
| 605 | } |
| 606 | |
| 607 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 608 | if (enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 609 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 610 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 611 | if (enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 612 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 613 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 614 | if (enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 615 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 616 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 617 | if (enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 618 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 619 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 620 | if (enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 621 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 622 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 623 | if (enumerator & VK_BUFFER_USAGE_TRANSFER_DST_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 624 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DST_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 625 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 626 | if (enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 627 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 628 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 629 | if (enumerator & VK_BUFFER_USAGE_TRANSFER_SRC_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 630 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SRC_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 631 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 632 | if (enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 633 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 634 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 635 | |
| 636 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 637 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 638 | enumeratorString += string; |
| 639 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 640 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 641 | enumeratorString += '|'; |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | return enumeratorString; |
| 646 | } |
| 647 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 648 | static bool ValidateEnumerator(VkBufferCreateFlagBits const &enumerator) { |
| 649 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)( |
| 650 | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT); |
| 651 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 652 | return false; |
| 653 | } |
| 654 | |
| 655 | return true; |
| 656 | } |
| 657 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 658 | static std::string EnumeratorString(VkBufferCreateFlagBits const &enumerator) { |
| 659 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 660 | return "unrecognized enumerator"; |
| 661 | } |
| 662 | |
| 663 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 664 | if (enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 665 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 666 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 667 | if (enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 668 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 669 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 670 | if (enumerator & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) { |
Courtney Goeltzenleuchter | c6d66ec | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 671 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 675 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 676 | enumeratorString += string; |
| 677 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 678 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 679 | enumeratorString += '|'; |
| 680 | } |
| 681 | } |
| 682 | |
| 683 | return enumeratorString; |
| 684 | } |
| 685 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 686 | static bool ValidateEnumerator(VkImageCreateFlagBits const &enumerator) { |
| 687 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)( |
| 688 | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
| 689 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); |
| 690 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 691 | return false; |
| 692 | } |
| 693 | |
| 694 | return true; |
| 695 | } |
| 696 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 697 | static std::string EnumeratorString(VkImageCreateFlagBits const &enumerator) { |
| 698 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 699 | return "unrecognized enumerator"; |
| 700 | } |
| 701 | |
| 702 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 703 | if (enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 704 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 705 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 706 | if (enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 707 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 708 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 709 | if (enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 710 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 711 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 712 | if (enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 713 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 714 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 715 | if (enumerator & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) { |
Courtney Goeltzenleuchter | c6d66ec | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 716 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 717 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 718 | |
| 719 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 720 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 721 | enumeratorString += string; |
| 722 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 723 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 724 | enumeratorString += '|'; |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | return enumeratorString; |
| 729 | } |
| 730 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 731 | static bool ValidateEnumerator(VkColorComponentFlagBits const &enumerator) { |
| 732 | VkColorComponentFlagBits allFlags = (VkColorComponentFlagBits)(VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | |
| 733 | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); |
| 734 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 735 | return false; |
| 736 | } |
| 737 | |
| 738 | return true; |
| 739 | } |
| 740 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 741 | static std::string EnumeratorString(VkColorComponentFlagBits const &enumerator) { |
| 742 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 743 | return "unrecognized enumerator"; |
| 744 | } |
| 745 | |
| 746 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 747 | if (enumerator & VK_COLOR_COMPONENT_A_BIT) { |
Chia-I Wu | c51b121 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 748 | strings.push_back("VK_COLOR_COMPONENT_A_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 749 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 750 | if (enumerator & VK_COLOR_COMPONENT_B_BIT) { |
Chia-I Wu | c51b121 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 751 | strings.push_back("VK_COLOR_COMPONENT_B_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 752 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 753 | if (enumerator & VK_COLOR_COMPONENT_G_BIT) { |
Chia-I Wu | c51b121 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 754 | strings.push_back("VK_COLOR_COMPONENT_G_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 755 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 756 | if (enumerator & VK_COLOR_COMPONENT_R_BIT) { |
Chia-I Wu | c51b121 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 757 | strings.push_back("VK_COLOR_COMPONENT_R_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 758 | } |
| 759 | |
| 760 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 761 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 762 | enumeratorString += string; |
| 763 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 764 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 765 | enumeratorString += '|'; |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | return enumeratorString; |
| 770 | } |
| 771 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 772 | static bool ValidateEnumerator(VkPipelineCreateFlagBits const &enumerator) { |
| 773 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)( |
| 774 | VK_PIPELINE_CREATE_DERIVATIVE_BIT | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
| 775 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 776 | return false; |
| 777 | } |
| 778 | |
| 779 | return true; |
| 780 | } |
| 781 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 782 | static std::string EnumeratorString(VkPipelineCreateFlagBits const &enumerator) { |
| 783 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 784 | return "unrecognized enumerator"; |
| 785 | } |
| 786 | |
| 787 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 788 | if (enumerator & VK_PIPELINE_CREATE_DERIVATIVE_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 789 | strings.push_back("VK_PIPELINE_CREATE_DERIVATIVE_BIT"); |
| 790 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 791 | if (enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 792 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 793 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 794 | if (enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 795 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 796 | } |
| 797 | |
| 798 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 799 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 800 | enumeratorString += string; |
| 801 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 802 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 803 | enumeratorString += '|'; |
| 804 | } |
| 805 | } |
| 806 | |
| 807 | return enumeratorString; |
| 808 | } |
| 809 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 810 | static bool ValidateEnumerator(VkShaderStageFlagBits const &enumerator) { |
| 811 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)( |
| 812 | VK_SHADER_STAGE_ALL | VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_GEOMETRY_BIT | VK_SHADER_STAGE_COMPUTE_BIT | |
| 813 | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_VERTEX_BIT); |
| 814 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 815 | return false; |
| 816 | } |
| 817 | |
| 818 | return true; |
| 819 | } |
| 820 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 821 | static std::string EnumeratorString(VkShaderStageFlagBits const &enumerator) { |
| 822 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 823 | return "unrecognized enumerator"; |
| 824 | } |
| 825 | |
| 826 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 827 | if (enumerator & VK_SHADER_STAGE_ALL) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 828 | strings.push_back("VK_SHADER_STAGE_ALL"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 829 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 830 | if (enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 831 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 832 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 833 | if (enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 834 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 835 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 836 | if (enumerator & VK_SHADER_STAGE_COMPUTE_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 837 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 838 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 839 | if (enumerator & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) { |
Courtney Goeltzenleuchter | c6fd226 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 840 | strings.push_back("VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 841 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 842 | if (enumerator & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) { |
Courtney Goeltzenleuchter | c6fd226 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 843 | strings.push_back("VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 844 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 845 | if (enumerator & VK_SHADER_STAGE_VERTEX_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 846 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 847 | } |
| 848 | |
| 849 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 850 | for (auto const &string : strings) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 851 | enumeratorString += string; |
| 852 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 853 | if (string != strings.back()) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 854 | enumeratorString += '|'; |
| 855 | } |
| 856 | } |
| 857 | |
| 858 | return enumeratorString; |
| 859 | } |
| 860 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 861 | static bool ValidateEnumerator(VkPipelineStageFlagBits const &enumerator) { |
Chia-I Wu | cba6cea | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 862 | VkPipelineStageFlagBits allFlags = (VkPipelineStageFlagBits)( |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 863 | VK_PIPELINE_STAGE_ALL_COMMANDS_BIT | VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_HOST_BIT | |
| 864 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | |
| 865 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | |
| 866 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | |
| 867 | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | |
| 868 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT | |
Jon Ashburn | d389269 | 2015-12-31 12:14:37 -0700 | [diff] [blame] | 869 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 870 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 871 | return false; |
| 872 | } |
| 873 | |
| 874 | return true; |
| 875 | } |
| 876 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 877 | static std::string EnumeratorString(VkPipelineStageFlagBits const &enumerator) { |
| 878 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 879 | return "unrecognized enumerator"; |
| 880 | } |
| 881 | |
| 882 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 883 | if (enumerator & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) { |
Chia-I Wu | cba6cea | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 884 | strings.push_back("VK_PIPELINE_STAGE_ALL_COMMANDS_BIT"); |
| 885 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 886 | if (enumerator & VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT) { |
Chia-I Wu | cba6cea | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 887 | strings.push_back("VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 888 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 889 | if (enumerator & VK_PIPELINE_STAGE_HOST_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 890 | strings.push_back("VK_PIPELINE_STAGE_HOST_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 891 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 892 | if (enumerator & VK_PIPELINE_STAGE_TRANSFER_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 893 | strings.push_back("VK_PIPELINE_STAGE_TRANSFER_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 894 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 895 | if (enumerator & VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 896 | strings.push_back("VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 897 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 898 | if (enumerator & VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT) { |
Jon Ashburn | d389269 | 2015-12-31 12:14:37 -0700 | [diff] [blame] | 899 | strings.push_back("VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 900 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 901 | if (enumerator & VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 902 | strings.push_back("VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 903 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 904 | if (enumerator & VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 905 | strings.push_back("VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 906 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 907 | if (enumerator & VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT) { |
Courtney Goeltzenleuchter | c6fd226 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 908 | strings.push_back("VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 909 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 910 | if (enumerator & VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 911 | strings.push_back("VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 912 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 913 | if (enumerator & VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 914 | strings.push_back("VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT"); |
| 915 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 916 | if (enumerator & VK_PIPELINE_STAGE_VERTEX_SHADER_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 917 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_SHADER_BIT"); |
| 918 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 919 | if (enumerator & VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 920 | strings.push_back("VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 921 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 922 | if (enumerator & VK_PIPELINE_STAGE_VERTEX_INPUT_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 923 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_INPUT_BIT"); |
| 924 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 925 | if (enumerator & VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 926 | strings.push_back("VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT"); |
| 927 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 928 | if (enumerator & VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 929 | strings.push_back("VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT"); |
| 930 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 931 | if (enumerator & VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 932 | strings.push_back("VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 933 | } |
| 934 | |
| 935 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 936 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 937 | enumeratorString += string; |
| 938 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 939 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 940 | enumeratorString += '|'; |
| 941 | } |
| 942 | } |
| 943 | |
| 944 | return enumeratorString; |
| 945 | } |
| 946 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 947 | static bool ValidateEnumerator(VkAccessFlagBits const &enumerator) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 948 | VkAccessFlagBits allFlags = (VkAccessFlagBits)( |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 949 | VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_INDEX_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | |
| 950 | VK_ACCESS_UNIFORM_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | |
| 951 | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | |
| 952 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | |
| 953 | VK_ACCESS_HOST_READ_BIT | VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT); |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 954 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 955 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 956 | return false; |
| 957 | } |
| 958 | |
| 959 | return true; |
| 960 | } |
| 961 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 962 | static std::string EnumeratorString(VkAccessFlagBits const &enumerator) { |
| 963 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 964 | return "unrecognized enumerator"; |
| 965 | } |
| 966 | |
| 967 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 968 | if (enumerator & VK_ACCESS_INDIRECT_COMMAND_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 969 | strings.push_back("VK_ACCESS_INDIRECT_COMMAND_READ_BIT"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 970 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 971 | if (enumerator & VK_ACCESS_INDEX_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 972 | strings.push_back("VK_ACCESS_INDEX_READ_BIT"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 973 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 974 | if (enumerator & VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 975 | strings.push_back("VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 976 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 977 | if (enumerator & VK_ACCESS_UNIFORM_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 978 | strings.push_back("VK_ACCESS_UNIFORM_READ_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 979 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 980 | if (enumerator & VK_ACCESS_INPUT_ATTACHMENT_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 981 | strings.push_back("VK_ACCESS_INPUT_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 982 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 983 | if (enumerator & VK_ACCESS_SHADER_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 984 | strings.push_back("VK_ACCESS_SHADER_READ_BIT"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 985 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 986 | if (enumerator & VK_ACCESS_SHADER_WRITE_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 987 | strings.push_back("VK_ACCESS_SHADER_WRITE_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 988 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 989 | if (enumerator & VK_ACCESS_COLOR_ATTACHMENT_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 990 | strings.push_back("VK_ACCESS_COLOR_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 991 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 992 | if (enumerator & VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 993 | strings.push_back("VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 994 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 995 | if (enumerator & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 996 | strings.push_back("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 997 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 998 | if (enumerator & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 999 | strings.push_back("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1000 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1001 | if (enumerator & VK_ACCESS_TRANSFER_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1002 | strings.push_back("VK_ACCESS_TRANSFER_READ_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1003 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1004 | if (enumerator & VK_ACCESS_TRANSFER_WRITE_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1005 | strings.push_back("VK_ACCESS_TRANSFER_WRITE_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1006 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1007 | if (enumerator & VK_ACCESS_HOST_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1008 | strings.push_back("VK_ACCESS_HOST_READ_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1009 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1010 | if (enumerator & VK_ACCESS_HOST_WRITE_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1011 | strings.push_back("VK_ACCESS_HOST_WRITE_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1012 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1013 | if (enumerator & VK_ACCESS_MEMORY_READ_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1014 | strings.push_back("VK_ACCESS_MEMORY_READ_BIT"); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1015 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1016 | if (enumerator & VK_ACCESS_MEMORY_WRITE_BIT) { |
Chia-I Wu | 989de84 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1017 | strings.push_back("VK_ACCESS_MEMORY_WRITE_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1018 | } |
| 1019 | |
| 1020 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1021 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1022 | enumeratorString += string; |
| 1023 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1024 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1025 | enumeratorString += '|'; |
| 1026 | } |
| 1027 | } |
| 1028 | |
| 1029 | return enumeratorString; |
| 1030 | } |
| 1031 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1032 | static bool ValidateEnumerator(VkCommandPoolCreateFlagBits const &enumerator) { |
| 1033 | VkCommandPoolCreateFlagBits allFlags = |
| 1034 | (VkCommandPoolCreateFlagBits)(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT); |
| 1035 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1036 | return false; |
| 1037 | } |
| 1038 | |
| 1039 | return true; |
| 1040 | } |
| 1041 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1042 | static std::string EnumeratorString(VkCommandPoolCreateFlagBits const &enumerator) { |
| 1043 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1044 | return "unrecognized enumerator"; |
| 1045 | } |
| 1046 | |
| 1047 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1048 | if (enumerator & VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1049 | strings.push_back("VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1050 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1051 | if (enumerator & VK_COMMAND_POOL_CREATE_TRANSIENT_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1052 | strings.push_back("VK_COMMAND_POOL_CREATE_TRANSIENT_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1053 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1054 | |
| 1055 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1056 | for (auto const &string : strings) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1057 | enumeratorString += string; |
| 1058 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1059 | if (string != strings.back()) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1060 | enumeratorString += '|'; |
| 1061 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1062 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1063 | |
| 1064 | return enumeratorString; |
| 1065 | } |
| 1066 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1067 | static bool ValidateEnumerator(VkCommandPoolResetFlagBits const &enumerator) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1068 | VkCommandPoolResetFlagBits allFlags = (VkCommandPoolResetFlagBits)(VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1069 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1070 | return false; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1071 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1072 | |
| 1073 | return true; |
| 1074 | } |
| 1075 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1076 | static std::string EnumeratorString(VkCommandPoolResetFlagBits const &enumerator) { |
| 1077 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1078 | return "unrecognized enumerator"; |
| 1079 | } |
| 1080 | |
| 1081 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1082 | if (enumerator & VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1083 | strings.push_back("VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1084 | } |
| 1085 | |
| 1086 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1087 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1088 | enumeratorString += string; |
| 1089 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1090 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1091 | enumeratorString += '|'; |
| 1092 | } |
| 1093 | } |
| 1094 | |
| 1095 | return enumeratorString; |
| 1096 | } |
| 1097 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1098 | static bool ValidateEnumerator(VkCommandBufferUsageFlags const &enumerator) { |
| 1099 | VkCommandBufferUsageFlags allFlags = |
| 1100 | (VkCommandBufferUsageFlags)(VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT | VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT | |
| 1101 | VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT); |
| 1102 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1103 | return false; |
| 1104 | } |
| 1105 | |
| 1106 | return true; |
| 1107 | } |
| 1108 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1109 | static std::string EnumeratorString(VkCommandBufferUsageFlags const &enumerator) { |
| 1110 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1111 | return "unrecognized enumerator"; |
| 1112 | } |
| 1113 | |
| 1114 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1115 | if (enumerator & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1116 | strings.push_back("VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1117 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1118 | if (enumerator & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1119 | strings.push_back("VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1120 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1121 | if (enumerator & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1122 | strings.push_back("VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1123 | } |
| 1124 | |
| 1125 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1126 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1127 | enumeratorString += string; |
| 1128 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1129 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1130 | enumeratorString += '|'; |
| 1131 | } |
| 1132 | } |
| 1133 | |
| 1134 | return enumeratorString; |
| 1135 | } |
| 1136 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1137 | static bool ValidateEnumerator(VkCommandBufferResetFlagBits const &enumerator) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1138 | VkCommandBufferResetFlagBits allFlags = (VkCommandBufferResetFlagBits)(VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1139 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1140 | return false; |
| 1141 | } |
| 1142 | |
| 1143 | return true; |
| 1144 | } |
| 1145 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1146 | static std::string EnumeratorString(VkCommandBufferResetFlagBits const &enumerator) { |
| 1147 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1148 | return "unrecognized enumerator"; |
| 1149 | } |
| 1150 | |
| 1151 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1152 | if (enumerator & VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT) { |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1153 | strings.push_back("VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1154 | } |
| 1155 | |
| 1156 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1157 | for (auto const &string : strings) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1158 | enumeratorString += string; |
| 1159 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1160 | if (string != strings.back()) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1161 | enumeratorString += '|'; |
| 1162 | } |
| 1163 | } |
| 1164 | |
| 1165 | return enumeratorString; |
| 1166 | } |
| 1167 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1168 | static bool ValidateEnumerator(VkImageAspectFlagBits const &enumerator) { |
| 1169 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_METADATA_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1170 | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_COLOR_BIT); |
| 1171 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1172 | return false; |
| 1173 | } |
| 1174 | |
| 1175 | return true; |
| 1176 | } |
| 1177 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1178 | static std::string EnumeratorString(VkImageAspectFlagBits const &enumerator) { |
| 1179 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1180 | return "unrecognized enumerator"; |
| 1181 | } |
| 1182 | |
| 1183 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1184 | if (enumerator & VK_IMAGE_ASPECT_METADATA_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1185 | strings.push_back("VK_IMAGE_ASPECT_METADATA_BIT"); |
| 1186 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1187 | if (enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1188 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1189 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1190 | if (enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1191 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1192 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1193 | if (enumerator & VK_IMAGE_ASPECT_COLOR_BIT) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1194 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1195 | } |
| 1196 | |
| 1197 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1198 | for (auto const &string : strings) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1199 | enumeratorString += string; |
| 1200 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1201 | if (string != strings.back()) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1202 | enumeratorString += '|'; |
| 1203 | } |
| 1204 | } |
| 1205 | |
| 1206 | return enumeratorString; |
| 1207 | } |
| 1208 | |
Mark Lobodzinski | 4789202 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 1209 | static bool validate_queue_family_indices(VkDevice device, const char *function_name, const uint32_t count, |
| 1210 | const uint32_t *indices) { |
| 1211 | bool skipCall = false; |
| 1212 | layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1213 | |
| 1214 | for (auto i = 0u; i < count; i++) { |
| 1215 | if (indices[i] == VK_QUEUE_FAMILY_IGNORED) { |
| 1216 | skipCall |= |
| 1217 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 1218 | "%s: the specified queueFamilyIndex cannot be VK_QUEUE_FAMILY_IGNORED.", function_name); |
| 1219 | } else { |
| 1220 | const auto &queue_data = my_device_data->queueFamilyIndexMap.find(indices[i]); |
| 1221 | if (queue_data == my_device_data->queueFamilyIndexMap.end()) { |
| 1222 | skipCall |= log_msg( |
| 1223 | mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 1224 | "VkGetDeviceQueue parameter, uint32_t queueFamilyIndex %d, must have been given when the device was created.", |
| 1225 | indices[i]); |
| 1226 | return false; |
| 1227 | } |
| 1228 | } |
| 1229 | } |
| 1230 | return skipCall; |
| 1231 | } |
| 1232 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1233 | static bool ValidateEnumerator(VkQueryControlFlagBits const &enumerator) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1234 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_PRECISE_BIT); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1235 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1236 | return false; |
| 1237 | } |
| 1238 | |
| 1239 | return true; |
| 1240 | } |
| 1241 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1242 | static std::string EnumeratorString(VkQueryControlFlagBits const &enumerator) { |
| 1243 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1244 | return "unrecognized enumerator"; |
| 1245 | } |
| 1246 | |
| 1247 | std::vector<std::string> strings; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1248 | if (enumerator & VK_QUERY_CONTROL_PRECISE_BIT) { |
Chia-I Wu | c51b121 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 1249 | strings.push_back("VK_QUERY_CONTROL_PRECISE_BIT"); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1250 | } |
| 1251 | |
| 1252 | std::string enumeratorString; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1253 | for (auto const &string : strings) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1254 | enumeratorString += string; |
| 1255 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1256 | if (string != strings.back()) { |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1257 | enumeratorString += '|'; |
| 1258 | } |
| 1259 | } |
| 1260 | |
| 1261 | return enumeratorString; |
| 1262 | } |
| 1263 | |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1264 | static const int MaxParamCheckerStringLength = 256; |
| 1265 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1266 | static bool validate_string(debug_report_data *report_data, const char *apiName, const char *stringName, |
| 1267 | const char *validateString) { |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1268 | assert(apiName != nullptr); |
| 1269 | assert(stringName != nullptr); |
| 1270 | assert(validateString != nullptr); |
| 1271 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1272 | bool skipCall = false; |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1273 | |
| 1274 | VkStringErrorFlags result = vk_string_validate(MaxParamCheckerStringLength, validateString); |
| 1275 | |
| 1276 | if (result == VK_STRING_ERROR_NONE) { |
| 1277 | return skipCall; |
| 1278 | } else if (result & VK_STRING_ERROR_LENGTH) { |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1279 | skipCall = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 1280 | "%s: string %s exceeds max length %d", apiName, stringName, MaxParamCheckerStringLength); |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1281 | } else if (result & VK_STRING_ERROR_BAD_DATA) { |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1282 | skipCall = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 1283 | "%s: string %s contains invalid characters or is badly formed", apiName, stringName); |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1284 | } |
| 1285 | return skipCall; |
| 1286 | } |
| 1287 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1288 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1289 | vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1290 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1291 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1292 | VkLayerInstanceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1293 | assert(chain_info != nullptr); |
| 1294 | assert(chain_info->u.pLayerInfo != nullptr); |
| 1295 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1296 | PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr; |
| 1297 | PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance)fpGetInstanceProcAddr(NULL, "vkCreateInstance"); |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1298 | if (fpCreateInstance == NULL) { |
| 1299 | return VK_ERROR_INITIALIZATION_FAILED; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1300 | } |
| 1301 | |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1302 | // Advance the link info for the next element on the chain |
| 1303 | chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext; |
| 1304 | |
| 1305 | result = fpCreateInstance(pCreateInfo, pAllocator, pInstance); |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1306 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1307 | if (result == VK_SUCCESS) { |
| 1308 | layer_data *my_instance_data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); |
| 1309 | assert(my_instance_data != nullptr); |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1310 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1311 | VkLayerInstanceDispatchTable *pTable = initInstanceTable(*pInstance, fpGetInstanceProcAddr, pc_instance_table_map); |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1312 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1313 | my_instance_data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->enabledExtensionCount, |
| 1314 | pCreateInfo->ppEnabledExtensionNames); |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1315 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1316 | init_parameter_validation(my_instance_data, pAllocator); |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1317 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1318 | // Ordinarily we'd check these before calling down the chain, but none of the layer |
| 1319 | // support is in place until now, if we survive we can report the issue now. |
| 1320 | parameter_validation_vkCreateInstance(my_instance_data->report_data, pCreateInfo, pAllocator, pInstance); |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1321 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1322 | if (pCreateInfo->pApplicationInfo) { |
| 1323 | if (pCreateInfo->pApplicationInfo->pApplicationName) { |
| 1324 | validate_string(my_instance_data->report_data, "vkCreateInstance", |
| 1325 | "pCreateInfo->VkApplicationInfo->pApplicationName", |
| 1326 | pCreateInfo->pApplicationInfo->pApplicationName); |
| 1327 | } |
Courtney Goeltzenleuchter | 7b87708 | 2016-02-10 14:00:52 -0700 | [diff] [blame] | 1328 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1329 | if (pCreateInfo->pApplicationInfo->pEngineName) { |
| 1330 | validate_string(my_instance_data->report_data, "vkCreateInstance", "pCreateInfo->VkApplicationInfo->pEngineName", |
| 1331 | pCreateInfo->pApplicationInfo->pEngineName); |
| 1332 | } |
Courtney Goeltzenleuchter | cc8ae37 | 2016-02-10 15:13:55 -0700 | [diff] [blame] | 1333 | } |
Courtney Goeltzenleuchter | 7b87708 | 2016-02-10 14:00:52 -0700 | [diff] [blame] | 1334 | } |
| 1335 | |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1336 | return result; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1337 | } |
| 1338 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1339 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1340 | // Grab the key before the instance is destroyed. |
| 1341 | dispatch_key key = get_dispatch_key(instance); |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1342 | bool skipCall = false; |
Courtney Goeltzenleuchter | b57dd74 | 2015-10-05 15:59:45 -0600 | [diff] [blame] | 1343 | layer_data *my_data = get_my_data_ptr(key, layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1344 | assert(my_data != NULL); |
| 1345 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1346 | skipCall |= parameter_validation_vkDestroyInstance(my_data->report_data, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1347 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1348 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1349 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1350 | pTable->DestroyInstance(instance, pAllocator); |
| 1351 | |
| 1352 | // Clean up logging callback, if any |
| 1353 | while (my_data->logging_callback.size() > 0) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1354 | VkDebugReportCallbackEXT callback = my_data->logging_callback.back(); |
| 1355 | layer_destroy_msg_callback(my_data->report_data, callback, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1356 | my_data->logging_callback.pop_back(); |
| 1357 | } |
| 1358 | |
| 1359 | layer_debug_report_destroy_instance(mid(instance)); |
| 1360 | layer_data_map.erase(pTable); |
| 1361 | |
| 1362 | pc_instance_table_map.erase(key); |
Tony Barbour | 875879e | 2016-03-22 13:23:24 -0600 | [diff] [blame] | 1363 | layer_data_map.erase(key); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1364 | } |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1365 | } |
| 1366 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1367 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1368 | vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices) { |
| 1369 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1370 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1371 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1372 | assert(my_data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1373 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1374 | skipCall |= parameter_validation_vkEnumeratePhysicalDevices(my_data->report_data, pPhysicalDeviceCount, pPhysicalDevices); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1375 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1376 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1377 | result = get_dispatch_table(pc_instance_table_map, instance) |
| 1378 | ->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1379 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1380 | validate_result(my_data->report_data, "vkEnumeratePhysicalDevices", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1381 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1382 | |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1383 | return result; |
| 1384 | } |
| 1385 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1386 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1387 | vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1388 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1389 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1390 | assert(my_data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1391 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1392 | skipCall |= parameter_validation_vkGetPhysicalDeviceFeatures(my_data->report_data, pFeatures); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1393 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1394 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1395 | get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1396 | } |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1397 | } |
| 1398 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1399 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1400 | vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1401 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1402 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1403 | assert(my_data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1404 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1405 | skipCall |= parameter_validation_vkGetPhysicalDeviceFormatProperties(my_data->report_data, format, pFormatProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1406 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1407 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1408 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1409 | ->GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1410 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1411 | } |
| 1412 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1413 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1414 | vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, |
| 1415 | VkImageUsageFlags usage, VkImageCreateFlags flags, |
| 1416 | VkImageFormatProperties *pImageFormatProperties) { |
| 1417 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1418 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1419 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1420 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1421 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1422 | skipCall |= parameter_validation_vkGetPhysicalDeviceImageFormatProperties(my_data->report_data, format, type, tiling, usage, flags, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1423 | pImageFormatProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1424 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1425 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1426 | result = get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1427 | ->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, |
| 1428 | pImageFormatProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1429 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1430 | validate_result(my_data->report_data, "vkGetPhysicalDeviceImageFormatProperties", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1431 | } |
Chia-I Wu | 5202c54 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 1432 | |
| 1433 | return result; |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1434 | } |
| 1435 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1436 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1437 | vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1438 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1439 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1440 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1441 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1442 | skipCall |= parameter_validation_vkGetPhysicalDeviceProperties(my_data->report_data, pProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1443 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1444 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1445 | get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties(physicalDevice, pProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1446 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1447 | } |
| 1448 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1449 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1450 | vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, |
| 1451 | VkQueueFamilyProperties *pQueueFamilyProperties) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1452 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1453 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1454 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1455 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1456 | skipCall |= parameter_validation_vkGetPhysicalDeviceQueueFamilyProperties(my_data->report_data, pQueueFamilyPropertyCount, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1457 | pQueueFamilyProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1458 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1459 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1460 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1461 | ->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1462 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1463 | } |
| 1464 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1465 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1466 | vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1467 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1468 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1469 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1470 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1471 | skipCall |= parameter_validation_vkGetPhysicalDeviceMemoryProperties(my_data->report_data, pMemoryProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1472 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1473 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1474 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1475 | ->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1476 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1477 | } |
| 1478 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1479 | void validateDeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, |
| 1480 | const std::vector<VkQueueFamilyProperties> properties) { |
Michael Lentine | 84db6f5 | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1481 | std::unordered_set<uint32_t> set; |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1482 | |
| 1483 | if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { |
| 1484 | for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) { |
| 1485 | if (set.count(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex)) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1486 | log_msg(mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1487 | "PARAMCHECK", |
| 1488 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueFamilyIndex, is not unique within this " |
| 1489 | "structure.", |
| 1490 | i); |
| 1491 | } else { |
| 1492 | set.insert(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex); |
Michael Lentine | 2975878 | 2016-01-27 12:50:30 -0600 | [diff] [blame] | 1493 | } |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1494 | |
| 1495 | if (pCreateInfo->pQueueCreateInfos[i].queueCount == 0) { |
| 1496 | log_msg(mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, |
| 1497 | "PARAMCHECK", "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueCount, cannot be zero.", |
| 1498 | i); |
| 1499 | } |
| 1500 | |
| 1501 | if (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities != nullptr) { |
| 1502 | for (uint32_t j = 0; j < pCreateInfo->pQueueCreateInfos[i].queueCount; ++j) { |
| 1503 | if ((pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j] < 0.f) || |
| 1504 | (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j] > 1.f)) { |
| 1505 | log_msg(mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, |
| 1506 | "PARAMCHECK", |
| 1507 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->pQueuePriorities[%d], must be " |
| 1508 | "between 0 and 1. Actual value is %f", |
| 1509 | i, j, pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j]); |
| 1510 | } |
| 1511 | } |
| 1512 | } |
| 1513 | |
| 1514 | if (pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex >= properties.size()) { |
| 1515 | log_msg( |
| 1516 | mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1517 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueFamilyIndex cannot be more than the number " |
| 1518 | "of queue families.", |
| 1519 | i); |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1520 | } else if (pCreateInfo->pQueueCreateInfos[i].queueCount > |
| 1521 | properties[pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex].queueCount) { |
| 1522 | log_msg( |
| 1523 | mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1524 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueCount cannot be more than the number of " |
| 1525 | "queues for the given family index.", |
| 1526 | i); |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1527 | } |
Michael Lentine | a1cde23 | 2016-01-27 13:36:46 -0600 | [diff] [blame] | 1528 | } |
Michael Lentine | 84db6f5 | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1529 | } |
| 1530 | } |
| 1531 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1532 | void storeCreateDeviceData(VkDevice device, const VkDeviceCreateInfo *pCreateInfo) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1533 | layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1534 | |
| 1535 | if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { |
| 1536 | for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) { |
| 1537 | my_device_data->queueFamilyIndexMap.insert( |
| 1538 | std::make_pair(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex, pCreateInfo->pQueueCreateInfos[i].queueCount)); |
| 1539 | } |
Michael Lentine | 1595771 | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1540 | } |
| 1541 | } |
| 1542 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1543 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, |
| 1544 | const VkDeviceCreateInfo *pCreateInfo, |
| 1545 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { |
Courtney Goeltzenleuchter | f004499 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 1546 | /* |
Courtney Goeltzenleuchter | f004499 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 1547 | * NOTE: We do not validate physicalDevice or any dispatchable |
| 1548 | * object as the first parameter. We couldn't get here if it was wrong! |
| 1549 | */ |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1550 | |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1551 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1552 | bool skipCall = false; |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1553 | layer_data *my_instance_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1554 | assert(my_instance_data != nullptr); |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1555 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1556 | skipCall |= parameter_validation_vkCreateDevice(my_instance_data->report_data, pCreateInfo, pAllocator, pDevice); |
Dustin Graves | 80c0dea | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1557 | |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1558 | if (pCreateInfo != NULL) { |
| 1559 | if ((pCreateInfo->enabledLayerCount > 0) && (pCreateInfo->ppEnabledLayerNames != NULL)) { |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 1560 | for (size_t i = 0; i < pCreateInfo->enabledLayerCount; i++) { |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1561 | skipCall |= validate_string(my_instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledLayerNames", |
| 1562 | pCreateInfo->ppEnabledLayerNames[i]); |
| 1563 | } |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1564 | } |
Michael Lentine | a1cde23 | 2016-01-27 13:36:46 -0600 | [diff] [blame] | 1565 | |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1566 | if ((pCreateInfo->enabledExtensionCount > 0) && (pCreateInfo->ppEnabledExtensionNames != NULL)) { |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 1567 | for (size_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1568 | skipCall |= validate_string(my_instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledExtensionNames", |
| 1569 | pCreateInfo->ppEnabledExtensionNames[i]); |
| 1570 | } |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1571 | } |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1572 | } |
| 1573 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1574 | if (!skipCall) { |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1575 | VkLayerDeviceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1576 | assert(chain_info != nullptr); |
| 1577 | assert(chain_info->u.pLayerInfo != nullptr); |
| 1578 | |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1579 | PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr; |
| 1580 | PFN_vkGetDeviceProcAddr fpGetDeviceProcAddr = chain_info->u.pLayerInfo->pfnNextGetDeviceProcAddr; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1581 | PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice)fpGetInstanceProcAddr(NULL, "vkCreateDevice"); |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1582 | if (fpCreateDevice == NULL) { |
| 1583 | return VK_ERROR_INITIALIZATION_FAILED; |
| 1584 | } |
| 1585 | |
| 1586 | // Advance the link info for the next element on the chain |
| 1587 | chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext; |
| 1588 | |
| 1589 | result = fpCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice); |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1590 | |
| 1591 | validate_result(my_instance_data->report_data, "vkCreateDevice", result); |
| 1592 | |
| 1593 | if (result == VK_SUCCESS) { |
| 1594 | layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); |
| 1595 | assert(my_device_data != nullptr); |
| 1596 | |
| 1597 | my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice); |
| 1598 | initDeviceTable(*pDevice, fpGetDeviceProcAddr, pc_device_table_map); |
| 1599 | |
| 1600 | uint32_t count; |
| 1601 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1602 | ->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, nullptr); |
| 1603 | std::vector<VkQueueFamilyProperties> properties(count); |
| 1604 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1605 | ->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, &properties[0]); |
| 1606 | |
| 1607 | validateDeviceCreateInfo(physicalDevice, pCreateInfo, properties); |
| 1608 | storeCreateDeviceData(*pDevice, pCreateInfo); |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1609 | } |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1610 | } |
Michael Lentine | 84db6f5 | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1611 | |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1612 | return result; |
| 1613 | } |
| 1614 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1615 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1616 | dispatch_key key = get_dispatch_key(device); |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1617 | bool skipCall = false; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1618 | layer_data *my_data = get_my_data_ptr(key, layer_data_map); |
| 1619 | assert(my_data != NULL); |
| 1620 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1621 | skipCall |= parameter_validation_vkDestroyDevice(my_data->report_data, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1622 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1623 | if (!skipCall) { |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1624 | layer_debug_report_destroy_device(device); |
| 1625 | |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1626 | #if DISPATCH_MAP_DEBUG |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1627 | fprintf(stderr, "Device: %p, key: %p\n", device, key); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1628 | #endif |
| 1629 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1630 | get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1631 | pc_device_table_map.erase(key); |
Tony Barbour | 54b6f13 | 2016-03-29 15:14:59 -0600 | [diff] [blame] | 1632 | layer_data_map.erase(key); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1633 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1634 | } |
| 1635 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1636 | bool PreGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1637 | layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1638 | assert(my_device_data != nullptr); |
| 1639 | |
Mark Lobodzinski | 4789202 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 1640 | validate_queue_family_indices(device, "vkGetDeviceQueue", 1, &queueFamilyIndex); |
| 1641 | |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1642 | const auto &queue_data = my_device_data->queueFamilyIndexMap.find(queueFamilyIndex); |
Michael Lentine | 1595771 | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1643 | if (queue_data->second <= queueIndex) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1644 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1645 | "VkGetDeviceQueue parameter, uint32_t queueIndex %d, must be less than the number of queues given when the device " |
| 1646 | "was created.", |
| 1647 | queueIndex); |
Michael Lentine | 1595771 | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1648 | return false; |
| 1649 | } |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1650 | |
Michael Lentine | 1595771 | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1651 | return true; |
| 1652 | } |
| 1653 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1654 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1655 | vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1656 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1657 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1658 | assert(my_data != NULL); |
Michael Lentine | 1595771 | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1659 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1660 | skipCall |= parameter_validation_vkGetDeviceQueue(my_data->report_data, queueFamilyIndex, queueIndex, pQueue); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1661 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1662 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1663 | PreGetDeviceQueue(device, queueFamilyIndex, queueIndex); |
| 1664 | |
| 1665 | get_dispatch_table(pc_device_table_map, device)->GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1666 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1667 | } |
| 1668 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1669 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1670 | vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) { |
| 1671 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1672 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1673 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1674 | assert(my_data != NULL); |
| 1675 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1676 | skipCall |= parameter_validation_vkQueueSubmit(my_data->report_data, submitCount, pSubmits, fence); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1677 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1678 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1679 | result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, submitCount, pSubmits, fence); |
| 1680 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1681 | validate_result(my_data->report_data, "vkQueueSubmit", result); |
Courtney Goeltzenleuchter | 3ec3162 | 2015-10-20 18:04:07 -0600 | [diff] [blame] | 1682 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1683 | |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1684 | return result; |
| 1685 | } |
| 1686 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1687 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1688 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map); |
| 1689 | assert(my_data != NULL); |
| 1690 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1691 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1692 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1693 | validate_result(my_data->report_data, "vkQueueWaitIdle", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1694 | |
| 1695 | return result; |
| 1696 | } |
| 1697 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1698 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1699 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1700 | assert(my_data != NULL); |
| 1701 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1702 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1703 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1704 | validate_result(my_data->report_data, "vkDeviceWaitIdle", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1705 | |
| 1706 | return result; |
| 1707 | } |
| 1708 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1709 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, |
| 1710 | const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) { |
| 1711 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1712 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1713 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1714 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1715 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1716 | skipCall |= parameter_validation_vkAllocateMemory(my_data->report_data, pAllocateInfo, pAllocator, pMemory); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1717 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1718 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1719 | result = get_dispatch_table(pc_device_table_map, device)->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory); |
| 1720 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1721 | validate_result(my_data->report_data, "vkAllocateMemory", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1722 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1723 | |
| 1724 | return result; |
| 1725 | } |
| 1726 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1727 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1728 | vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1729 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1730 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1731 | assert(my_data != NULL); |
| 1732 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1733 | skipCall |= parameter_validation_vkFreeMemory(my_data->report_data, memory, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1734 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1735 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1736 | get_dispatch_table(pc_device_table_map, device)->FreeMemory(device, memory, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1737 | } |
| 1738 | } |
| 1739 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1740 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1741 | vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData) { |
| 1742 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1743 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1744 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1745 | assert(my_data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1746 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1747 | skipCall |= parameter_validation_vkMapMemory(my_data->report_data, memory, offset, size, flags, ppData); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1748 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1749 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1750 | result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, memory, offset, size, flags, ppData); |
| 1751 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1752 | validate_result(my_data->report_data, "vkMapMemory", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1753 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1754 | |
| 1755 | return result; |
| 1756 | } |
| 1757 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1758 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1759 | vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges) { |
| 1760 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1761 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1762 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1763 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1764 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1765 | skipCall |= parameter_validation_vkFlushMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges); |
Tony Barbour | 859ceab | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 1766 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1767 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1768 | result = get_dispatch_table(pc_device_table_map, device)->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
| 1769 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1770 | validate_result(my_data->report_data, "vkFlushMappedMemoryRanges", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1771 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1772 | |
Courtney Goeltzenleuchter | a569a50 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1773 | return result; |
| 1774 | } |
| 1775 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1776 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1777 | vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges) { |
| 1778 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1779 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1780 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1781 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1782 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1783 | skipCall |= parameter_validation_vkInvalidateMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges); |
Courtney Goeltzenleuchter | a569a50 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1784 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1785 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1786 | result = |
| 1787 | get_dispatch_table(pc_device_table_map, device)->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1788 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1789 | validate_result(my_data->report_data, "vkInvalidateMappedMemoryRanges", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1790 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1791 | |
Tony Barbour | 859ceab | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 1792 | return result; |
| 1793 | } |
| 1794 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1795 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1796 | vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1797 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1798 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1799 | assert(my_data != NULL); |
Courtney Goeltzenleuchter | d040c5c | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1800 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1801 | skipCall |= parameter_validation_vkGetDeviceMemoryCommitment(my_data->report_data, memory, pCommittedMemoryInBytes); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1802 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1803 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1804 | get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1805 | } |
Courtney Goeltzenleuchter | d040c5c | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1806 | } |
| 1807 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1808 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1809 | vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memoryOffset) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1810 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1811 | assert(my_data != NULL); |
| 1812 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1813 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindBufferMemory(device, buffer, mem, memoryOffset); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1814 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1815 | validate_result(my_data->report_data, "vkBindBufferMemory", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1816 | |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1817 | return result; |
| 1818 | } |
| 1819 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1820 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1821 | vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memoryOffset) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1822 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1823 | assert(my_data != NULL); |
| 1824 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1825 | VkResult result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, mem, memoryOffset); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1826 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1827 | validate_result(my_data->report_data, "vkBindImageMemory", result); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1828 | |
| 1829 | return result; |
| 1830 | } |
| 1831 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1832 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1833 | vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1834 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1835 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1836 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1837 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1838 | skipCall |= parameter_validation_vkGetBufferMemoryRequirements(my_data->report_data, buffer, pMemoryRequirements); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1839 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1840 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1841 | get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1842 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1843 | } |
| 1844 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1845 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1846 | vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1847 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1848 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1849 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1850 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1851 | skipCall |= parameter_validation_vkGetImageMemoryRequirements(my_data->report_data, image, pMemoryRequirements); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1852 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1853 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1854 | get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1855 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1856 | } |
| 1857 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1858 | bool PostGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pNumRequirements, |
| 1859 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
| 1860 | if (pSparseMemoryRequirements != nullptr) { |
Dustin Graves | 4687f26 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1861 | if ((pSparseMemoryRequirements->formatProperties.aspectMask & |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1862 | (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1863 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | 4687f26 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1864 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1865 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect " |
| 1866 | "pSparseMemoryRequirements->formatProperties.aspectMask, is an unrecognized enumerator"); |
Dustin Graves | 4687f26 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1867 | return false; |
| 1868 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1869 | } |
| 1870 | |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1871 | return true; |
| 1872 | } |
| 1873 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1874 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1875 | vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, |
| 1876 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1877 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1878 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1879 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1880 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1881 | skipCall |= parameter_validation_vkGetImageSparseMemoryRequirements(my_data->report_data, image, pSparseMemoryRequirementCount, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1882 | pSparseMemoryRequirements); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1883 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1884 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1885 | get_dispatch_table(pc_device_table_map, device) |
| 1886 | ->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1887 | |
| 1888 | PostGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 1889 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1890 | } |
| 1891 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1892 | bool PostGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, |
| 1893 | VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, |
| 1894 | uint32_t *pNumProperties, VkSparseImageFormatProperties *pProperties) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1895 | if (pProperties != nullptr) { |
| 1896 | if ((pProperties->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1897 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | 4687f26 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1898 | log_msg(mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1899 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspectMask, is an " |
| 1900 | "unrecognized enumerator"); |
Dustin Graves | 4687f26 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1901 | return false; |
| 1902 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1903 | } |
| 1904 | |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1905 | return true; |
| 1906 | } |
| 1907 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1908 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1909 | vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, |
| 1910 | VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, |
| 1911 | uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1912 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1913 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1914 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1915 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1916 | skipCall |= parameter_validation_vkGetPhysicalDeviceSparseImageFormatProperties(my_data->report_data, format, type, samples, usage, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1917 | tiling, pPropertyCount, pProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1918 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1919 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1920 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1921 | ->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, |
| 1922 | pProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1923 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1924 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, |
| 1925 | pProperties); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1926 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1927 | } |
| 1928 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1929 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1930 | vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence) { |
| 1931 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1932 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1933 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1934 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1935 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1936 | skipCall |= parameter_validation_vkQueueBindSparse(my_data->report_data, bindInfoCount, pBindInfo, fence); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1937 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1938 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1939 | result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); |
| 1940 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1941 | validate_result(my_data->report_data, "vkQueueBindSparse", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1942 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1943 | |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1944 | return result; |
| 1945 | } |
| 1946 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1947 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1948 | vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
| 1949 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1950 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1951 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1952 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1953 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1954 | skipCall |= parameter_validation_vkCreateFence(my_data->report_data, pCreateInfo, pAllocator, pFence); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1955 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1956 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1957 | result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pAllocator, pFence); |
| 1958 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1959 | validate_result(my_data->report_data, "vkCreateFence", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1960 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1961 | |
| 1962 | return result; |
| 1963 | } |
| 1964 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1965 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1966 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1967 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1968 | assert(my_data != NULL); |
| 1969 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1970 | skipCall |= parameter_validation_vkDestroyFence(my_data->report_data, fence, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1971 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1972 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1973 | get_dispatch_table(pc_device_table_map, device)->DestroyFence(device, fence, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1974 | } |
| 1975 | } |
| 1976 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1977 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) { |
| 1978 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1979 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1980 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1981 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1982 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1983 | skipCall |= parameter_validation_vkResetFences(my_data->report_data, fenceCount, pFences); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1984 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1985 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1986 | result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences); |
| 1987 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1988 | validate_result(my_data->report_data, "vkResetFences", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1989 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1990 | |
| 1991 | return result; |
| 1992 | } |
| 1993 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1994 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1995 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1996 | assert(my_data != NULL); |
| 1997 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1998 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1999 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2000 | validate_result(my_data->report_data, "vkGetFenceStatus", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2001 | |
| 2002 | return result; |
| 2003 | } |
| 2004 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2005 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2006 | vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout) { |
| 2007 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2008 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2009 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2010 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2011 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2012 | skipCall |= parameter_validation_vkWaitForFences(my_data->report_data, fenceCount, pFences, waitAll, timeout); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2013 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2014 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2015 | result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 2016 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2017 | validate_result(my_data->report_data, "vkWaitForFences", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2018 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2019 | |
| 2020 | return result; |
| 2021 | } |
| 2022 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2023 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, |
| 2024 | const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) { |
| 2025 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2026 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2027 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2028 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2029 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2030 | skipCall |= parameter_validation_vkCreateSemaphore(my_data->report_data, pCreateInfo, pAllocator, pSemaphore); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2031 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2032 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2033 | result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore); |
| 2034 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2035 | validate_result(my_data->report_data, "vkCreateSemaphore", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2036 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2037 | |
| 2038 | return result; |
| 2039 | } |
| 2040 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2041 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2042 | vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2043 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2044 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2045 | assert(my_data != NULL); |
| 2046 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2047 | skipCall |= parameter_validation_vkDestroySemaphore(my_data->report_data, semaphore, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2048 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2049 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2050 | get_dispatch_table(pc_device_table_map, device)->DestroySemaphore(device, semaphore, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2051 | } |
| 2052 | } |
| 2053 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2054 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2055 | vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) { |
| 2056 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2057 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2058 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2059 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2060 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2061 | skipCall |= parameter_validation_vkCreateEvent(my_data->report_data, pCreateInfo, pAllocator, pEvent); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2062 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2063 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2064 | result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pAllocator, pEvent); |
| 2065 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2066 | validate_result(my_data->report_data, "vkCreateEvent", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2067 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2068 | |
| 2069 | return result; |
| 2070 | } |
| 2071 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2072 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2073 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2074 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2075 | assert(my_data != NULL); |
| 2076 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2077 | skipCall |= parameter_validation_vkDestroyEvent(my_data->report_data, event, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2078 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2079 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2080 | get_dispatch_table(pc_device_table_map, device)->DestroyEvent(device, event, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2081 | } |
| 2082 | } |
| 2083 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2084 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2085 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2086 | assert(my_data != NULL); |
| 2087 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 2088 | VkResult result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2089 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2090 | validate_result(my_data->report_data, "vkGetEventStatus", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2091 | |
| 2092 | return result; |
| 2093 | } |
| 2094 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2095 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2096 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2097 | assert(my_data != NULL); |
| 2098 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 2099 | VkResult result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2100 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2101 | validate_result(my_data->report_data, "vkSetEvent", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2102 | |
| 2103 | return result; |
| 2104 | } |
| 2105 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2106 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2107 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2108 | assert(my_data != NULL); |
| 2109 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 2110 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2111 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2112 | validate_result(my_data->report_data, "vkSetEvent", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2113 | |
| 2114 | return result; |
| 2115 | } |
| 2116 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2117 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, |
| 2118 | const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) { |
| 2119 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2120 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2121 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2122 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2123 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2124 | skipCall |= parameter_validation_vkCreateQueryPool(my_data->report_data, pCreateInfo, pAllocator, pQueryPool); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2125 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2126 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2127 | result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool); |
| 2128 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2129 | validate_result(my_data->report_data, "vkCreateQueryPool", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2130 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2131 | |
| 2132 | return result; |
| 2133 | } |
| 2134 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2135 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2136 | vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2137 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2138 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2139 | assert(my_data != NULL); |
| 2140 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2141 | skipCall |= parameter_validation_vkDestroyQueryPool(my_data->report_data, queryPool, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2142 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2143 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2144 | get_dispatch_table(pc_device_table_map, device)->DestroyQueryPool(device, queryPool, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2145 | } |
| 2146 | } |
| 2147 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2148 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, |
| 2149 | uint32_t queryCount, size_t dataSize, void *pData, |
| 2150 | VkDeviceSize stride, VkQueryResultFlags flags) { |
| 2151 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2152 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2153 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2154 | assert(my_data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2155 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2156 | skipCall |= |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2157 | parameter_validation_vkGetQueryPoolResults(my_data->report_data, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2158 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2159 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2160 | result = get_dispatch_table(pc_device_table_map, device) |
| 2161 | ->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2162 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2163 | validate_result(my_data->report_data, "vkGetQueryPoolResults", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2164 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2165 | |
| 2166 | return result; |
| 2167 | } |
| 2168 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2169 | bool PreCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo) { |
| 2170 | if (pCreateInfo != nullptr) { |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2171 | if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { |
Mark Lobodzinski | 4789202 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 2172 | validate_queue_family_indices(device, "vkCreateBuffer", pCreateInfo->queueFamilyIndexCount, |
| 2173 | pCreateInfo->pQueueFamilyIndices); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2174 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2175 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2176 | |
| 2177 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2178 | } |
| 2179 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2180 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2181 | vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) { |
| 2182 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2183 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2184 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2185 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2186 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2187 | skipCall |= parameter_validation_vkCreateBuffer(my_data->report_data, pCreateInfo, pAllocator, pBuffer); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2188 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2189 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2190 | PreCreateBuffer(device, pCreateInfo); |
| 2191 | |
| 2192 | result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer); |
| 2193 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2194 | validate_result(my_data->report_data, "vkCreateBuffer", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2195 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2196 | |
| 2197 | return result; |
| 2198 | } |
| 2199 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2200 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2201 | vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2202 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2203 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2204 | assert(my_data != NULL); |
| 2205 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2206 | skipCall |= parameter_validation_vkDestroyBuffer(my_data->report_data, buffer, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2207 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2208 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2209 | get_dispatch_table(pc_device_table_map, device)->DestroyBuffer(device, buffer, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2210 | } |
| 2211 | } |
| 2212 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2213 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, |
| 2214 | const VkAllocationCallbacks *pAllocator, VkBufferView *pView) { |
| 2215 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2216 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2217 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2218 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2219 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2220 | skipCall |= parameter_validation_vkCreateBufferView(my_data->report_data, pCreateInfo, pAllocator, pView); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2221 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2222 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2223 | result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pAllocator, pView); |
| 2224 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2225 | validate_result(my_data->report_data, "vkCreateBufferView", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2226 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2227 | |
| 2228 | return result; |
| 2229 | } |
| 2230 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2231 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2232 | vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2233 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2234 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2235 | assert(my_data != NULL); |
| 2236 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2237 | skipCall |= parameter_validation_vkDestroyBufferView(my_data->report_data, bufferView, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2238 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2239 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2240 | get_dispatch_table(pc_device_table_map, device)->DestroyBufferView(device, bufferView, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2241 | } |
| 2242 | } |
| 2243 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2244 | bool PreCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo) { |
| 2245 | if (pCreateInfo != nullptr) { |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2246 | if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { |
Mark Lobodzinski | 4789202 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 2247 | validate_queue_family_indices(device, "vkCreateImage", pCreateInfo->queueFamilyIndexCount, |
| 2248 | pCreateInfo->pQueueFamilyIndices); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2249 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2250 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2251 | |
| 2252 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2253 | } |
| 2254 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2255 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2256 | vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage) { |
| 2257 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2258 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2259 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2260 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2261 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2262 | skipCall |= parameter_validation_vkCreateImage(my_data->report_data, pCreateInfo, pAllocator, pImage); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2263 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2264 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2265 | PreCreateImage(device, pCreateInfo); |
| 2266 | |
| 2267 | result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pAllocator, pImage); |
| 2268 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2269 | validate_result(my_data->report_data, "vkCreateImage", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2270 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2271 | |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2272 | return result; |
| 2273 | } |
| 2274 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2275 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2276 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2277 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2278 | assert(my_data != NULL); |
| 2279 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2280 | skipCall |= parameter_validation_vkDestroyImage(my_data->report_data, image, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2281 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2282 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2283 | get_dispatch_table(pc_device_table_map, device)->DestroyImage(device, image, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2284 | } |
| 2285 | } |
| 2286 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2287 | bool PreGetImageSubresourceLayout(VkDevice device, const VkImageSubresource *pSubresource) { |
| 2288 | if (pSubresource != nullptr) { |
| 2289 | if ((pSubresource->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 2290 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 2291 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 2292 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspectMask, is an unrecognized enumerator"); |
| 2293 | return false; |
| 2294 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2295 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2296 | |
| 2297 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2298 | } |
| 2299 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2300 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2301 | vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2302 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2303 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2304 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2305 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2306 | skipCall |= parameter_validation_vkGetImageSubresourceLayout(my_data->report_data, image, pSubresource, pLayout); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2307 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2308 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2309 | PreGetImageSubresourceLayout(device, pSubresource); |
| 2310 | |
| 2311 | get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2312 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2313 | } |
| 2314 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2315 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, |
| 2316 | const VkAllocationCallbacks *pAllocator, VkImageView *pView) { |
| 2317 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2318 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2319 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2320 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2321 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2322 | skipCall |= parameter_validation_vkCreateImageView(my_data->report_data, pCreateInfo, pAllocator, pView); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2323 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2324 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2325 | result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pAllocator, pView); |
| 2326 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2327 | validate_result(my_data->report_data, "vkCreateImageView", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2328 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2329 | |
| 2330 | return result; |
| 2331 | } |
| 2332 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2333 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2334 | vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2335 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2336 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2337 | assert(my_data != NULL); |
| 2338 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2339 | skipCall |= parameter_validation_vkDestroyImageView(my_data->report_data, imageView, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2340 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2341 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2342 | get_dispatch_table(pc_device_table_map, device)->DestroyImageView(device, imageView, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2343 | } |
| 2344 | } |
| 2345 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2346 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, |
| 2347 | const VkAllocationCallbacks *pAllocator, |
| 2348 | VkShaderModule *pShaderModule) { |
| 2349 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2350 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2351 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2352 | assert(my_data != NULL); |
| 2353 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2354 | skipCall |= parameter_validation_vkCreateShaderModule(my_data->report_data, pCreateInfo, pAllocator, pShaderModule); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2355 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2356 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2357 | result = |
| 2358 | get_dispatch_table(pc_device_table_map, device)->CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2359 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2360 | validate_result(my_data->report_data, "vkCreateShaderModule", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2361 | } |
| 2362 | |
Michael Lentine | 6715e52 | 2015-09-15 14:59:14 -0500 | [diff] [blame] | 2363 | return result; |
| 2364 | } |
| 2365 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2366 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2367 | vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2368 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2369 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2370 | assert(my_data != NULL); |
| 2371 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2372 | skipCall |= parameter_validation_vkDestroyShaderModule(my_data->report_data, shaderModule, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2373 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2374 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2375 | get_dispatch_table(pc_device_table_map, device)->DestroyShaderModule(device, shaderModule, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2376 | } |
| 2377 | } |
| 2378 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2379 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, |
| 2380 | const VkAllocationCallbacks *pAllocator, |
| 2381 | VkPipelineCache *pPipelineCache) { |
| 2382 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2383 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2384 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2385 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2386 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2387 | skipCall |= parameter_validation_vkCreatePipelineCache(my_data->report_data, pCreateInfo, pAllocator, pPipelineCache); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2388 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2389 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2390 | result = |
| 2391 | get_dispatch_table(pc_device_table_map, device)->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2392 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2393 | validate_result(my_data->report_data, "vkCreatePipelineCache", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2394 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2395 | |
| 2396 | return result; |
| 2397 | } |
| 2398 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2399 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2400 | vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2401 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2402 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2403 | assert(my_data != NULL); |
| 2404 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2405 | skipCall |= parameter_validation_vkDestroyPipelineCache(my_data->report_data, pipelineCache, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2406 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2407 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2408 | get_dispatch_table(pc_device_table_map, device)->DestroyPipelineCache(device, pipelineCache, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2409 | } |
| 2410 | } |
| 2411 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2412 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2413 | vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData) { |
| 2414 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2415 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2416 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2417 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2418 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2419 | skipCall |= parameter_validation_vkGetPipelineCacheData(my_data->report_data, pipelineCache, pDataSize, pData); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2420 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2421 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2422 | result = get_dispatch_table(pc_device_table_map, device)->GetPipelineCacheData(device, pipelineCache, pDataSize, pData); |
| 2423 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2424 | validate_result(my_data->report_data, "vkGetPipelineCacheData", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2425 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2426 | |
| 2427 | return result; |
| 2428 | } |
| 2429 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2430 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2431 | vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches) { |
| 2432 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2433 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2434 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2435 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2436 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2437 | skipCall |= parameter_validation_vkMergePipelineCaches(my_data->report_data, dstCache, srcCacheCount, pSrcCaches); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2438 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2439 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2440 | result = get_dispatch_table(pc_device_table_map, device)->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches); |
| 2441 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2442 | validate_result(my_data->report_data, "vkMergePipelineCaches", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2443 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2444 | |
| 2445 | return result; |
| 2446 | } |
| 2447 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2448 | bool PreCreateGraphicsPipelines(VkDevice device, const VkGraphicsPipelineCreateInfo *pCreateInfos) { |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 2449 | layer_data *data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2450 | |
| 2451 | // TODO: Handle count |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2452 | if (pCreateInfos != nullptr) { |
| 2453 | if (pCreateInfos->flags | VK_PIPELINE_CREATE_DERIVATIVE_BIT) { |
| 2454 | if (pCreateInfos->basePipelineIndex != -1) { |
| 2455 | if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { |
| 2456 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 2457 | "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineHandle, must be VK_NULL_HANDLE if " |
| 2458 | "pCreateInfos->flags " |
| 2459 | "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineIndex is not -1"); |
| 2460 | return false; |
| 2461 | } |
| 2462 | } |
| 2463 | |
| 2464 | if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { |
| 2465 | if (pCreateInfos->basePipelineIndex != -1) { |
| 2466 | log_msg( |
| 2467 | mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 2468 | "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineIndex, must be -1 if pCreateInfos->flags " |
| 2469 | "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineHandle is not " |
| 2470 | "VK_NULL_HANDLE"); |
| 2471 | return false; |
| 2472 | } |
Jeremy Hayes | d47367b | 2016-03-01 17:51:54 -0700 | [diff] [blame] | 2473 | } |
| 2474 | } |
| 2475 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2476 | if (pCreateInfos->pRasterizationState != nullptr) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2477 | if (pCreateInfos->pRasterizationState->cullMode & ~VK_CULL_MODE_FRONT_AND_BACK) { |
| 2478 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 2479 | "vkCreateGraphicsPipelines parameter, VkCullMode pCreateInfos->pRasterizationState->cullMode, is an " |
| 2480 | "unrecognized enumerator"); |
| 2481 | return false; |
| 2482 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2483 | } |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2484 | if (pCreateInfos->renderPass == VK_NULL_HANDLE) { |
| 2485 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 2486 | "vkCreateGraphicsPipelines parameter, VkRenderPass pCreateInfos->renderPass, is null pointer"); |
| 2487 | } |
Jeremy Hayes | d47367b | 2016-03-01 17:51:54 -0700 | [diff] [blame] | 2488 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2489 | int i = 0; |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2490 | for (size_t j = 0; j < pCreateInfos[i].stageCount; j++) { |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 2491 | validate_string(data->report_data, "vkCreateGraphicsPipelines", "pCreateInfos[i].pStages[j].pName", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2492 | pCreateInfos[i].pStages[j].pName); |
| 2493 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2494 | } |
| 2495 | |
| 2496 | return true; |
| 2497 | } |
| 2498 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2499 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2500 | vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 2501 | const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, |
| 2502 | VkPipeline *pPipelines) { |
| 2503 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2504 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2505 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2506 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2507 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2508 | skipCall |= parameter_validation_vkCreateGraphicsPipelines(my_data->report_data, pipelineCache, createInfoCount, pCreateInfos, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2509 | pAllocator, pPipelines); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2510 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2511 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2512 | PreCreateGraphicsPipelines(device, pCreateInfos); |
| 2513 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2514 | result = get_dispatch_table(pc_device_table_map, device) |
| 2515 | ->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2516 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2517 | validate_result(my_data->report_data, "vkCreateGraphicsPipelines", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2518 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2519 | |
| 2520 | return result; |
| 2521 | } |
| 2522 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2523 | bool PreCreateComputePipelines(VkDevice device, const VkComputePipelineCreateInfo *pCreateInfos) { |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 2524 | layer_data *data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2525 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2526 | if (pCreateInfos != nullptr) { |
| 2527 | // TODO: Handle count! |
| 2528 | int i = 0; |
Dustin Graves | 0a8fda5 | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 2529 | validate_string(data->report_data, "vkCreateComputePipelines", "pCreateInfos[i].stage.pName", pCreateInfos[i].stage.pName); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2530 | } |
| 2531 | |
| 2532 | return true; |
| 2533 | } |
| 2534 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2535 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2536 | vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 2537 | const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, |
| 2538 | VkPipeline *pPipelines) { |
| 2539 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2540 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2541 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2542 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2543 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2544 | skipCall |= parameter_validation_vkCreateComputePipelines(my_data->report_data, pipelineCache, createInfoCount, pCreateInfos, pAllocator, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2545 | pPipelines); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2546 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2547 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2548 | PreCreateComputePipelines(device, pCreateInfos); |
| 2549 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2550 | result = get_dispatch_table(pc_device_table_map, device) |
| 2551 | ->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2552 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2553 | validate_result(my_data->report_data, "vkCreateComputePipelines", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2554 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2555 | |
| 2556 | return result; |
| 2557 | } |
| 2558 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2559 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2560 | vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2561 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2562 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2563 | assert(my_data != NULL); |
| 2564 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2565 | skipCall |= parameter_validation_vkDestroyPipeline(my_data->report_data, pipeline, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2566 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2567 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2568 | get_dispatch_table(pc_device_table_map, device)->DestroyPipeline(device, pipeline, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2569 | } |
| 2570 | } |
| 2571 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2572 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2573 | vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
| 2574 | VkPipelineLayout *pPipelineLayout) { |
| 2575 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2576 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2577 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2578 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2579 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2580 | skipCall |= parameter_validation_vkCreatePipelineLayout(my_data->report_data, pCreateInfo, pAllocator, pPipelineLayout); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2581 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2582 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2583 | result = |
| 2584 | get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2585 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2586 | validate_result(my_data->report_data, "vkCreatePipelineLayout", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2587 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2588 | |
| 2589 | return result; |
| 2590 | } |
| 2591 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2592 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2593 | vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2594 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2595 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2596 | assert(my_data != NULL); |
| 2597 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2598 | skipCall |= parameter_validation_vkDestroyPipelineLayout(my_data->report_data, pipelineLayout, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2599 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2600 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2601 | get_dispatch_table(pc_device_table_map, device)->DestroyPipelineLayout(device, pipelineLayout, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2602 | } |
| 2603 | } |
| 2604 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2605 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, |
| 2606 | const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) { |
| 2607 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2608 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2609 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2610 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2611 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2612 | skipCall |= parameter_validation_vkCreateSampler(my_data->report_data, pCreateInfo, pAllocator, pSampler); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2613 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2614 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2615 | result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pAllocator, pSampler); |
| 2616 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2617 | validate_result(my_data->report_data, "vkCreateSampler", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2618 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2619 | |
| 2620 | return result; |
| 2621 | } |
| 2622 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2623 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2624 | vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2625 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2626 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2627 | assert(my_data != NULL); |
| 2628 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2629 | skipCall |= parameter_validation_vkDestroySampler(my_data->report_data, sampler, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2630 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2631 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2632 | get_dispatch_table(pc_device_table_map, device)->DestroySampler(device, sampler, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2633 | } |
| 2634 | } |
| 2635 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2636 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2637 | vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, |
| 2638 | const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout) { |
| 2639 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2640 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2641 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2642 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2643 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2644 | skipCall |= parameter_validation_vkCreateDescriptorSetLayout(my_data->report_data, pCreateInfo, pAllocator, pSetLayout); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2645 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2646 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2647 | result = |
| 2648 | get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2649 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2650 | validate_result(my_data->report_data, "vkCreateDescriptorSetLayout", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2651 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2652 | |
| 2653 | return result; |
| 2654 | } |
| 2655 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2656 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2657 | vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2658 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2659 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2660 | assert(my_data != NULL); |
| 2661 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2662 | skipCall |= parameter_validation_vkDestroyDescriptorSetLayout(my_data->report_data, descriptorSetLayout, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2663 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2664 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2665 | get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2666 | } |
| 2667 | } |
| 2668 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2669 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2670 | vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
| 2671 | VkDescriptorPool *pDescriptorPool) { |
| 2672 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2673 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2674 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2675 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2676 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2677 | skipCall |= parameter_validation_vkCreateDescriptorPool(my_data->report_data, pCreateInfo, pAllocator, pDescriptorPool); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2678 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2679 | /* TODOVV: How do we validate maxSets? Probably belongs in the limits layer? */ |
| 2680 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2681 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2682 | result = |
| 2683 | get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2684 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2685 | validate_result(my_data->report_data, "vkCreateDescriptorPool", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2686 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2687 | |
| 2688 | return result; |
| 2689 | } |
| 2690 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2691 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2692 | vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2693 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2694 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2695 | assert(my_data != NULL); |
| 2696 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2697 | skipCall |= parameter_validation_vkDestroyDescriptorPool(my_data->report_data, descriptorPool, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2698 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2699 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2700 | get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorPool(device, descriptorPool, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2701 | } |
| 2702 | } |
| 2703 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2704 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2705 | vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2706 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2707 | assert(my_data != NULL); |
| 2708 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 2709 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool, flags); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2710 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2711 | validate_result(my_data->report_data, "vkResetDescriptorPool", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2712 | |
| 2713 | return result; |
| 2714 | } |
| 2715 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2716 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2717 | vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets) { |
| 2718 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2719 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2720 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2721 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2722 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2723 | skipCall |= parameter_validation_vkAllocateDescriptorSets(my_data->report_data, pAllocateInfo, pDescriptorSets); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2724 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2725 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2726 | result = get_dispatch_table(pc_device_table_map, device)->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); |
| 2727 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2728 | validate_result(my_data->report_data, "vkAllocateDescriptorSets", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2729 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2730 | |
| 2731 | return result; |
| 2732 | } |
| 2733 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2734 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, |
| 2735 | uint32_t descriptorSetCount, |
| 2736 | const VkDescriptorSet *pDescriptorSets) { |
| 2737 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2738 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2739 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2740 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2741 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2742 | skipCall |= parameter_validation_vkFreeDescriptorSets(my_data->report_data, descriptorPool, descriptorSetCount, pDescriptorSets); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2743 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2744 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2745 | result = get_dispatch_table(pc_device_table_map, device) |
| 2746 | ->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2747 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2748 | validate_result(my_data->report_data, "vkFreeDescriptorSets", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2749 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2750 | |
| 2751 | return result; |
| 2752 | } |
| 2753 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2754 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2755 | vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, |
| 2756 | uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2757 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2758 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2759 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2760 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2761 | skipCall |= parameter_validation_vkUpdateDescriptorSets(my_data->report_data, descriptorWriteCount, pDescriptorWrites, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2762 | descriptorCopyCount, pDescriptorCopies); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2763 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2764 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2765 | get_dispatch_table(pc_device_table_map, device) |
| 2766 | ->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2767 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2768 | } |
| 2769 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2770 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, |
| 2771 | const VkAllocationCallbacks *pAllocator, |
| 2772 | VkFramebuffer *pFramebuffer) { |
| 2773 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2774 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2775 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2776 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2777 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2778 | skipCall |= parameter_validation_vkCreateFramebuffer(my_data->report_data, pCreateInfo, pAllocator, pFramebuffer); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2779 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2780 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2781 | result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer); |
| 2782 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2783 | validate_result(my_data->report_data, "vkCreateFramebuffer", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2784 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2785 | |
| 2786 | return result; |
| 2787 | } |
| 2788 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2789 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2790 | vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2791 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2792 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2793 | assert(my_data != NULL); |
| 2794 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2795 | skipCall |= parameter_validation_vkDestroyFramebuffer(my_data->report_data, framebuffer, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2796 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2797 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2798 | get_dispatch_table(pc_device_table_map, device)->DestroyFramebuffer(device, framebuffer, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2799 | } |
| 2800 | } |
| 2801 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2802 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, |
| 2803 | const VkAllocationCallbacks *pAllocator, |
| 2804 | VkRenderPass *pRenderPass) { |
| 2805 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2806 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2807 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2808 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2809 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2810 | skipCall |= parameter_validation_vkCreateRenderPass(my_data->report_data, pCreateInfo, pAllocator, pRenderPass); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2811 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2812 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2813 | result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); |
| 2814 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2815 | validate_result(my_data->report_data, "vkCreateRenderPass", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2816 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2817 | |
| 2818 | return result; |
| 2819 | } |
| 2820 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2821 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2822 | vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2823 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2824 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2825 | assert(my_data != NULL); |
| 2826 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2827 | skipCall |= parameter_validation_vkDestroyRenderPass(my_data->report_data, renderPass, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2828 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2829 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2830 | get_dispatch_table(pc_device_table_map, device)->DestroyRenderPass(device, renderPass, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2831 | } |
| 2832 | } |
| 2833 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2834 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2835 | vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2836 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2837 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2838 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2839 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2840 | skipCall |= parameter_validation_vkGetRenderAreaGranularity(my_data->report_data, renderPass, pGranularity); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2841 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2842 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2843 | get_dispatch_table(pc_device_table_map, device)->GetRenderAreaGranularity(device, renderPass, pGranularity); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2844 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2845 | } |
| 2846 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2847 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, |
| 2848 | const VkAllocationCallbacks *pAllocator, |
| 2849 | VkCommandPool *pCommandPool) { |
| 2850 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | 4789202 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 2851 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2852 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2853 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2854 | |
Mark Lobodzinski | 4789202 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 2855 | skipCall |= validate_queue_family_indices(device, "vkCreateCommandPool", 1, &(pCreateInfo->queueFamilyIndex)); |
| 2856 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2857 | skipCall |= parameter_validation_vkCreateCommandPool(my_data->report_data, pCreateInfo, pAllocator, pCommandPool); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2858 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2859 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2860 | result = get_dispatch_table(pc_device_table_map, device)->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); |
| 2861 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2862 | validate_result(my_data->report_data, "vkCreateCommandPool", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2863 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2864 | |
| 2865 | return result; |
| 2866 | } |
| 2867 | |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2868 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2869 | vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2870 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2871 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2872 | assert(my_data != NULL); |
| 2873 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2874 | skipCall |= parameter_validation_vkDestroyCommandPool(my_data->report_data, commandPool, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2875 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2876 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2877 | get_dispatch_table(pc_device_table_map, device)->DestroyCommandPool(device, commandPool, pAllocator); |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2878 | } |
| 2879 | } |
| 2880 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2881 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2882 | vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2883 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2884 | assert(my_data != NULL); |
| 2885 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 2886 | VkResult result = get_dispatch_table(pc_device_table_map, device)->ResetCommandPool(device, commandPool, flags); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2887 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2888 | validate_result(my_data->report_data, "vkResetCommandPool", result); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2889 | |
| 2890 | return result; |
| 2891 | } |
| 2892 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2893 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2894 | vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers) { |
| 2895 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2896 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2897 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2898 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2899 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2900 | skipCall |= parameter_validation_vkAllocateCommandBuffers(my_data->report_data, pAllocateInfo, pCommandBuffers); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2901 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2902 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2903 | result = get_dispatch_table(pc_device_table_map, device)->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers); |
| 2904 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2905 | validate_result(my_data->report_data, "vkAllocateCommandBuffers", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2906 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2907 | |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2908 | return result; |
| 2909 | } |
| 2910 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2911 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, |
| 2912 | uint32_t commandBufferCount, |
| 2913 | const VkCommandBuffer *pCommandBuffers) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2914 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2915 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | cfdbfae | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 2916 | assert(my_data != NULL); |
| 2917 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2918 | skipCall |= parameter_validation_vkFreeCommandBuffers(my_data->report_data, commandPool, commandBufferCount, pCommandBuffers); |
Dustin Graves | cfdbfae | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 2919 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2920 | if (!skipCall) { |
Dustin Graves | cfdbfae | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 2921 | get_dispatch_table(pc_device_table_map, device) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2922 | ->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); |
Dustin Graves | cfdbfae | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 2923 | } |
| 2924 | } |
| 2925 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2926 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2927 | vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) { |
| 2928 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2929 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2930 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2931 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2932 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2933 | skipCall |= parameter_validation_vkBeginCommandBuffer(my_data->report_data, pBeginInfo); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2934 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2935 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2936 | result = get_dispatch_table(pc_device_table_map, commandBuffer)->BeginCommandBuffer(commandBuffer, pBeginInfo); |
| 2937 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2938 | validate_result(my_data->report_data, "vkBeginCommandBuffer", result); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2939 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2940 | |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2941 | return result; |
| 2942 | } |
| 2943 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2944 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2945 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 2946 | assert(my_data != NULL); |
| 2947 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 2948 | VkResult result = get_dispatch_table(pc_device_table_map, commandBuffer)->EndCommandBuffer(commandBuffer); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2949 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2950 | validate_result(my_data->report_data, "vkEndCommandBuffer", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2951 | |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2952 | return result; |
| 2953 | } |
| 2954 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2955 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2956 | vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) { |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2957 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 2958 | assert(my_data != NULL); |
| 2959 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 2960 | VkResult result = get_dispatch_table(pc_device_table_map, commandBuffer)->ResetCommandBuffer(commandBuffer, flags); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2961 | |
Dustin Graves | e78276b | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2962 | validate_result(my_data->report_data, "vkResetCommandBuffer", result); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2963 | |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2964 | return result; |
| 2965 | } |
| 2966 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2967 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2968 | vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2969 | bool skipCall = false; |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2970 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 2971 | assert(my_data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2972 | |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2973 | skipCall |= parameter_validation_vkCmdBindPipeline(my_data->report_data, pipelineBindPoint, pipeline); |
| 2974 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2975 | if (!skipCall) { |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2976 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); |
| 2977 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2978 | } |
| 2979 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2980 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2981 | vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2982 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2983 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2984 | assert(my_data != NULL); |
| 2985 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2986 | skipCall |= parameter_validation_vkCmdSetViewport(my_data->report_data, firstViewport, viewportCount, pViewports); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2987 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2988 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2989 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 2990 | ->CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2991 | } |
Courtney Goeltzenleuchter | 932cdb5 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 2992 | } |
| 2993 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2994 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2995 | vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2996 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2997 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2998 | assert(my_data != NULL); |
| 2999 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3000 | skipCall |= parameter_validation_vkCmdSetScissor(my_data->report_data, firstScissor, scissorCount, pScissors); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3001 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3002 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3003 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors); |
| 3004 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3005 | } |
| 3006 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3007 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3008 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetLineWidth(commandBuffer, lineWidth); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3009 | } |
| 3010 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3011 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3012 | vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) { |
| 3013 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3014 | ->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3015 | } |
| 3016 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3017 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3018 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3019 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3020 | assert(my_data != NULL); |
| 3021 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3022 | skipCall |= parameter_validation_vkCmdSetBlendConstants(my_data->report_data, blendConstants); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3023 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3024 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3025 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetBlendConstants(commandBuffer, blendConstants); |
| 3026 | } |
Cody Northrop | f5bd225 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 3027 | } |
| 3028 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3029 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3030 | vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3031 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds); |
Cody Northrop | f5bd225 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 3032 | } |
| 3033 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3034 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3035 | vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3036 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3037 | } |
| 3038 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3039 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3040 | vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3041 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3042 | } |
| 3043 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3044 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3045 | vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3046 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilReference(commandBuffer, faceMask, reference); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3047 | } |
| 3048 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3049 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3050 | vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, |
| 3051 | uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, |
| 3052 | uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3053 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3054 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3055 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3056 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3057 | skipCall |= parameter_validation_vkCmdBindDescriptorSets(my_data->report_data, pipelineBindPoint, layout, firstSet, descriptorSetCount, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3058 | pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3059 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3060 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3061 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3062 | ->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, |
| 3063 | dynamicOffsetCount, pDynamicOffsets); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3064 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3065 | } |
| 3066 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3067 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3068 | vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3069 | bool skipCall = false; |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3070 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3071 | assert(my_data != NULL); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3072 | |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3073 | skipCall |= parameter_validation_vkCmdBindIndexBuffer(my_data->report_data, buffer, offset, indexType); |
| 3074 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3075 | if (!skipCall) { |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3076 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType); |
| 3077 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3078 | } |
| 3079 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3080 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, |
| 3081 | uint32_t bindingCount, const VkBuffer *pBuffers, |
| 3082 | const VkDeviceSize *pOffsets) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3083 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3084 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3085 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3086 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3087 | skipCall |= parameter_validation_vkCmdBindVertexBuffers(my_data->report_data, firstBinding, bindingCount, pBuffers, pOffsets); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3088 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3089 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3090 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3091 | ->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3092 | } |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3093 | } |
| 3094 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3095 | bool PreCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, |
| 3096 | uint32_t firstInstance) { |
Michael Lentine | 0f480e6 | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 3097 | if (vertexCount == 0) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3098 | // TODO: Verify against Valid Usage section. I don't see a non-zero vertexCount listed, may need to add that and make |
Courtney Goeltzenleuchter | acb1359 | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 3099 | // this an error or leave as is. |
Mark Lobodzinski | 5c13d4d | 2016-02-11 09:26:16 -0700 | [diff] [blame] | 3100 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_WARNING_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3101 | "vkCmdDraw parameter, uint32_t vertexCount, is 0"); |
Michael Lentine | 0f480e6 | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 3102 | return false; |
| 3103 | } |
| 3104 | |
| 3105 | if (instanceCount == 0) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3106 | // TODO: Verify against Valid Usage section. I don't see a non-zero instanceCount listed, may need to add that and make |
Courtney Goeltzenleuchter | acb1359 | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 3107 | // this an error or leave as is. |
Mark Lobodzinski | 5c13d4d | 2016-02-11 09:26:16 -0700 | [diff] [blame] | 3108 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_WARNING_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3109 | "vkCmdDraw parameter, uint32_t instanceCount, is 0"); |
Michael Lentine | 0f480e6 | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 3110 | return false; |
| 3111 | } |
| 3112 | |
| 3113 | return true; |
| 3114 | } |
| 3115 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3116 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, |
| 3117 | uint32_t firstVertex, uint32_t firstInstance) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3118 | PreCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
Michael Lentine | 0f480e6 | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 3119 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3120 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3121 | ->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3122 | } |
| 3123 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3124 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, |
| 3125 | uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, |
| 3126 | uint32_t firstInstance) { |
| 3127 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3128 | ->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3129 | } |
| 3130 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3131 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3132 | vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3133 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDrawIndirect(commandBuffer, buffer, offset, count, stride); |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3134 | } |
| 3135 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3136 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3137 | vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3138 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, count, stride); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3139 | } |
| 3140 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3141 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3142 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDispatch(commandBuffer, x, y, z); |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3143 | } |
| 3144 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3145 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3146 | vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3147 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDispatchIndirect(commandBuffer, buffer, offset); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3148 | } |
| 3149 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3150 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, |
| 3151 | uint32_t regionCount, const VkBufferCopy *pRegions) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3152 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3153 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3154 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3155 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3156 | skipCall |= parameter_validation_vkCmdCopyBuffer(my_data->report_data, srcBuffer, dstBuffer, regionCount, pRegions); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3157 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3158 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3159 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3160 | ->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3161 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3162 | } |
| 3163 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3164 | bool PreCmdCopyImage(VkCommandBuffer commandBuffer, const VkImageCopy *pRegions) { |
| 3165 | if (pRegions != nullptr) { |
| 3166 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3167 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3168 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 3169 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
| 3170 | return false; |
| 3171 | } |
| 3172 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3173 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3174 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 3175 | "vkCmdCopyImage parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
| 3176 | return false; |
| 3177 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3178 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3179 | |
| 3180 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3181 | } |
| 3182 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3183 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3184 | vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 3185 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3186 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3187 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3188 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3189 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3190 | skipCall |= |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3191 | parameter_validation_vkCmdCopyImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3192 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3193 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3194 | PreCmdCopyImage(commandBuffer, pRegions); |
| 3195 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3196 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3197 | ->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3198 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3199 | } |
| 3200 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3201 | bool PreCmdBlitImage(VkCommandBuffer commandBuffer, const VkImageBlit *pRegions) { |
| 3202 | if (pRegions != nullptr) { |
| 3203 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3204 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3205 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 3206 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
| 3207 | return false; |
| 3208 | } |
| 3209 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3210 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3211 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 3212 | "vkCmdCopyImage parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
| 3213 | return false; |
| 3214 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3215 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3216 | |
| 3217 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3218 | } |
| 3219 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3220 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3221 | vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 3222 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3223 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3224 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3225 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3226 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3227 | skipCall |= parameter_validation_vkCmdBlitImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3228 | pRegions, filter); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3229 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3230 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3231 | PreCmdBlitImage(commandBuffer, pRegions); |
| 3232 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3233 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3234 | ->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3235 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3236 | } |
| 3237 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3238 | bool PreCmdCopyBufferToImage(VkCommandBuffer commandBuffer, const VkBufferImageCopy *pRegions) { |
| 3239 | if (pRegions != nullptr) { |
| 3240 | if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3241 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3242 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 3243 | "vkCmdCopyBufferToImage parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " |
| 3244 | "enumerator"); |
| 3245 | return false; |
| 3246 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3247 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3248 | |
| 3249 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3250 | } |
| 3251 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3252 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, |
| 3253 | VkImage dstImage, VkImageLayout dstImageLayout, |
| 3254 | uint32_t regionCount, const VkBufferImageCopy *pRegions) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3255 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3256 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3257 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3258 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3259 | skipCall |= |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3260 | parameter_validation_vkCmdCopyBufferToImage(my_data->report_data, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3261 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3262 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3263 | PreCmdCopyBufferToImage(commandBuffer, pRegions); |
| 3264 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3265 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3266 | ->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3267 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3268 | } |
| 3269 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3270 | bool PreCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, const VkBufferImageCopy *pRegions) { |
| 3271 | if (pRegions != nullptr) { |
| 3272 | if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3273 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3274 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 3275 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " |
| 3276 | "enumerator"); |
| 3277 | return false; |
| 3278 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3279 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3280 | |
| 3281 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3282 | } |
| 3283 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3284 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, |
| 3285 | VkImageLayout srcImageLayout, VkBuffer dstBuffer, |
| 3286 | uint32_t regionCount, const VkBufferImageCopy *pRegions) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3287 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3288 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3289 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3290 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3291 | skipCall |= |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3292 | parameter_validation_vkCmdCopyImageToBuffer(my_data->report_data, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3293 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3294 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3295 | PreCmdCopyImageToBuffer(commandBuffer, pRegions); |
| 3296 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3297 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3298 | ->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3299 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3300 | } |
| 3301 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3302 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, |
| 3303 | VkDeviceSize dstOffset, VkDeviceSize dataSize, const uint32_t *pData) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3304 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3305 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3306 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3307 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3308 | skipCall |= parameter_validation_vkCmdUpdateBuffer(my_data->report_data, dstBuffer, dstOffset, dataSize, pData); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3309 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3310 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3311 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3312 | ->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3313 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3314 | } |
| 3315 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3316 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3317 | vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3318 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3319 | } |
| 3320 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3321 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, |
| 3322 | VkImageLayout imageLayout, const VkClearColorValue *pColor, |
| 3323 | uint32_t rangeCount, const VkImageSubresourceRange *pRanges) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3324 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3325 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3326 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3327 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3328 | skipCall |= parameter_validation_vkCmdClearColorImage(my_data->report_data, image, imageLayout, pColor, rangeCount, pRanges); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3329 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3330 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3331 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3332 | ->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3333 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3334 | } |
| 3335 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3336 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3337 | vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 3338 | const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, |
| 3339 | const VkImageSubresourceRange *pRanges) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3340 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3341 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3342 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3343 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3344 | skipCall |= |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3345 | parameter_validation_vkCmdClearDepthStencilImage(my_data->report_data, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3346 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3347 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3348 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3349 | ->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3350 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3351 | } |
| 3352 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3353 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, |
| 3354 | const VkClearAttachment *pAttachments, uint32_t rectCount, |
| 3355 | const VkClearRect *pRects) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3356 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3357 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3358 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3359 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3360 | skipCall |= parameter_validation_vkCmdClearAttachments(my_data->report_data, attachmentCount, pAttachments, rectCount, pRects); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3361 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3362 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3363 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3364 | ->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3365 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3366 | } |
| 3367 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3368 | bool PreCmdResolveImage(VkCommandBuffer commandBuffer, const VkImageResolve *pRegions) { |
| 3369 | if (pRegions != nullptr) { |
| 3370 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3371 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3372 | log_msg( |
| 3373 | mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 3374 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
| 3375 | return false; |
| 3376 | } |
| 3377 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3378 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3379 | log_msg( |
| 3380 | mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, "PARAMCHECK", |
| 3381 | "vkCmdResolveImage parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
| 3382 | return false; |
| 3383 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3384 | } |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3385 | |
| 3386 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3387 | } |
| 3388 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3389 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3390 | vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 3391 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3392 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3393 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3394 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3395 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3396 | skipCall |= parameter_validation_vkCmdResolveImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3397 | pRegions); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3398 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3399 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3400 | PreCmdResolveImage(commandBuffer, pRegions); |
| 3401 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3402 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3403 | ->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3404 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3405 | } |
| 3406 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3407 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3408 | vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3409 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetEvent(commandBuffer, event, stageMask); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3410 | } |
| 3411 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3412 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3413 | vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3414 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdResetEvent(commandBuffer, event, stageMask); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3415 | } |
| 3416 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3417 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3418 | vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, |
| 3419 | VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 3420 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 3421 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3422 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3423 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3424 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3425 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3426 | skipCall |= parameter_validation_vkCmdWaitEvents(my_data->report_data, eventCount, pEvents, srcStageMask, dstStageMask, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3427 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, |
| 3428 | imageMemoryBarrierCount, pImageMemoryBarriers); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3429 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3430 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3431 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3432 | ->CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, |
| 3433 | bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3434 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3435 | } |
| 3436 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3437 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3438 | vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, |
| 3439 | VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 3440 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 3441 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3442 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3443 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3444 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3445 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3446 | skipCall |= parameter_validation_vkCmdPipelineBarrier(my_data->report_data, srcStageMask, dstStageMask, dependencyFlags, |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3447 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, |
| 3448 | pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3449 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3450 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3451 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3452 | ->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, |
| 3453 | bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3454 | } |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3455 | } |
| 3456 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3457 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3458 | vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3459 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBeginQuery(commandBuffer, queryPool, slot, flags); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3460 | } |
| 3461 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3462 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3463 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdEndQuery(commandBuffer, queryPool, slot); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3464 | } |
| 3465 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3466 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3467 | vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3468 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3469 | } |
| 3470 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3471 | bool PostCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, |
| 3472 | uint32_t slot) { |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3473 | |
Chia-I Wu | 59c215d | 2015-10-26 19:40:27 +0800 | [diff] [blame] | 3474 | ValidateEnumerator(pipelineStage); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3475 | |
| 3476 | return true; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3477 | } |
| 3478 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3479 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3480 | vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t slot) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3481 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3482 | |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 3483 | PostCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3484 | } |
| 3485 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3486 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3487 | vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, |
| 3488 | VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) { |
| 3489 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3490 | ->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3491 | } |
| 3492 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3493 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, |
| 3494 | VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, |
| 3495 | const void *pValues) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3496 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3497 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3498 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3499 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3500 | skipCall |= parameter_validation_vkCmdPushConstants(my_data->report_data, layout, stageFlags, offset, size, pValues); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3501 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3502 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3503 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3504 | ->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3505 | } |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3506 | } |
| 3507 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3508 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3509 | vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3510 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3511 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3512 | assert(my_data != NULL); |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3513 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3514 | skipCall |= parameter_validation_vkCmdBeginRenderPass(my_data->report_data, pRenderPassBegin, contents); |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3515 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3516 | if (!skipCall) { |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3517 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3518 | } |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3519 | } |
| 3520 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3521 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3522 | bool skipCall = false; |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3523 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3524 | assert(my_data != NULL); |
Chia-I Wu | c278df8 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 3525 | |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3526 | skipCall |= parameter_validation_vkCmdNextSubpass(my_data->report_data, contents); |
| 3527 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3528 | if (!skipCall) { |
Dustin Graves | c3fc3d8 | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3529 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdNextSubpass(commandBuffer, contents); |
| 3530 | } |
Jeremy Hayes | e841fdc | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3531 | } |
| 3532 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3533 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer) { |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3534 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdEndRenderPass(commandBuffer); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3535 | } |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3536 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3537 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3538 | vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) { |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3539 | bool skipCall = false; |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3540 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3541 | assert(my_data != NULL); |
Jeremy Hayes | c27938e | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3542 | |
Mark Lobodzinski | 1c33357 | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3543 | skipCall |= parameter_validation_vkCmdExecuteCommands(my_data->report_data, commandBufferCount, pCommandBuffers); |
Chia-I Wu | 88eaa3b | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 3544 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3545 | if (!skipCall) { |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3546 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3547 | ->CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers); |
Dustin Graves | c87f31e | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3548 | } |
Jon Ashburn | 79b78ac | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 3549 | } |
| 3550 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3551 | VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *funcName) { |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 3552 | layer_data *data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 3553 | |
Dustin Graves | bb84994 | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3554 | if (validate_string(data->report_data, "vkGetDeviceProcAddr", "funcName", funcName)) { |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 3555 | return NULL; |
| 3556 | } |
| 3557 | |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3558 | if (!strcmp(funcName, "vkGetDeviceProcAddr")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3559 | return (PFN_vkVoidFunction)vkGetDeviceProcAddr; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3560 | if (!strcmp(funcName, "vkDestroyDevice")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3561 | return (PFN_vkVoidFunction)vkDestroyDevice; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3562 | if (!strcmp(funcName, "vkGetDeviceQueue")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3563 | return (PFN_vkVoidFunction)vkGetDeviceQueue; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3564 | if (!strcmp(funcName, "vkQueueSubmit")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3565 | return (PFN_vkVoidFunction)vkQueueSubmit; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3566 | if (!strcmp(funcName, "vkQueueWaitIdle")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3567 | return (PFN_vkVoidFunction)vkQueueWaitIdle; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3568 | if (!strcmp(funcName, "vkDeviceWaitIdle")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3569 | return (PFN_vkVoidFunction)vkDeviceWaitIdle; |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 3570 | if (!strcmp(funcName, "vkAllocateMemory")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3571 | return (PFN_vkVoidFunction)vkAllocateMemory; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3572 | if (!strcmp(funcName, "vkFreeMemory")) |
| 3573 | return (PFN_vkVoidFunction)vkFreeMemory; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3574 | if (!strcmp(funcName, "vkMapMemory")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3575 | return (PFN_vkVoidFunction)vkMapMemory; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3576 | if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3577 | return (PFN_vkVoidFunction)vkFlushMappedMemoryRanges; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3578 | if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3579 | return (PFN_vkVoidFunction)vkInvalidateMappedMemoryRanges; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3580 | if (!strcmp(funcName, "vkCreateFence")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3581 | return (PFN_vkVoidFunction)vkCreateFence; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3582 | if (!strcmp(funcName, "vkDestroyFence")) |
| 3583 | return (PFN_vkVoidFunction)vkDestroyFence; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3584 | if (!strcmp(funcName, "vkResetFences")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3585 | return (PFN_vkVoidFunction)vkResetFences; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3586 | if (!strcmp(funcName, "vkGetFenceStatus")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3587 | return (PFN_vkVoidFunction)vkGetFenceStatus; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3588 | if (!strcmp(funcName, "vkWaitForFences")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3589 | return (PFN_vkVoidFunction)vkWaitForFences; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3590 | if (!strcmp(funcName, "vkCreateSemaphore")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3591 | return (PFN_vkVoidFunction)vkCreateSemaphore; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3592 | if (!strcmp(funcName, "vkDestroySemaphore")) |
| 3593 | return (PFN_vkVoidFunction)vkDestroySemaphore; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3594 | if (!strcmp(funcName, "vkCreateEvent")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3595 | return (PFN_vkVoidFunction)vkCreateEvent; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3596 | if (!strcmp(funcName, "vkDestroyEvent")) |
| 3597 | return (PFN_vkVoidFunction)vkDestroyEvent; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3598 | if (!strcmp(funcName, "vkGetEventStatus")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3599 | return (PFN_vkVoidFunction)vkGetEventStatus; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3600 | if (!strcmp(funcName, "vkSetEvent")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3601 | return (PFN_vkVoidFunction)vkSetEvent; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3602 | if (!strcmp(funcName, "vkResetEvent")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3603 | return (PFN_vkVoidFunction)vkResetEvent; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3604 | if (!strcmp(funcName, "vkCreateQueryPool")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3605 | return (PFN_vkVoidFunction)vkCreateQueryPool; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3606 | if (!strcmp(funcName, "vkDestroyQueryPool")) |
| 3607 | return (PFN_vkVoidFunction)vkDestroyQueryPool; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3608 | if (!strcmp(funcName, "vkGetQueryPoolResults")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3609 | return (PFN_vkVoidFunction)vkGetQueryPoolResults; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3610 | if (!strcmp(funcName, "vkCreateBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3611 | return (PFN_vkVoidFunction)vkCreateBuffer; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3612 | if (!strcmp(funcName, "vkDestroyBuffer")) |
| 3613 | return (PFN_vkVoidFunction)vkDestroyBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3614 | if (!strcmp(funcName, "vkCreateBufferView")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3615 | return (PFN_vkVoidFunction)vkCreateBufferView; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3616 | if (!strcmp(funcName, "vkDestroyBufferView")) |
| 3617 | return (PFN_vkVoidFunction)vkDestroyBufferView; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3618 | if (!strcmp(funcName, "vkCreateImage")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3619 | return (PFN_vkVoidFunction)vkCreateImage; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3620 | if (!strcmp(funcName, "vkDestroyImage")) |
| 3621 | return (PFN_vkVoidFunction)vkDestroyImage; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3622 | if (!strcmp(funcName, "vkGetImageSubresourceLayout")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3623 | return (PFN_vkVoidFunction)vkGetImageSubresourceLayout; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3624 | if (!strcmp(funcName, "vkCreateImageView")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3625 | return (PFN_vkVoidFunction)vkCreateImageView; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3626 | if (!strcmp(funcName, "vkDestroyImageView")) |
| 3627 | return (PFN_vkVoidFunction)vkDestroyImageView; |
Michael Lentine | 6715e52 | 2015-09-15 14:59:14 -0500 | [diff] [blame] | 3628 | if (!strcmp(funcName, "vkCreateShaderModule")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3629 | return (PFN_vkVoidFunction)vkCreateShaderModule; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3630 | if (!strcmp(funcName, "vkDestroyShaderModule")) |
| 3631 | return (PFN_vkVoidFunction)vkDestroyShaderModule; |
| 3632 | if (!strcmp(funcName, "vkCreatePipelineCache")) |
| 3633 | return (PFN_vkVoidFunction)vkCreatePipelineCache; |
| 3634 | if (!strcmp(funcName, "vkDestroyPipelineCache")) |
| 3635 | return (PFN_vkVoidFunction)vkDestroyPipelineCache; |
| 3636 | if (!strcmp(funcName, "vkGetPipelineCacheData")) |
| 3637 | return (PFN_vkVoidFunction)vkGetPipelineCacheData; |
| 3638 | if (!strcmp(funcName, "vkMergePipelineCaches")) |
| 3639 | return (PFN_vkVoidFunction)vkMergePipelineCaches; |
Jon Ashburn | 0d60d27 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 3640 | if (!strcmp(funcName, "vkCreateGraphicsPipelines")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3641 | return (PFN_vkVoidFunction)vkCreateGraphicsPipelines; |
Jon Ashburn | 0d60d27 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 3642 | if (!strcmp(funcName, "vkCreateComputePipelines")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3643 | return (PFN_vkVoidFunction)vkCreateComputePipelines; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3644 | if (!strcmp(funcName, "vkDestroyPipeline")) |
| 3645 | return (PFN_vkVoidFunction)vkDestroyPipeline; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3646 | if (!strcmp(funcName, "vkCreatePipelineLayout")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3647 | return (PFN_vkVoidFunction)vkCreatePipelineLayout; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3648 | if (!strcmp(funcName, "vkDestroyPipelineLayout")) |
| 3649 | return (PFN_vkVoidFunction)vkDestroyPipelineLayout; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3650 | if (!strcmp(funcName, "vkCreateSampler")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3651 | return (PFN_vkVoidFunction)vkCreateSampler; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3652 | if (!strcmp(funcName, "vkDestroySampler")) |
| 3653 | return (PFN_vkVoidFunction)vkDestroySampler; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3654 | if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3655 | return (PFN_vkVoidFunction)vkCreateDescriptorSetLayout; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3656 | if (!strcmp(funcName, "vkDestroyDescriptorSetLayout")) |
| 3657 | return (PFN_vkVoidFunction)vkDestroyDescriptorSetLayout; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3658 | if (!strcmp(funcName, "vkCreateDescriptorPool")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3659 | return (PFN_vkVoidFunction)vkCreateDescriptorPool; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3660 | if (!strcmp(funcName, "vkDestroyDescriptorPool")) |
| 3661 | return (PFN_vkVoidFunction)vkDestroyDescriptorPool; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3662 | if (!strcmp(funcName, "vkResetDescriptorPool")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3663 | return (PFN_vkVoidFunction)vkResetDescriptorPool; |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 3664 | if (!strcmp(funcName, "vkAllocateDescriptorSets")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3665 | return (PFN_vkVoidFunction)vkAllocateDescriptorSets; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3666 | if (!strcmp(funcName, "vkCmdSetViewport")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3667 | return (PFN_vkVoidFunction)vkCmdSetViewport; |
Courtney Goeltzenleuchter | 932cdb5 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 3668 | if (!strcmp(funcName, "vkCmdSetScissor")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3669 | return (PFN_vkVoidFunction)vkCmdSetScissor; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3670 | if (!strcmp(funcName, "vkCmdSetLineWidth")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3671 | return (PFN_vkVoidFunction)vkCmdSetLineWidth; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3672 | if (!strcmp(funcName, "vkCmdSetDepthBias")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3673 | return (PFN_vkVoidFunction)vkCmdSetDepthBias; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3674 | if (!strcmp(funcName, "vkCmdSetBlendConstants")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3675 | return (PFN_vkVoidFunction)vkCmdSetBlendConstants; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3676 | if (!strcmp(funcName, "vkCmdSetDepthBounds")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3677 | return (PFN_vkVoidFunction)vkCmdSetDepthBounds; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3678 | if (!strcmp(funcName, "vkCmdSetStencilCompareMask")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3679 | return (PFN_vkVoidFunction)vkCmdSetStencilCompareMask; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3680 | if (!strcmp(funcName, "vkCmdSetStencilWriteMask")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3681 | return (PFN_vkVoidFunction)vkCmdSetStencilWriteMask; |
Courtney Goeltzenleuchter | 09772bb | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3682 | if (!strcmp(funcName, "vkCmdSetStencilReference")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3683 | return (PFN_vkVoidFunction)vkCmdSetStencilReference; |
Chia-I Wu | 1f85191 | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 3684 | if (!strcmp(funcName, "vkAllocateCommandBuffers")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3685 | return (PFN_vkVoidFunction)vkAllocateCommandBuffers; |
Dustin Graves | cfdbfae | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3686 | if (!strcmp(funcName, "vkFreeCommandBuffers")) |
| 3687 | return (PFN_vkVoidFunction)vkFreeCommandBuffers; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3688 | if (!strcmp(funcName, "vkBeginCommandBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3689 | return (PFN_vkVoidFunction)vkBeginCommandBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3690 | if (!strcmp(funcName, "vkEndCommandBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3691 | return (PFN_vkVoidFunction)vkEndCommandBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3692 | if (!strcmp(funcName, "vkResetCommandBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3693 | return (PFN_vkVoidFunction)vkResetCommandBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3694 | if (!strcmp(funcName, "vkCmdBindPipeline")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3695 | return (PFN_vkVoidFunction)vkCmdBindPipeline; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3696 | if (!strcmp(funcName, "vkCmdBindDescriptorSets")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3697 | return (PFN_vkVoidFunction)vkCmdBindDescriptorSets; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3698 | if (!strcmp(funcName, "vkCmdBindVertexBuffers")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3699 | return (PFN_vkVoidFunction)vkCmdBindVertexBuffers; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3700 | if (!strcmp(funcName, "vkCmdBindIndexBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3701 | return (PFN_vkVoidFunction)vkCmdBindIndexBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3702 | if (!strcmp(funcName, "vkCmdDraw")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3703 | return (PFN_vkVoidFunction)vkCmdDraw; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3704 | if (!strcmp(funcName, "vkCmdDrawIndexed")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3705 | return (PFN_vkVoidFunction)vkCmdDrawIndexed; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3706 | if (!strcmp(funcName, "vkCmdDrawIndirect")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3707 | return (PFN_vkVoidFunction)vkCmdDrawIndirect; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3708 | if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3709 | return (PFN_vkVoidFunction)vkCmdDrawIndexedIndirect; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3710 | if (!strcmp(funcName, "vkCmdDispatch")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3711 | return (PFN_vkVoidFunction)vkCmdDispatch; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3712 | if (!strcmp(funcName, "vkCmdDispatchIndirect")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3713 | return (PFN_vkVoidFunction)vkCmdDispatchIndirect; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3714 | if (!strcmp(funcName, "vkCmdCopyBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3715 | return (PFN_vkVoidFunction)vkCmdCopyBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3716 | if (!strcmp(funcName, "vkCmdCopyImage")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3717 | return (PFN_vkVoidFunction)vkCmdCopyImage; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3718 | if (!strcmp(funcName, "vkCmdBlitImage")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3719 | return (PFN_vkVoidFunction)vkCmdBlitImage; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3720 | if (!strcmp(funcName, "vkCmdCopyBufferToImage")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3721 | return (PFN_vkVoidFunction)vkCmdCopyBufferToImage; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3722 | if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3723 | return (PFN_vkVoidFunction)vkCmdCopyImageToBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3724 | if (!strcmp(funcName, "vkCmdUpdateBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3725 | return (PFN_vkVoidFunction)vkCmdUpdateBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3726 | if (!strcmp(funcName, "vkCmdFillBuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3727 | return (PFN_vkVoidFunction)vkCmdFillBuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3728 | if (!strcmp(funcName, "vkCmdClearColorImage")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3729 | return (PFN_vkVoidFunction)vkCmdClearColorImage; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3730 | if (!strcmp(funcName, "vkCmdResolveImage")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3731 | return (PFN_vkVoidFunction)vkCmdResolveImage; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3732 | if (!strcmp(funcName, "vkCmdSetEvent")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3733 | return (PFN_vkVoidFunction)vkCmdSetEvent; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3734 | if (!strcmp(funcName, "vkCmdResetEvent")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3735 | return (PFN_vkVoidFunction)vkCmdResetEvent; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3736 | if (!strcmp(funcName, "vkCmdWaitEvents")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3737 | return (PFN_vkVoidFunction)vkCmdWaitEvents; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3738 | if (!strcmp(funcName, "vkCmdPipelineBarrier")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3739 | return (PFN_vkVoidFunction)vkCmdPipelineBarrier; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3740 | if (!strcmp(funcName, "vkCmdBeginQuery")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3741 | return (PFN_vkVoidFunction)vkCmdBeginQuery; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3742 | if (!strcmp(funcName, "vkCmdEndQuery")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3743 | return (PFN_vkVoidFunction)vkCmdEndQuery; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3744 | if (!strcmp(funcName, "vkCmdResetQueryPool")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3745 | return (PFN_vkVoidFunction)vkCmdResetQueryPool; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3746 | if (!strcmp(funcName, "vkCmdWriteTimestamp")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3747 | return (PFN_vkVoidFunction)vkCmdWriteTimestamp; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3748 | if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3749 | return (PFN_vkVoidFunction)vkCmdCopyQueryPoolResults; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3750 | if (!strcmp(funcName, "vkCreateFramebuffer")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3751 | return (PFN_vkVoidFunction)vkCreateFramebuffer; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3752 | if (!strcmp(funcName, "vkDestroyFramebuffer")) |
| 3753 | return (PFN_vkVoidFunction)vkDestroyFramebuffer; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3754 | if (!strcmp(funcName, "vkCreateRenderPass")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3755 | return (PFN_vkVoidFunction)vkCreateRenderPass; |
Dustin Graves | 3e646e3 | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3756 | if (!strcmp(funcName, "vkDestroyRenderPass")) |
| 3757 | return (PFN_vkVoidFunction)vkDestroyRenderPass; |
| 3758 | if (!strcmp(funcName, "vkGetRenderAreaGranularity")) |
| 3759 | return (PFN_vkVoidFunction)vkGetRenderAreaGranularity; |
| 3760 | if (!strcmp(funcName, "vkCreateCommandPool")) |
| 3761 | return (PFN_vkVoidFunction)vkCreateCommandPool; |
| 3762 | if (!strcmp(funcName, "vkDestroyCommandPool")) |
| 3763 | return (PFN_vkVoidFunction)vkDestroyCommandPool; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3764 | if (!strcmp(funcName, "vkCmdBeginRenderPass")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3765 | return (PFN_vkVoidFunction)vkCmdBeginRenderPass; |
Chia-I Wu | c278df8 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 3766 | if (!strcmp(funcName, "vkCmdNextSubpass")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3767 | return (PFN_vkVoidFunction)vkCmdNextSubpass; |
Jon Ashburn | 6f8cd63 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 3768 | |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3769 | if (device == NULL) { |
| 3770 | return NULL; |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3771 | } |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3772 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3773 | if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL) |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3774 | return NULL; |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3775 | return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | c6cfa57 | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3776 | } |
| 3777 | |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3778 | VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *funcName) { |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3779 | if (!strcmp(funcName, "vkGetInstanceProcAddr")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3780 | return (PFN_vkVoidFunction)vkGetInstanceProcAddr; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3781 | if (!strcmp(funcName, "vkCreateInstance")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3782 | return (PFN_vkVoidFunction)vkCreateInstance; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3783 | if (!strcmp(funcName, "vkDestroyInstance")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3784 | return (PFN_vkVoidFunction)vkDestroyInstance; |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3785 | if (!strcmp(funcName, "vkCreateDevice")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3786 | return (PFN_vkVoidFunction)vkCreateDevice; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3787 | if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3788 | return (PFN_vkVoidFunction)vkEnumeratePhysicalDevices; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3789 | if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3790 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceProperties; |
Jeremy Hayes | ea53d6f | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3791 | if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3792 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 4da96aa | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 3793 | if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3794 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceFormatProperties; |
Courtney Goeltzenleuchter | 74c4ce9 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 3795 | if (!strcmp(funcName, "vkEnumerateInstanceLayerProperties")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3796 | return (PFN_vkVoidFunction)vkEnumerateInstanceLayerProperties; |
Courtney Goeltzenleuchter | 74c4ce9 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 3797 | if (!strcmp(funcName, "vkEnumerateInstanceExtensionProperties")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3798 | return (PFN_vkVoidFunction)vkEnumerateInstanceExtensionProperties; |
Courtney Goeltzenleuchter | 74c4ce9 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 3799 | if (!strcmp(funcName, "vkEnumerateDeviceLayerProperties")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3800 | return (PFN_vkVoidFunction)vkEnumerateDeviceLayerProperties; |
Courtney Goeltzenleuchter | 74c4ce9 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 3801 | if (!strcmp(funcName, "vkEnumerateDeviceExtensionProperties")) |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3802 | return (PFN_vkVoidFunction)vkEnumerateDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 09f8504 | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 3803 | |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3804 | if (instance == NULL) { |
| 3805 | return NULL; |
| 3806 | } |
| 3807 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3808 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
Mark Lobodzinski | b2c8e08 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 3809 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3810 | PFN_vkVoidFunction fptr = debug_report_get_instance_proc_addr(data->report_data, funcName); |
Jon Ashburn | 491a3cd | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3811 | if (fptr) |
Courtney Goeltzenleuchter | 09f8504 | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 3812 | return fptr; |
| 3813 | |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3814 | if (get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr == NULL) |
Courtney Goeltzenleuchter | 2bdf6da | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3815 | return NULL; |
Mark Lobodzinski | b838dc0 | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3816 | return get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr(instance, funcName); |
Jon Ashburn | 79b78ac | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 3817 | } |