Mark Lobodzinski | 6eda00a | 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 | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 9 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 11 | * |
Jon Ashburn | 3ebf125 | 2016-04-19 11:30:31 -0600 | [diff] [blame] | 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
Courtney Goeltzenleuchter | 0555952 | 2015-10-30 11:14:30 -0600 | [diff] [blame] | 17 | * |
| 18 | * Author: Jeremy Hayes <jeremy@lunarg.com> |
| 19 | * Author: Tony Barbour <tony@LunarG.com> |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 20 | * Author: Mark Lobodzinski <mark@LunarG.com> |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 21 | * Author: Dustin Graves <dustin@lunarg.com> |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 22 | */ |
| 23 | |
| 24 | #include <stdio.h> |
| 25 | #include <stdlib.h> |
| 26 | #include <string.h> |
| 27 | |
| 28 | #include <iostream> |
| 29 | #include <string> |
| 30 | #include <sstream> |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 31 | #include <unordered_map> |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 32 | #include <unordered_set> |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 33 | #include <vector> |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 34 | |
Tobin Ehlis | b835d1b | 2015-07-03 10:34:49 -0600 | [diff] [blame] | 35 | #include "vk_loader_platform.h" |
David Pinedo | 9316d3b | 2015-11-06 12:54:48 -0700 | [diff] [blame] | 36 | #include "vulkan/vk_layer.h" |
Tobin Ehlis | a0cb02e | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 37 | #include "vk_layer_config.h" |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 38 | #include "vk_enum_validate_helper.h" |
| 39 | #include "vk_struct_validate_helper.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 40 | |
Tobin Ehlis | a0cb02e | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 41 | #include "vk_layer_table.h" |
| 42 | #include "vk_layer_data.h" |
| 43 | #include "vk_layer_logging.h" |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 44 | #include "vk_layer_extension_utils.h" |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 45 | #include "vk_layer_utils.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 46 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 47 | #include "parameter_validation.h" |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 48 | |
Dustin Graves | b83fc2d | 2016-05-04 12:56:08 -0600 | [diff] [blame] | 49 | using namespace parameter_validation; |
| 50 | |
Cody Northrop | 55443ef | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 51 | struct layer_data { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 52 | debug_report_data *report_data; |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 53 | std::vector<VkDebugReportCallbackEXT> logging_callback; |
Cody Northrop | 55443ef | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 54 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 55 | // The following are for keeping track of the temporary callbacks that can |
| 56 | // be used in vkCreateInstance and vkDestroyInstance: |
| 57 | uint32_t num_tmp_callbacks; |
| 58 | VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos; |
| 59 | VkDebugReportCallbackEXT *tmp_callbacks; |
| 60 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 61 | // TODO: Split instance/device structs |
| 62 | // Device Data |
| 63 | // Map for queue family index to queue count |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 64 | std::unordered_map<uint32_t, uint32_t> queueFamilyIndexMap; |
| 65 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 66 | layer_data() : report_data(nullptr), num_tmp_callbacks(0), tmp_dbg_create_infos(nullptr), tmp_callbacks(nullptr){}; |
Cody Northrop | 55443ef | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 67 | }; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 68 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 69 | static std::unordered_map<void *, layer_data *> layer_data_map; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 70 | static device_table_map pc_device_table_map; |
| 71 | static instance_table_map pc_instance_table_map; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 72 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 73 | // "my instance data" |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 74 | debug_report_data *mid(VkInstance object) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 75 | dispatch_key key = get_dispatch_key(object); |
Tobin Ehlis | bfbac25 | 2015-09-01 11:46:36 -0600 | [diff] [blame] | 76 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 77 | #if DISPATCH_MAP_DEBUG |
Mark Mueller | aab3650 | 2016-05-03 13:17:29 -0600 | [diff] [blame^] | 78 | fprintf(stderr, "MID: map: 0x%p, object: 0x%p, key: 0x%p, data: 0x%p\n", &layer_data_map, object, key, data); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 79 | #endif |
Courtney Goeltzenleuchter | 876a4f5 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 80 | assert(data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 81 | |
| 82 | return data->report_data; |
| 83 | } |
| 84 | |
| 85 | // "my device data" |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 86 | debug_report_data *mdd(void *object) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 87 | dispatch_key key = get_dispatch_key(object); |
| 88 | layer_data *data = get_my_data_ptr(key, layer_data_map); |
| 89 | #if DISPATCH_MAP_DEBUG |
Mark Mueller | aab3650 | 2016-05-03 13:17:29 -0600 | [diff] [blame^] | 90 | fprintf(stderr, "MDD: map: 0x%p, object: 0x%p, key: 0x%p, data: 0x%p\n", &layer_data_map, object, key, data); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 91 | #endif |
Courtney Goeltzenleuchter | 876a4f5 | 2015-07-17 10:20:11 -0600 | [diff] [blame] | 92 | assert(data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 93 | return data->report_data; |
| 94 | } |
| 95 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 96 | static void init_parameter_validation(layer_data *my_data, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 97 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 98 | layer_debug_actions(my_data->report_data, my_data->logging_callback, pAllocator, "lunarg_parameter_validation"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 99 | } |
| 100 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 101 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 102 | vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 103 | const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pMsgCallback) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 104 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 105 | VkResult result = pTable->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 106 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 107 | if (result == VK_SUCCESS) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 108 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
| 109 | result = layer_create_msg_callback(data->report_data, pCreateInfo, pAllocator, pMsgCallback); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | return result; |
| 113 | } |
| 114 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 115 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, |
| 116 | VkDebugReportCallbackEXT msgCallback, |
| 117 | const VkAllocationCallbacks *pAllocator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 118 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 119 | pTable->DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 120 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 121 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
Courtney Goeltzenleuchter | 05854bf | 2015-11-30 12:13:14 -0700 | [diff] [blame] | 122 | layer_destroy_msg_callback(data->report_data, msgCallback, pAllocator); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 123 | } |
| 124 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 125 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 126 | vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType, uint64_t object, |
| 127 | size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 128 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
| 129 | pTable->DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); |
Courtney Goeltzenleuchter | f0de724 | 2015-12-01 14:10:55 -0700 | [diff] [blame] | 130 | } |
| 131 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 132 | static const VkExtensionProperties instance_extensions[] = {{VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}}; |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 133 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 134 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 135 | vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, VkExtensionProperties *pProperties) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 136 | return util_GetExtensionProperties(1, instance_extensions, pCount, pProperties); |
Jon Ashburn | 9fd4cc4 | 2015-04-10 14:33:07 -0600 | [diff] [blame] | 137 | } |
| 138 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 139 | static const VkLayerProperties pc_global_layers[] = {{ |
Jon Ashburn | dc9111c | 2016-03-22 12:57:13 -0600 | [diff] [blame] | 140 | "VK_LAYER_LUNARG_parameter_validation", VK_LAYER_API_VERSION, 1, "LunarG Validation Layer", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 141 | }}; |
Courtney Goeltzenleuchter | 5285766 | 2015-12-01 14:08:28 -0700 | [diff] [blame] | 142 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 143 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 144 | vkEnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) { |
| 145 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, pCount, pProperties); |
Tony Barbour | 59a4732 | 2015-06-24 16:06:58 -0600 | [diff] [blame] | 146 | } |
| 147 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 148 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, |
| 149 | const char *pLayerName, uint32_t *pCount, |
| 150 | VkExtensionProperties *pProperties) { |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 151 | /* parameter_validation does not have any physical device extensions */ |
Jon Ashburn | 751c484 | 2015-11-02 17:37:20 -0700 | [diff] [blame] | 152 | if (pLayerName == NULL) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 153 | return get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 154 | ->EnumerateDeviceExtensionProperties(physicalDevice, NULL, pCount, pProperties); |
Jon Ashburn | 751c484 | 2015-11-02 17:37:20 -0700 | [diff] [blame] | 155 | } else { |
| 156 | return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
| 157 | } |
Jeremy Hayes | ad36715 | 2015-04-17 10:36:53 -0600 | [diff] [blame] | 158 | } |
| 159 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 160 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 161 | vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, VkLayerProperties *pProperties) { |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 162 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 163 | /* parameter_validation's physical device layers are the same as global */ |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 164 | return util_GetLayerProperties(ARRAY_SIZE(pc_global_layers), pc_global_layers, pCount, pProperties); |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 165 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 166 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 167 | static bool ValidateEnumerator(VkFormatFeatureFlagBits const &enumerator) { |
Courtney Goeltzenleuchter | f1ece60 | 2015-09-10 16:25:49 -0600 | [diff] [blame] | 168 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 169 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 170 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 171 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 172 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
| 173 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT | |
Jon Ashburn | 766866a | 2016-01-22 15:39:20 -0700 | [diff] [blame] | 174 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 175 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 176 | return false; |
| 177 | } |
| 178 | |
| 179 | return true; |
| 180 | } |
| 181 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 182 | static std::string EnumeratorString(VkFormatFeatureFlagBits const &enumerator) { |
| 183 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 184 | return "unrecognized enumerator"; |
| 185 | } |
| 186 | |
| 187 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 188 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 189 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 190 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 191 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 192 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 193 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 194 | if (enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 195 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 196 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 197 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 198 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 199 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 200 | if (enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 201 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 202 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 203 | if (enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 204 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 205 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 206 | if (enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 207 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 208 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 209 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 210 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 211 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 212 | if (enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 213 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 214 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 215 | if (enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 216 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 217 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 218 | if (enumerator & VK_FORMAT_FEATURE_BLIT_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 219 | strings.push_back("VK_FORMAT_FEATURE_BLIT_SRC_BIT"); |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 220 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 221 | if (enumerator & VK_FORMAT_FEATURE_BLIT_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 222 | strings.push_back("VK_FORMAT_FEATURE_BLIT_DST_BIT"); |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 223 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 224 | if (enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) { |
Jon Ashburn | 766866a | 2016-01-22 15:39:20 -0700 | [diff] [blame] | 225 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT"); |
| 226 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 227 | |
| 228 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 229 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 230 | enumeratorString += string; |
| 231 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 232 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 233 | enumeratorString += '|'; |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | return enumeratorString; |
| 238 | } |
| 239 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 240 | static bool ValidateEnumerator(VkImageUsageFlagBits const &enumerator) { |
| 241 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)( |
| 242 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 243 | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | |
| 244 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT); |
| 245 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 246 | return false; |
| 247 | } |
| 248 | |
| 249 | return true; |
| 250 | } |
| 251 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 252 | static std::string EnumeratorString(VkImageUsageFlagBits const &enumerator) { |
| 253 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 254 | return "unrecognized enumerator"; |
| 255 | } |
| 256 | |
| 257 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 258 | if (enumerator & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 259 | strings.push_back("VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT"); |
| 260 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 261 | if (enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 262 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 263 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 264 | if (enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 265 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 266 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 267 | if (enumerator & VK_IMAGE_USAGE_STORAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 268 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 269 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 270 | if (enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 271 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 272 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 273 | if (enumerator & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 274 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DST_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 275 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 276 | if (enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 277 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 278 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 279 | if (enumerator & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 280 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SRC_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 281 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 282 | |
| 283 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 284 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 285 | enumeratorString += string; |
| 286 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 287 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 288 | enumeratorString += '|'; |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | return enumeratorString; |
| 293 | } |
| 294 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 295 | static bool ValidateEnumerator(VkQueueFlagBits const &enumerator) { |
| 296 | VkQueueFlagBits allFlags = |
| 297 | (VkQueueFlagBits)(VK_QUEUE_TRANSFER_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_SPARSE_BINDING_BIT | VK_QUEUE_GRAPHICS_BIT); |
| 298 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 299 | return false; |
| 300 | } |
| 301 | |
| 302 | return true; |
| 303 | } |
| 304 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 305 | static std::string EnumeratorString(VkQueueFlagBits const &enumerator) { |
| 306 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 307 | return "unrecognized enumerator"; |
| 308 | } |
| 309 | |
| 310 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 311 | if (enumerator & VK_QUEUE_TRANSFER_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 312 | strings.push_back("VK_QUEUE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 313 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 314 | if (enumerator & VK_QUEUE_COMPUTE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 315 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 316 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 317 | if (enumerator & VK_QUEUE_SPARSE_BINDING_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 318 | strings.push_back("VK_QUEUE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 319 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 320 | if (enumerator & VK_QUEUE_GRAPHICS_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 321 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 322 | } |
| 323 | |
| 324 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 325 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 326 | enumeratorString += string; |
| 327 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 328 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 329 | enumeratorString += '|'; |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | return enumeratorString; |
| 334 | } |
| 335 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 336 | static bool ValidateEnumerator(VkMemoryPropertyFlagBits const &enumerator) { |
| 337 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)( |
| 338 | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 339 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); |
| 340 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 341 | return false; |
| 342 | } |
| 343 | |
| 344 | return true; |
| 345 | } |
| 346 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 347 | static std::string EnumeratorString(VkMemoryPropertyFlagBits const &enumerator) { |
| 348 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 349 | return "unrecognized enumerator"; |
| 350 | } |
| 351 | |
| 352 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 353 | if (enumerator & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 354 | strings.push_back("VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT"); |
| 355 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 356 | if (enumerator & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 357 | strings.push_back("VK_MEMORY_PROPERTY_HOST_COHERENT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 358 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 359 | if (enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 360 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 361 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 362 | if (enumerator & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 363 | strings.push_back("VK_MEMORY_PROPERTY_HOST_CACHED_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 364 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 365 | if (enumerator & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 366 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 367 | } |
| 368 | |
| 369 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 370 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 371 | enumeratorString += string; |
| 372 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 373 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 374 | enumeratorString += '|'; |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | return enumeratorString; |
| 379 | } |
| 380 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 381 | static bool ValidateEnumerator(VkMemoryHeapFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 382 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_DEVICE_LOCAL_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 383 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 384 | return false; |
| 385 | } |
| 386 | |
| 387 | return true; |
| 388 | } |
| 389 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 390 | static std::string EnumeratorString(VkMemoryHeapFlagBits const &enumerator) { |
| 391 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 392 | return "unrecognized enumerator"; |
| 393 | } |
| 394 | |
| 395 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 396 | if (enumerator & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 397 | strings.push_back("VK_MEMORY_HEAP_DEVICE_LOCAL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 398 | } |
| 399 | |
| 400 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 401 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 402 | enumeratorString += string; |
| 403 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 404 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 405 | enumeratorString += '|'; |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | return enumeratorString; |
| 410 | } |
| 411 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 412 | static bool ValidateEnumerator(VkSparseImageFormatFlagBits const &enumerator) { |
| 413 | VkSparseImageFormatFlagBits allFlags = |
| 414 | (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT | |
| 415 | VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT | VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT); |
| 416 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 417 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 418 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 419 | |
| 420 | return true; |
| 421 | } |
| 422 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 423 | static std::string EnumeratorString(VkSparseImageFormatFlagBits const &enumerator) { |
| 424 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 425 | return "unrecognized enumerator"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 426 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 427 | |
| 428 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 429 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 430 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 431 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 432 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 433 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 434 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 435 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 436 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 437 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 438 | |
| 439 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 440 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 441 | enumeratorString += string; |
| 442 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 443 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 444 | enumeratorString += '|'; |
| 445 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 446 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 447 | |
| 448 | return enumeratorString; |
| 449 | } |
| 450 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 451 | static bool ValidateEnumerator(VkFenceCreateFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 452 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 453 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 454 | return false; |
| 455 | } |
| 456 | |
| 457 | return true; |
| 458 | } |
| 459 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 460 | static std::string EnumeratorString(VkFenceCreateFlagBits const &enumerator) { |
| 461 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 462 | return "unrecognized enumerator"; |
| 463 | } |
| 464 | |
| 465 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 466 | if (enumerator & VK_FENCE_CREATE_SIGNALED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 467 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 468 | } |
| 469 | |
| 470 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 471 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 472 | enumeratorString += string; |
| 473 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 474 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 475 | enumeratorString += '|'; |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | return enumeratorString; |
| 480 | } |
| 481 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 482 | static bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const &enumerator) { |
| 483 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)( |
| 484 | VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT | |
| 485 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT | |
| 486 | VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT | |
| 487 | VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT | |
Courtney Goeltzenleuchter | fe1b36e | 2015-10-15 16:57:32 -0600 | [diff] [blame] | 488 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT | |
| 489 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT | |
| 490 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 491 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 492 | return false; |
| 493 | } |
| 494 | |
| 495 | return true; |
| 496 | } |
| 497 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 498 | static std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const &enumerator) { |
| 499 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 500 | return "unrecognized enumerator"; |
| 501 | } |
| 502 | |
| 503 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 504 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 505 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 506 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 507 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 508 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 509 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 510 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 511 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 512 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 513 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 514 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 515 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 516 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 517 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 518 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 519 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 520 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 521 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 522 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 523 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 524 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 525 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 526 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 527 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 528 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 529 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 530 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 531 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 532 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 533 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 534 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 535 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 536 | } |
| 537 | |
| 538 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 539 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 540 | enumeratorString += string; |
| 541 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 542 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 543 | enumeratorString += '|'; |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | return enumeratorString; |
| 548 | } |
| 549 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 550 | static bool ValidateEnumerator(VkQueryResultFlagBits const &enumerator) { |
| 551 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 552 | VK_QUERY_RESULT_WAIT_BIT | VK_QUERY_RESULT_64_BIT); |
| 553 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 554 | return false; |
| 555 | } |
| 556 | |
| 557 | return true; |
| 558 | } |
| 559 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 560 | static std::string EnumeratorString(VkQueryResultFlagBits const &enumerator) { |
| 561 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 562 | return "unrecognized enumerator"; |
| 563 | } |
| 564 | |
| 565 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 566 | if (enumerator & VK_QUERY_RESULT_PARTIAL_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 567 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 568 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 569 | if (enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 570 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 571 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 572 | if (enumerator & VK_QUERY_RESULT_WAIT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 573 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 574 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 575 | if (enumerator & VK_QUERY_RESULT_64_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 576 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 577 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 578 | |
| 579 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 580 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 581 | enumeratorString += string; |
| 582 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 583 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 584 | enumeratorString += '|'; |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | return enumeratorString; |
| 589 | } |
| 590 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 591 | static bool ValidateEnumerator(VkBufferUsageFlagBits const &enumerator) { |
| 592 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)( |
| 593 | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 594 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | |
| 595 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); |
| 596 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 597 | return false; |
| 598 | } |
| 599 | |
| 600 | return true; |
| 601 | } |
| 602 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 603 | static std::string EnumeratorString(VkBufferUsageFlagBits const &enumerator) { |
| 604 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 605 | return "unrecognized enumerator"; |
| 606 | } |
| 607 | |
| 608 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 609 | if (enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 610 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 611 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 612 | if (enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 613 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 614 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 615 | if (enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 616 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 617 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 618 | if (enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 619 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 620 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 621 | if (enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 622 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 623 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 624 | if (enumerator & VK_BUFFER_USAGE_TRANSFER_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 625 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 626 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 627 | if (enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 628 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 629 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 630 | if (enumerator & VK_BUFFER_USAGE_TRANSFER_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 631 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SRC_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 632 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 633 | if (enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 634 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 635 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 636 | |
| 637 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 638 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 639 | enumeratorString += string; |
| 640 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 641 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 642 | enumeratorString += '|'; |
| 643 | } |
| 644 | } |
| 645 | |
| 646 | return enumeratorString; |
| 647 | } |
| 648 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 649 | static bool ValidateEnumerator(VkBufferCreateFlagBits const &enumerator) { |
| 650 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)( |
| 651 | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT); |
| 652 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 653 | return false; |
| 654 | } |
| 655 | |
| 656 | return true; |
| 657 | } |
| 658 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 659 | static std::string EnumeratorString(VkBufferCreateFlagBits const &enumerator) { |
| 660 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 661 | return "unrecognized enumerator"; |
| 662 | } |
| 663 | |
| 664 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 665 | if (enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 666 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 667 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 668 | if (enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 669 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 670 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 671 | if (enumerator & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 672 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 673 | } |
| 674 | |
| 675 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 676 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 677 | enumeratorString += string; |
| 678 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 679 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 680 | enumeratorString += '|'; |
| 681 | } |
| 682 | } |
| 683 | |
| 684 | return enumeratorString; |
| 685 | } |
| 686 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 687 | static bool ValidateEnumerator(VkImageCreateFlagBits const &enumerator) { |
| 688 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)( |
| 689 | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
| 690 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); |
| 691 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 692 | return false; |
| 693 | } |
| 694 | |
| 695 | return true; |
| 696 | } |
| 697 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 698 | static std::string EnumeratorString(VkImageCreateFlagBits const &enumerator) { |
| 699 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 700 | return "unrecognized enumerator"; |
| 701 | } |
| 702 | |
| 703 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 704 | if (enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 705 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 706 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 707 | if (enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 708 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 709 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 710 | if (enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 711 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 712 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 713 | if (enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 714 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 715 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 716 | if (enumerator & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 717 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 718 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 719 | |
| 720 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 721 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 722 | enumeratorString += string; |
| 723 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 724 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 725 | enumeratorString += '|'; |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | return enumeratorString; |
| 730 | } |
| 731 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 732 | static bool ValidateEnumerator(VkColorComponentFlagBits const &enumerator) { |
| 733 | VkColorComponentFlagBits allFlags = (VkColorComponentFlagBits)(VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | |
| 734 | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); |
| 735 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 736 | return false; |
| 737 | } |
| 738 | |
| 739 | return true; |
| 740 | } |
| 741 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 742 | static std::string EnumeratorString(VkColorComponentFlagBits const &enumerator) { |
| 743 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 744 | return "unrecognized enumerator"; |
| 745 | } |
| 746 | |
| 747 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 748 | if (enumerator & VK_COLOR_COMPONENT_A_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 749 | strings.push_back("VK_COLOR_COMPONENT_A_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 750 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 751 | if (enumerator & VK_COLOR_COMPONENT_B_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 752 | strings.push_back("VK_COLOR_COMPONENT_B_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 753 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 754 | if (enumerator & VK_COLOR_COMPONENT_G_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 755 | strings.push_back("VK_COLOR_COMPONENT_G_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 756 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 757 | if (enumerator & VK_COLOR_COMPONENT_R_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 758 | strings.push_back("VK_COLOR_COMPONENT_R_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 759 | } |
| 760 | |
| 761 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 762 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 763 | enumeratorString += string; |
| 764 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 765 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 766 | enumeratorString += '|'; |
| 767 | } |
| 768 | } |
| 769 | |
| 770 | return enumeratorString; |
| 771 | } |
| 772 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 773 | static bool ValidateEnumerator(VkPipelineCreateFlagBits const &enumerator) { |
| 774 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)( |
| 775 | VK_PIPELINE_CREATE_DERIVATIVE_BIT | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
| 776 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 777 | return false; |
| 778 | } |
| 779 | |
| 780 | return true; |
| 781 | } |
| 782 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 783 | static std::string EnumeratorString(VkPipelineCreateFlagBits const &enumerator) { |
| 784 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 785 | return "unrecognized enumerator"; |
| 786 | } |
| 787 | |
| 788 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 789 | if (enumerator & VK_PIPELINE_CREATE_DERIVATIVE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 790 | strings.push_back("VK_PIPELINE_CREATE_DERIVATIVE_BIT"); |
| 791 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 792 | if (enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 793 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 794 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 795 | if (enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 796 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 797 | } |
| 798 | |
| 799 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 800 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 801 | enumeratorString += string; |
| 802 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 803 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 804 | enumeratorString += '|'; |
| 805 | } |
| 806 | } |
| 807 | |
| 808 | return enumeratorString; |
| 809 | } |
| 810 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 811 | static bool ValidateEnumerator(VkShaderStageFlagBits const &enumerator) { |
| 812 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)( |
| 813 | VK_SHADER_STAGE_ALL | VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_GEOMETRY_BIT | VK_SHADER_STAGE_COMPUTE_BIT | |
| 814 | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_VERTEX_BIT); |
| 815 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 816 | return false; |
| 817 | } |
| 818 | |
| 819 | return true; |
| 820 | } |
| 821 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 822 | static std::string EnumeratorString(VkShaderStageFlagBits const &enumerator) { |
| 823 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 824 | return "unrecognized enumerator"; |
| 825 | } |
| 826 | |
| 827 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 828 | if (enumerator & VK_SHADER_STAGE_ALL) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 829 | strings.push_back("VK_SHADER_STAGE_ALL"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 830 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 831 | if (enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 832 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 833 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 834 | if (enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 835 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 836 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 837 | if (enumerator & VK_SHADER_STAGE_COMPUTE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 838 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 839 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 840 | if (enumerator & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 841 | strings.push_back("VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 842 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 843 | if (enumerator & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 844 | strings.push_back("VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 845 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 846 | if (enumerator & VK_SHADER_STAGE_VERTEX_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 847 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 848 | } |
| 849 | |
| 850 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 851 | for (auto const &string : strings) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 852 | enumeratorString += string; |
| 853 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 854 | if (string != strings.back()) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 855 | enumeratorString += '|'; |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | return enumeratorString; |
| 860 | } |
| 861 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 862 | static bool ValidateEnumerator(VkPipelineStageFlagBits const &enumerator) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 863 | VkPipelineStageFlagBits allFlags = (VkPipelineStageFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 864 | VK_PIPELINE_STAGE_ALL_COMMANDS_BIT | VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_HOST_BIT | |
| 865 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | |
| 866 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | |
| 867 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | |
| 868 | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | |
| 869 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT | |
Jon Ashburn | 4bf8ba4 | 2015-12-31 12:14:37 -0700 | [diff] [blame] | 870 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 871 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 872 | return false; |
| 873 | } |
| 874 | |
| 875 | return true; |
| 876 | } |
| 877 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 878 | static std::string EnumeratorString(VkPipelineStageFlagBits const &enumerator) { |
| 879 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 880 | return "unrecognized enumerator"; |
| 881 | } |
| 882 | |
| 883 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 884 | if (enumerator & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 885 | strings.push_back("VK_PIPELINE_STAGE_ALL_COMMANDS_BIT"); |
| 886 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 887 | if (enumerator & VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 888 | strings.push_back("VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 889 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 890 | if (enumerator & VK_PIPELINE_STAGE_HOST_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 891 | strings.push_back("VK_PIPELINE_STAGE_HOST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 892 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 893 | if (enumerator & VK_PIPELINE_STAGE_TRANSFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 894 | strings.push_back("VK_PIPELINE_STAGE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 895 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 896 | if (enumerator & VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 897 | strings.push_back("VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 898 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 899 | if (enumerator & VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT) { |
Jon Ashburn | 4bf8ba4 | 2015-12-31 12:14:37 -0700 | [diff] [blame] | 900 | strings.push_back("VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 901 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 902 | if (enumerator & VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 903 | strings.push_back("VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 904 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 905 | if (enumerator & VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 906 | strings.push_back("VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 907 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 908 | if (enumerator & VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 909 | strings.push_back("VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 910 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 911 | if (enumerator & VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 912 | strings.push_back("VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 913 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 914 | if (enumerator & VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 915 | strings.push_back("VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT"); |
| 916 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 917 | if (enumerator & VK_PIPELINE_STAGE_VERTEX_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 918 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_SHADER_BIT"); |
| 919 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 920 | if (enumerator & VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 921 | strings.push_back("VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 922 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 923 | if (enumerator & VK_PIPELINE_STAGE_VERTEX_INPUT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 924 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_INPUT_BIT"); |
| 925 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 926 | if (enumerator & VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 927 | strings.push_back("VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT"); |
| 928 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 929 | if (enumerator & VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 930 | strings.push_back("VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT"); |
| 931 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 932 | if (enumerator & VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 933 | strings.push_back("VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 934 | } |
| 935 | |
| 936 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 937 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 938 | enumeratorString += string; |
| 939 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 940 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 941 | enumeratorString += '|'; |
| 942 | } |
| 943 | } |
| 944 | |
| 945 | return enumeratorString; |
| 946 | } |
| 947 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 948 | static bool ValidateEnumerator(VkAccessFlagBits const &enumerator) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 949 | VkAccessFlagBits allFlags = (VkAccessFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 950 | VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_INDEX_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | |
| 951 | VK_ACCESS_UNIFORM_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | |
| 952 | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | |
| 953 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | |
| 954 | VK_ACCESS_HOST_READ_BIT | VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT); |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 955 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 956 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 957 | return false; |
| 958 | } |
| 959 | |
| 960 | return true; |
| 961 | } |
| 962 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 963 | static std::string EnumeratorString(VkAccessFlagBits const &enumerator) { |
| 964 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 965 | return "unrecognized enumerator"; |
| 966 | } |
| 967 | |
| 968 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 969 | if (enumerator & VK_ACCESS_INDIRECT_COMMAND_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 970 | strings.push_back("VK_ACCESS_INDIRECT_COMMAND_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 971 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 972 | if (enumerator & VK_ACCESS_INDEX_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 973 | strings.push_back("VK_ACCESS_INDEX_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 974 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 975 | if (enumerator & VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 976 | strings.push_back("VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 977 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 978 | if (enumerator & VK_ACCESS_UNIFORM_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 979 | strings.push_back("VK_ACCESS_UNIFORM_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 980 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 981 | if (enumerator & VK_ACCESS_INPUT_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 982 | strings.push_back("VK_ACCESS_INPUT_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 983 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 984 | if (enumerator & VK_ACCESS_SHADER_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 985 | strings.push_back("VK_ACCESS_SHADER_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 986 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 987 | if (enumerator & VK_ACCESS_SHADER_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 988 | strings.push_back("VK_ACCESS_SHADER_WRITE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 989 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 990 | if (enumerator & VK_ACCESS_COLOR_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 991 | strings.push_back("VK_ACCESS_COLOR_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 992 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 993 | if (enumerator & VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 994 | strings.push_back("VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 995 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 996 | if (enumerator & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 997 | strings.push_back("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 998 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 999 | if (enumerator & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1000 | strings.push_back("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1001 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1002 | if (enumerator & VK_ACCESS_TRANSFER_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1003 | strings.push_back("VK_ACCESS_TRANSFER_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1004 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1005 | if (enumerator & VK_ACCESS_TRANSFER_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1006 | strings.push_back("VK_ACCESS_TRANSFER_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1007 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1008 | if (enumerator & VK_ACCESS_HOST_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1009 | strings.push_back("VK_ACCESS_HOST_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1010 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1011 | if (enumerator & VK_ACCESS_HOST_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1012 | strings.push_back("VK_ACCESS_HOST_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1013 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1014 | if (enumerator & VK_ACCESS_MEMORY_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1015 | strings.push_back("VK_ACCESS_MEMORY_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1016 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1017 | if (enumerator & VK_ACCESS_MEMORY_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1018 | strings.push_back("VK_ACCESS_MEMORY_WRITE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1019 | } |
| 1020 | |
| 1021 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1022 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1023 | enumeratorString += string; |
| 1024 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1025 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1026 | enumeratorString += '|'; |
| 1027 | } |
| 1028 | } |
| 1029 | |
| 1030 | return enumeratorString; |
| 1031 | } |
| 1032 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1033 | static bool ValidateEnumerator(VkCommandPoolCreateFlagBits const &enumerator) { |
| 1034 | VkCommandPoolCreateFlagBits allFlags = |
| 1035 | (VkCommandPoolCreateFlagBits)(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT); |
| 1036 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1037 | return false; |
| 1038 | } |
| 1039 | |
| 1040 | return true; |
| 1041 | } |
| 1042 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1043 | static std::string EnumeratorString(VkCommandPoolCreateFlagBits const &enumerator) { |
| 1044 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1045 | return "unrecognized enumerator"; |
| 1046 | } |
| 1047 | |
| 1048 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1049 | if (enumerator & VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1050 | strings.push_back("VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1051 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1052 | if (enumerator & VK_COMMAND_POOL_CREATE_TRANSIENT_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1053 | strings.push_back("VK_COMMAND_POOL_CREATE_TRANSIENT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1054 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1055 | |
| 1056 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1057 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1058 | enumeratorString += string; |
| 1059 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1060 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1061 | enumeratorString += '|'; |
| 1062 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1063 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1064 | |
| 1065 | return enumeratorString; |
| 1066 | } |
| 1067 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1068 | static bool ValidateEnumerator(VkCommandPoolResetFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1069 | VkCommandPoolResetFlagBits allFlags = (VkCommandPoolResetFlagBits)(VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1070 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1071 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1072 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1073 | |
| 1074 | return true; |
| 1075 | } |
| 1076 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1077 | static std::string EnumeratorString(VkCommandPoolResetFlagBits const &enumerator) { |
| 1078 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1079 | return "unrecognized enumerator"; |
| 1080 | } |
| 1081 | |
| 1082 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1083 | if (enumerator & VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1084 | strings.push_back("VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1085 | } |
| 1086 | |
| 1087 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1088 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1089 | enumeratorString += string; |
| 1090 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1091 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1092 | enumeratorString += '|'; |
| 1093 | } |
| 1094 | } |
| 1095 | |
| 1096 | return enumeratorString; |
| 1097 | } |
| 1098 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1099 | static bool ValidateEnumerator(VkCommandBufferUsageFlags const &enumerator) { |
| 1100 | VkCommandBufferUsageFlags allFlags = |
| 1101 | (VkCommandBufferUsageFlags)(VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT | VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT | |
| 1102 | VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT); |
| 1103 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1104 | return false; |
| 1105 | } |
| 1106 | |
| 1107 | return true; |
| 1108 | } |
| 1109 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1110 | static std::string EnumeratorString(VkCommandBufferUsageFlags const &enumerator) { |
| 1111 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1112 | return "unrecognized enumerator"; |
| 1113 | } |
| 1114 | |
| 1115 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1116 | if (enumerator & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1117 | strings.push_back("VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1118 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1119 | if (enumerator & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1120 | strings.push_back("VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1121 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1122 | if (enumerator & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1123 | strings.push_back("VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1124 | } |
| 1125 | |
| 1126 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1127 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1128 | enumeratorString += string; |
| 1129 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1130 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1131 | enumeratorString += '|'; |
| 1132 | } |
| 1133 | } |
| 1134 | |
| 1135 | return enumeratorString; |
| 1136 | } |
| 1137 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1138 | static bool ValidateEnumerator(VkCommandBufferResetFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1139 | VkCommandBufferResetFlagBits allFlags = (VkCommandBufferResetFlagBits)(VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1140 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1141 | return false; |
| 1142 | } |
| 1143 | |
| 1144 | return true; |
| 1145 | } |
| 1146 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1147 | static std::string EnumeratorString(VkCommandBufferResetFlagBits const &enumerator) { |
| 1148 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1149 | return "unrecognized enumerator"; |
| 1150 | } |
| 1151 | |
| 1152 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1153 | if (enumerator & VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1154 | strings.push_back("VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1155 | } |
| 1156 | |
| 1157 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1158 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1159 | enumeratorString += string; |
| 1160 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1161 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1162 | enumeratorString += '|'; |
| 1163 | } |
| 1164 | } |
| 1165 | |
| 1166 | return enumeratorString; |
| 1167 | } |
| 1168 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1169 | static bool ValidateEnumerator(VkImageAspectFlagBits const &enumerator) { |
| 1170 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_METADATA_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1171 | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_COLOR_BIT); |
| 1172 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1173 | return false; |
| 1174 | } |
| 1175 | |
| 1176 | return true; |
| 1177 | } |
| 1178 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1179 | static std::string EnumeratorString(VkImageAspectFlagBits const &enumerator) { |
| 1180 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1181 | return "unrecognized enumerator"; |
| 1182 | } |
| 1183 | |
| 1184 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1185 | if (enumerator & VK_IMAGE_ASPECT_METADATA_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1186 | strings.push_back("VK_IMAGE_ASPECT_METADATA_BIT"); |
| 1187 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1188 | if (enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1189 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1190 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1191 | if (enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1192 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1193 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1194 | if (enumerator & VK_IMAGE_ASPECT_COLOR_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1195 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1196 | } |
| 1197 | |
| 1198 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1199 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1200 | enumeratorString += string; |
| 1201 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1202 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1203 | enumeratorString += '|'; |
| 1204 | } |
| 1205 | } |
| 1206 | |
| 1207 | return enumeratorString; |
| 1208 | } |
| 1209 | |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 1210 | static bool validate_queue_family_indices(VkDevice device, const char *function_name, const uint32_t count, |
| 1211 | const uint32_t *indices) { |
| 1212 | bool skipCall = false; |
| 1213 | layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1214 | |
| 1215 | for (auto i = 0u; i < count; i++) { |
| 1216 | if (indices[i] == VK_QUEUE_FAMILY_IGNORED) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1217 | skipCall |= log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 1218 | INVALID_USAGE, "PARAMCHECK", |
| 1219 | "%s: the specified queueFamilyIndex cannot be VK_QUEUE_FAMILY_IGNORED.", function_name); |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 1220 | } else { |
| 1221 | const auto &queue_data = my_device_data->queueFamilyIndexMap.find(indices[i]); |
| 1222 | if (queue_data == my_device_data->queueFamilyIndexMap.end()) { |
| 1223 | skipCall |= log_msg( |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1224 | mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, |
| 1225 | "PARAMCHECK", |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 1226 | "VkGetDeviceQueue parameter, uint32_t queueFamilyIndex %d, must have been given when the device was created.", |
| 1227 | indices[i]); |
| 1228 | return false; |
| 1229 | } |
| 1230 | } |
| 1231 | } |
| 1232 | return skipCall; |
| 1233 | } |
| 1234 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1235 | static bool ValidateEnumerator(VkQueryControlFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1236 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_PRECISE_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1237 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1238 | return false; |
| 1239 | } |
| 1240 | |
| 1241 | return true; |
| 1242 | } |
| 1243 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1244 | static std::string EnumeratorString(VkQueryControlFlagBits const &enumerator) { |
| 1245 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1246 | return "unrecognized enumerator"; |
| 1247 | } |
| 1248 | |
| 1249 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1250 | if (enumerator & VK_QUERY_CONTROL_PRECISE_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 1251 | strings.push_back("VK_QUERY_CONTROL_PRECISE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1252 | } |
| 1253 | |
| 1254 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1255 | for (auto const &string : strings) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1256 | enumeratorString += string; |
| 1257 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1258 | if (string != strings.back()) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1259 | enumeratorString += '|'; |
| 1260 | } |
| 1261 | } |
| 1262 | |
| 1263 | return enumeratorString; |
| 1264 | } |
| 1265 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1266 | static const int MaxParamCheckerStringLength = 256; |
| 1267 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1268 | static bool validate_string(debug_report_data *report_data, const char *apiName, const char *stringName, |
| 1269 | const char *validateString) { |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1270 | assert(apiName != nullptr); |
| 1271 | assert(stringName != nullptr); |
| 1272 | assert(validateString != nullptr); |
| 1273 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1274 | bool skipCall = false; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1275 | |
| 1276 | VkStringErrorFlags result = vk_string_validate(MaxParamCheckerStringLength, validateString); |
| 1277 | |
| 1278 | if (result == VK_STRING_ERROR_NONE) { |
| 1279 | return skipCall; |
| 1280 | } else if (result & VK_STRING_ERROR_LENGTH) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1281 | skipCall = |
| 1282 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, |
| 1283 | "PARAMCHECK", "%s: string %s exceeds max length %d", apiName, stringName, MaxParamCheckerStringLength); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1284 | } else if (result & VK_STRING_ERROR_BAD_DATA) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1285 | skipCall = |
| 1286 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, |
| 1287 | "PARAMCHECK", "%s: string %s contains invalid characters or is badly formed", apiName, stringName); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1288 | } |
| 1289 | return skipCall; |
| 1290 | } |
| 1291 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1292 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1293 | vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1294 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1295 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1296 | VkLayerInstanceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1297 | assert(chain_info != nullptr); |
| 1298 | assert(chain_info->u.pLayerInfo != nullptr); |
| 1299 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1300 | PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr; |
| 1301 | PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance)fpGetInstanceProcAddr(NULL, "vkCreateInstance"); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1302 | if (fpCreateInstance == NULL) { |
| 1303 | return VK_ERROR_INITIALIZATION_FAILED; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1304 | } |
| 1305 | |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1306 | // Advance the link info for the next element on the chain |
| 1307 | chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext; |
| 1308 | |
| 1309 | result = fpCreateInstance(pCreateInfo, pAllocator, pInstance); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1310 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1311 | if (result == VK_SUCCESS) { |
| 1312 | layer_data *my_instance_data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map); |
| 1313 | assert(my_instance_data != nullptr); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1314 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1315 | VkLayerInstanceDispatchTable *pTable = initInstanceTable(*pInstance, fpGetInstanceProcAddr, pc_instance_table_map); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1316 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1317 | my_instance_data->report_data = debug_report_create_instance(pTable, *pInstance, pCreateInfo->enabledExtensionCount, |
| 1318 | pCreateInfo->ppEnabledExtensionNames); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1319 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1320 | // Look for one or more debug report create info structures |
| 1321 | // and setup a callback(s) for each one found. |
| 1322 | if (!layer_copy_tmp_callbacks(pCreateInfo->pNext, &my_instance_data->num_tmp_callbacks, |
| 1323 | &my_instance_data->tmp_dbg_create_infos, &my_instance_data->tmp_callbacks)) { |
| 1324 | if (my_instance_data->num_tmp_callbacks > 0) { |
| 1325 | // Setup the temporary callback(s) here to catch early issues: |
| 1326 | if (layer_enable_tmp_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_callbacks, |
| 1327 | my_instance_data->tmp_dbg_create_infos, my_instance_data->tmp_callbacks)) { |
| 1328 | // Failure of setting up one or more of the callback. |
| 1329 | // Therefore, clean up and don't use those callbacks: |
| 1330 | layer_free_tmp_callbacks(my_instance_data->tmp_dbg_create_infos, my_instance_data->tmp_callbacks); |
| 1331 | my_instance_data->num_tmp_callbacks = 0; |
| 1332 | } |
| 1333 | } |
| 1334 | } |
| 1335 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1336 | init_parameter_validation(my_instance_data, pAllocator); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1337 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1338 | // Ordinarily we'd check these before calling down the chain, but none of the layer |
| 1339 | // support is in place until now, if we survive we can report the issue now. |
| 1340 | parameter_validation_vkCreateInstance(my_instance_data->report_data, pCreateInfo, pAllocator, pInstance); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1341 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1342 | if (pCreateInfo->pApplicationInfo) { |
| 1343 | if (pCreateInfo->pApplicationInfo->pApplicationName) { |
| 1344 | validate_string(my_instance_data->report_data, "vkCreateInstance", |
| 1345 | "pCreateInfo->VkApplicationInfo->pApplicationName", |
| 1346 | pCreateInfo->pApplicationInfo->pApplicationName); |
| 1347 | } |
Courtney Goeltzenleuchter | 842691b | 2016-02-10 14:00:52 -0700 | [diff] [blame] | 1348 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1349 | if (pCreateInfo->pApplicationInfo->pEngineName) { |
| 1350 | validate_string(my_instance_data->report_data, "vkCreateInstance", "pCreateInfo->VkApplicationInfo->pEngineName", |
| 1351 | pCreateInfo->pApplicationInfo->pEngineName); |
| 1352 | } |
Courtney Goeltzenleuchter | 41c5c4b | 2016-02-10 15:13:55 -0700 | [diff] [blame] | 1353 | } |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1354 | |
| 1355 | // Disable the tmp callbacks: |
| 1356 | if (my_instance_data->num_tmp_callbacks > 0) { |
| 1357 | layer_disable_tmp_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_callbacks, |
| 1358 | my_instance_data->tmp_callbacks); |
| 1359 | } |
Courtney Goeltzenleuchter | 842691b | 2016-02-10 14:00:52 -0700 | [diff] [blame] | 1360 | } |
| 1361 | |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1362 | return result; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1363 | } |
| 1364 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1365 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1366 | // Grab the key before the instance is destroyed. |
| 1367 | dispatch_key key = get_dispatch_key(instance); |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1368 | bool skipCall = false; |
Courtney Goeltzenleuchter | d29f4f0 | 2015-10-05 15:59:45 -0600 | [diff] [blame] | 1369 | layer_data *my_data = get_my_data_ptr(key, layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1370 | assert(my_data != NULL); |
| 1371 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1372 | // Enable the temporary callback(s) here to catch vkDestroyInstance issues: |
| 1373 | bool callback_setup = false; |
| 1374 | if (my_data->num_tmp_callbacks > 0) { |
| 1375 | if (!layer_enable_tmp_callbacks(my_data->report_data, my_data->num_tmp_callbacks, my_data->tmp_dbg_create_infos, |
| 1376 | my_data->tmp_callbacks)) { |
| 1377 | callback_setup = true; |
| 1378 | } |
| 1379 | } |
| 1380 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1381 | skipCall |= parameter_validation_vkDestroyInstance(my_data->report_data, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1382 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1383 | // Disable and cleanup the temporary callback(s): |
| 1384 | if (callback_setup) { |
| 1385 | layer_disable_tmp_callbacks(my_data->report_data, my_data->num_tmp_callbacks, my_data->tmp_callbacks); |
| 1386 | } |
| 1387 | if (my_data->num_tmp_callbacks > 0) { |
| 1388 | layer_free_tmp_callbacks(my_data->tmp_dbg_create_infos, my_data->tmp_callbacks); |
| 1389 | my_data->num_tmp_callbacks = 0; |
| 1390 | } |
| 1391 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1392 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1393 | VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1394 | pTable->DestroyInstance(instance, pAllocator); |
| 1395 | |
| 1396 | // Clean up logging callback, if any |
| 1397 | while (my_data->logging_callback.size() > 0) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1398 | VkDebugReportCallbackEXT callback = my_data->logging_callback.back(); |
| 1399 | layer_destroy_msg_callback(my_data->report_data, callback, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1400 | my_data->logging_callback.pop_back(); |
| 1401 | } |
| 1402 | |
| 1403 | layer_debug_report_destroy_instance(mid(instance)); |
| 1404 | layer_data_map.erase(pTable); |
| 1405 | |
| 1406 | pc_instance_table_map.erase(key); |
Tony Barbour | 24edb7c | 2016-03-22 13:23:24 -0600 | [diff] [blame] | 1407 | layer_data_map.erase(key); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1408 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1409 | } |
| 1410 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1411 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1412 | vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices) { |
| 1413 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1414 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1415 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1416 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1417 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1418 | skipCall |= parameter_validation_vkEnumeratePhysicalDevices(my_data->report_data, pPhysicalDeviceCount, pPhysicalDevices); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1419 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1420 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1421 | result = get_dispatch_table(pc_instance_table_map, instance) |
| 1422 | ->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1423 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1424 | validate_result(my_data->report_data, "vkEnumeratePhysicalDevices", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1425 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1426 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1427 | return result; |
| 1428 | } |
| 1429 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1430 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1431 | vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1432 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1433 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1434 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1435 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1436 | skipCall |= parameter_validation_vkGetPhysicalDeviceFeatures(my_data->report_data, pFeatures); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1437 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1438 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1439 | get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1440 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1441 | } |
| 1442 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1443 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1444 | vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1445 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1446 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1447 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1448 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1449 | skipCall |= parameter_validation_vkGetPhysicalDeviceFormatProperties(my_data->report_data, format, pFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1450 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1451 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1452 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1453 | ->GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1454 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1455 | } |
| 1456 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1457 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1458 | vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, |
| 1459 | VkImageUsageFlags usage, VkImageCreateFlags flags, |
| 1460 | VkImageFormatProperties *pImageFormatProperties) { |
| 1461 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1462 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1463 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1464 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1465 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1466 | skipCall |= parameter_validation_vkGetPhysicalDeviceImageFormatProperties(my_data->report_data, format, type, tiling, usage, flags, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1467 | pImageFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1468 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1469 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1470 | result = get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1471 | ->GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, |
| 1472 | pImageFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1473 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1474 | validate_result(my_data->report_data, "vkGetPhysicalDeviceImageFormatProperties", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1475 | } |
Chia-I Wu | 1724104 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 1476 | |
| 1477 | return result; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1478 | } |
| 1479 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1480 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1481 | vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1482 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1483 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1484 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1485 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1486 | skipCall |= parameter_validation_vkGetPhysicalDeviceProperties(my_data->report_data, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1487 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1488 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1489 | get_dispatch_table(pc_instance_table_map, physicalDevice)->GetPhysicalDeviceProperties(physicalDevice, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1490 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1491 | } |
| 1492 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1493 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1494 | vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, |
| 1495 | VkQueueFamilyProperties *pQueueFamilyProperties) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1496 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1497 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1498 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1499 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1500 | skipCall |= parameter_validation_vkGetPhysicalDeviceQueueFamilyProperties(my_data->report_data, pQueueFamilyPropertyCount, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1501 | pQueueFamilyProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1502 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1503 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1504 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1505 | ->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1506 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1507 | } |
| 1508 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1509 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1510 | vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1511 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1512 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1513 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1514 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1515 | skipCall |= parameter_validation_vkGetPhysicalDeviceMemoryProperties(my_data->report_data, pMemoryProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1516 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1517 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1518 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1519 | ->GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1520 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1521 | } |
| 1522 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1523 | void validateDeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, |
| 1524 | const std::vector<VkQueueFamilyProperties> properties) { |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1525 | std::unordered_set<uint32_t> set; |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1526 | |
| 1527 | if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { |
| 1528 | for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) { |
| 1529 | if (set.count(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex)) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1530 | log_msg(mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 1531 | INVALID_USAGE, "PARAMCHECK", |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1532 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueFamilyIndex, is not unique within this " |
| 1533 | "structure.", |
| 1534 | i); |
| 1535 | } else { |
| 1536 | set.insert(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex); |
Michael Lentine | fa71bd5 | 2016-01-27 12:50:30 -0600 | [diff] [blame] | 1537 | } |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1538 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1539 | if (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities != nullptr) { |
| 1540 | for (uint32_t j = 0; j < pCreateInfo->pQueueCreateInfos[i].queueCount; ++j) { |
| 1541 | if ((pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j] < 0.f) || |
| 1542 | (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j] > 1.f)) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1543 | log_msg(mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 1544 | __LINE__, INVALID_USAGE, "PARAMCHECK", |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1545 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->pQueuePriorities[%d], must be " |
| 1546 | "between 0 and 1. Actual value is %f", |
| 1547 | i, j, pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j]); |
| 1548 | } |
| 1549 | } |
| 1550 | } |
| 1551 | |
| 1552 | if (pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex >= properties.size()) { |
| 1553 | log_msg( |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1554 | mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 1555 | INVALID_USAGE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1556 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueFamilyIndex cannot be more than the number " |
| 1557 | "of queue families.", |
| 1558 | i); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1559 | } else if (pCreateInfo->pQueueCreateInfos[i].queueCount > |
| 1560 | properties[pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex].queueCount) { |
| 1561 | log_msg( |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1562 | mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 1563 | INVALID_USAGE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1564 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueCount cannot be more than the number of " |
| 1565 | "queues for the given family index.", |
| 1566 | i); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1567 | } |
Michael Lentine | 774704f | 2016-01-27 13:36:46 -0600 | [diff] [blame] | 1568 | } |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1569 | } |
| 1570 | } |
| 1571 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1572 | void storeCreateDeviceData(VkDevice device, const VkDeviceCreateInfo *pCreateInfo) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1573 | layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1574 | |
| 1575 | if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { |
| 1576 | for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) { |
| 1577 | my_device_data->queueFamilyIndexMap.insert( |
| 1578 | std::make_pair(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex, pCreateInfo->pQueueCreateInfos[i].queueCount)); |
| 1579 | } |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1580 | } |
| 1581 | } |
| 1582 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1583 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, |
| 1584 | const VkDeviceCreateInfo *pCreateInfo, |
| 1585 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { |
Courtney Goeltzenleuchter | bafcdf3 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 1586 | /* |
Courtney Goeltzenleuchter | bafcdf3 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 1587 | * NOTE: We do not validate physicalDevice or any dispatchable |
| 1588 | * object as the first parameter. We couldn't get here if it was wrong! |
| 1589 | */ |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1590 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1591 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1592 | bool skipCall = false; |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1593 | layer_data *my_instance_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1594 | assert(my_instance_data != nullptr); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1595 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1596 | skipCall |= parameter_validation_vkCreateDevice(my_instance_data->report_data, pCreateInfo, pAllocator, pDevice); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1597 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1598 | if (pCreateInfo != NULL) { |
| 1599 | if ((pCreateInfo->enabledLayerCount > 0) && (pCreateInfo->ppEnabledLayerNames != NULL)) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 1600 | for (size_t i = 0; i < pCreateInfo->enabledLayerCount; i++) { |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1601 | skipCall |= validate_string(my_instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledLayerNames", |
| 1602 | pCreateInfo->ppEnabledLayerNames[i]); |
| 1603 | } |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1604 | } |
Michael Lentine | 774704f | 2016-01-27 13:36:46 -0600 | [diff] [blame] | 1605 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1606 | if ((pCreateInfo->enabledExtensionCount > 0) && (pCreateInfo->ppEnabledExtensionNames != NULL)) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 1607 | for (size_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1608 | skipCall |= validate_string(my_instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledExtensionNames", |
| 1609 | pCreateInfo->ppEnabledExtensionNames[i]); |
| 1610 | } |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1611 | } |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1612 | } |
| 1613 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1614 | if (!skipCall) { |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1615 | VkLayerDeviceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1616 | assert(chain_info != nullptr); |
| 1617 | assert(chain_info->u.pLayerInfo != nullptr); |
| 1618 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1619 | PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr; |
| 1620 | PFN_vkGetDeviceProcAddr fpGetDeviceProcAddr = chain_info->u.pLayerInfo->pfnNextGetDeviceProcAddr; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1621 | PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice)fpGetInstanceProcAddr(NULL, "vkCreateDevice"); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1622 | if (fpCreateDevice == NULL) { |
| 1623 | return VK_ERROR_INITIALIZATION_FAILED; |
| 1624 | } |
| 1625 | |
| 1626 | // Advance the link info for the next element on the chain |
| 1627 | chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext; |
| 1628 | |
| 1629 | result = fpCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1630 | |
| 1631 | validate_result(my_instance_data->report_data, "vkCreateDevice", result); |
| 1632 | |
| 1633 | if (result == VK_SUCCESS) { |
| 1634 | layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(*pDevice), layer_data_map); |
| 1635 | assert(my_device_data != nullptr); |
| 1636 | |
| 1637 | my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice); |
| 1638 | initDeviceTable(*pDevice, fpGetDeviceProcAddr, pc_device_table_map); |
| 1639 | |
| 1640 | uint32_t count; |
| 1641 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1642 | ->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, nullptr); |
| 1643 | std::vector<VkQueueFamilyProperties> properties(count); |
| 1644 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1645 | ->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, &properties[0]); |
| 1646 | |
| 1647 | validateDeviceCreateInfo(physicalDevice, pCreateInfo, properties); |
| 1648 | storeCreateDeviceData(*pDevice, pCreateInfo); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1649 | } |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1650 | } |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1651 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1652 | return result; |
| 1653 | } |
| 1654 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1655 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1656 | dispatch_key key = get_dispatch_key(device); |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1657 | bool skipCall = false; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1658 | layer_data *my_data = get_my_data_ptr(key, layer_data_map); |
| 1659 | assert(my_data != NULL); |
| 1660 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1661 | skipCall |= parameter_validation_vkDestroyDevice(my_data->report_data, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1662 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1663 | if (!skipCall) { |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1664 | layer_debug_report_destroy_device(device); |
| 1665 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1666 | #if DISPATCH_MAP_DEBUG |
Mark Mueller | aab3650 | 2016-05-03 13:17:29 -0600 | [diff] [blame^] | 1667 | fprintf(stderr, "Device: 0x%p, key: 0x%p\n", device, key); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1668 | #endif |
| 1669 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1670 | get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1671 | pc_device_table_map.erase(key); |
Tony Barbour | d4eb06d | 2016-03-29 15:14:59 -0600 | [diff] [blame] | 1672 | layer_data_map.erase(key); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1673 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1674 | } |
| 1675 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1676 | bool PreGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1677 | layer_data *my_device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1678 | assert(my_device_data != nullptr); |
| 1679 | |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 1680 | validate_queue_family_indices(device, "vkGetDeviceQueue", 1, &queueFamilyIndex); |
| 1681 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1682 | const auto &queue_data = my_device_data->queueFamilyIndexMap.find(queueFamilyIndex); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1683 | if (queue_data->second <= queueIndex) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1684 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, |
| 1685 | "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1686 | "VkGetDeviceQueue parameter, uint32_t queueIndex %d, must be less than the number of queues given when the device " |
| 1687 | "was created.", |
| 1688 | queueIndex); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1689 | return false; |
| 1690 | } |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1691 | |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1692 | return true; |
| 1693 | } |
| 1694 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1695 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1696 | vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1697 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1698 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1699 | assert(my_data != NULL); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1700 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1701 | skipCall |= parameter_validation_vkGetDeviceQueue(my_data->report_data, queueFamilyIndex, queueIndex, pQueue); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1702 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1703 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1704 | PreGetDeviceQueue(device, queueFamilyIndex, queueIndex); |
| 1705 | |
| 1706 | get_dispatch_table(pc_device_table_map, device)->GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1707 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1708 | } |
| 1709 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1710 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1711 | vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) { |
| 1712 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1713 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1714 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1715 | assert(my_data != NULL); |
| 1716 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1717 | skipCall |= parameter_validation_vkQueueSubmit(my_data->report_data, submitCount, pSubmits, fence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1718 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1719 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1720 | result = get_dispatch_table(pc_device_table_map, queue)->QueueSubmit(queue, submitCount, pSubmits, fence); |
| 1721 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1722 | validate_result(my_data->report_data, "vkQueueSubmit", result); |
Courtney Goeltzenleuchter | 646b907 | 2015-10-20 18:04:07 -0600 | [diff] [blame] | 1723 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1724 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1725 | return result; |
| 1726 | } |
| 1727 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1728 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) { |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1729 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map); |
| 1730 | assert(my_data != NULL); |
| 1731 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1732 | VkResult result = get_dispatch_table(pc_device_table_map, queue)->QueueWaitIdle(queue); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1733 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1734 | validate_result(my_data->report_data, "vkQueueWaitIdle", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1735 | |
| 1736 | return result; |
| 1737 | } |
| 1738 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1739 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) { |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1740 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1741 | assert(my_data != NULL); |
| 1742 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1743 | VkResult result = get_dispatch_table(pc_device_table_map, device)->DeviceWaitIdle(device); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1744 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1745 | validate_result(my_data->report_data, "vkDeviceWaitIdle", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1746 | |
| 1747 | return result; |
| 1748 | } |
| 1749 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1750 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, |
| 1751 | const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) { |
| 1752 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1753 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1754 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1755 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1756 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1757 | skipCall |= parameter_validation_vkAllocateMemory(my_data->report_data, pAllocateInfo, pAllocator, pMemory); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1758 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1759 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1760 | result = get_dispatch_table(pc_device_table_map, device)->AllocateMemory(device, pAllocateInfo, pAllocator, pMemory); |
| 1761 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1762 | validate_result(my_data->report_data, "vkAllocateMemory", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1763 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1764 | |
| 1765 | return result; |
| 1766 | } |
| 1767 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1768 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1769 | vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1770 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1771 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1772 | assert(my_data != NULL); |
| 1773 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1774 | skipCall |= parameter_validation_vkFreeMemory(my_data->report_data, memory, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1775 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1776 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1777 | get_dispatch_table(pc_device_table_map, device)->FreeMemory(device, memory, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1778 | } |
| 1779 | } |
| 1780 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1781 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1782 | vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData) { |
| 1783 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1784 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1785 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1786 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1787 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1788 | skipCall |= parameter_validation_vkMapMemory(my_data->report_data, memory, offset, size, flags, ppData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1789 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1790 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1791 | result = get_dispatch_table(pc_device_table_map, device)->MapMemory(device, memory, offset, size, flags, ppData); |
| 1792 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1793 | validate_result(my_data->report_data, "vkMapMemory", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1794 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1795 | |
| 1796 | return result; |
| 1797 | } |
| 1798 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1799 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory memory) { |
| 1800 | bool skipCall = false; |
| 1801 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1802 | assert(my_data != NULL); |
| 1803 | |
| 1804 | skipCall |= parameter_validation_vkUnmapMemory(my_data->report_data, memory); |
| 1805 | |
| 1806 | if (!skipCall) { |
| 1807 | get_dispatch_table(pc_device_table_map, device)->UnmapMemory(device, memory); |
| 1808 | } |
| 1809 | } |
| 1810 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1811 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1812 | vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges) { |
| 1813 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1814 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1815 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1816 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1817 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1818 | skipCall |= parameter_validation_vkFlushMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges); |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 1819 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1820 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1821 | result = get_dispatch_table(pc_device_table_map, device)->FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
| 1822 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1823 | validate_result(my_data->report_data, "vkFlushMappedMemoryRanges", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1824 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1825 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1826 | return result; |
| 1827 | } |
| 1828 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1829 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1830 | vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges) { |
| 1831 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1832 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1833 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1834 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1835 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1836 | skipCall |= parameter_validation_vkInvalidateMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges); |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1837 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1838 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1839 | result = |
| 1840 | get_dispatch_table(pc_device_table_map, device)->InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1841 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1842 | validate_result(my_data->report_data, "vkInvalidateMappedMemoryRanges", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1843 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1844 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 1845 | return result; |
| 1846 | } |
| 1847 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1848 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1849 | vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1850 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1851 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1852 | assert(my_data != NULL); |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1853 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1854 | skipCall |= parameter_validation_vkGetDeviceMemoryCommitment(my_data->report_data, memory, pCommittedMemoryInBytes); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1855 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1856 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1857 | get_dispatch_table(pc_device_table_map, device)->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1858 | } |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1859 | } |
| 1860 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1861 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, |
| 1862 | VkDeviceSize memoryOffset) { |
| 1863 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 1864 | bool skipCall = false; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1865 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1866 | assert(my_data != NULL); |
| 1867 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1868 | skipCall |= parameter_validation_vkBindBufferMemory(my_data->report_data, buffer, memory, memoryOffset); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1869 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1870 | if (!skipCall) { |
| 1871 | result = get_dispatch_table(pc_device_table_map, device)->BindBufferMemory(device, buffer, memory, memoryOffset); |
| 1872 | |
| 1873 | validate_result(my_data->report_data, "vkBindBufferMemory", result); |
| 1874 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1875 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1876 | return result; |
| 1877 | } |
| 1878 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1879 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, |
| 1880 | VkDeviceSize memoryOffset) { |
| 1881 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 1882 | bool skipCall = false; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1883 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 1884 | assert(my_data != NULL); |
| 1885 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1886 | skipCall |= parameter_validation_vkBindImageMemory(my_data->report_data, image, memory, memoryOffset); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1887 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1888 | if (!skipCall) { |
| 1889 | result = get_dispatch_table(pc_device_table_map, device)->BindImageMemory(device, image, memory, memoryOffset); |
| 1890 | |
| 1891 | validate_result(my_data->report_data, "vkBindImageMemory", result); |
| 1892 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1893 | |
| 1894 | return result; |
| 1895 | } |
| 1896 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1897 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1898 | vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1899 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1900 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1901 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1902 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1903 | skipCall |= parameter_validation_vkGetBufferMemoryRequirements(my_data->report_data, buffer, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1904 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1905 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1906 | get_dispatch_table(pc_device_table_map, device)->GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1907 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1908 | } |
| 1909 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1910 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1911 | vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1912 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1913 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1914 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1915 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1916 | skipCall |= parameter_validation_vkGetImageMemoryRequirements(my_data->report_data, image, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1917 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1918 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1919 | get_dispatch_table(pc_device_table_map, device)->GetImageMemoryRequirements(device, image, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1920 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1921 | } |
| 1922 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1923 | bool PostGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pNumRequirements, |
| 1924 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
| 1925 | if (pSparseMemoryRequirements != nullptr) { |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1926 | if ((pSparseMemoryRequirements->formatProperties.aspectMask & |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1927 | (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1928 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1929 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 1930 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1931 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect " |
| 1932 | "pSparseMemoryRequirements->formatProperties.aspectMask, is an unrecognized enumerator"); |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1933 | return false; |
| 1934 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1935 | } |
| 1936 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1937 | return true; |
| 1938 | } |
| 1939 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1940 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1941 | vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, |
| 1942 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1943 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1944 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1945 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1946 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1947 | skipCall |= parameter_validation_vkGetImageSparseMemoryRequirements(my_data->report_data, image, pSparseMemoryRequirementCount, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1948 | pSparseMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1949 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1950 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1951 | get_dispatch_table(pc_device_table_map, device) |
| 1952 | ->GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1953 | |
| 1954 | PostGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 1955 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1956 | } |
| 1957 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1958 | bool PostGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, |
| 1959 | VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, |
| 1960 | uint32_t *pNumProperties, VkSparseImageFormatProperties *pProperties) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1961 | if (pProperties != nullptr) { |
| 1962 | if ((pProperties->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1963 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 1964 | log_msg(mdd(physicalDevice), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 1965 | "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1966 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspectMask, is an " |
| 1967 | "unrecognized enumerator"); |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1968 | return false; |
| 1969 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1970 | } |
| 1971 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1972 | return true; |
| 1973 | } |
| 1974 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1975 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 1976 | vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, |
| 1977 | VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, |
| 1978 | uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1979 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1980 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1981 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1982 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 1983 | skipCall |= parameter_validation_vkGetPhysicalDeviceSparseImageFormatProperties(my_data->report_data, format, type, samples, usage, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1984 | tiling, pPropertyCount, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1985 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1986 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1987 | get_dispatch_table(pc_instance_table_map, physicalDevice) |
| 1988 | ->GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, |
| 1989 | pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1990 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1991 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, |
| 1992 | pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1993 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1994 | } |
| 1995 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1996 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 1997 | vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence) { |
| 1998 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1999 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2000 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2001 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2002 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2003 | skipCall |= parameter_validation_vkQueueBindSparse(my_data->report_data, bindInfoCount, pBindInfo, fence); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2004 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2005 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2006 | result = get_dispatch_table(pc_device_table_map, queue)->QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); |
| 2007 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2008 | validate_result(my_data->report_data, "vkQueueBindSparse", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2009 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2010 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2011 | return result; |
| 2012 | } |
| 2013 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2014 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2015 | vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
| 2016 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2017 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2018 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2019 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2020 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2021 | skipCall |= parameter_validation_vkCreateFence(my_data->report_data, pCreateInfo, pAllocator, pFence); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2022 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2023 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2024 | result = get_dispatch_table(pc_device_table_map, device)->CreateFence(device, pCreateInfo, pAllocator, pFence); |
| 2025 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2026 | validate_result(my_data->report_data, "vkCreateFence", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2027 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2028 | |
| 2029 | return result; |
| 2030 | } |
| 2031 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2032 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2033 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2034 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2035 | assert(my_data != NULL); |
| 2036 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2037 | skipCall |= parameter_validation_vkDestroyFence(my_data->report_data, fence, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2038 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2039 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2040 | get_dispatch_table(pc_device_table_map, device)->DestroyFence(device, fence, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2041 | } |
| 2042 | } |
| 2043 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2044 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) { |
| 2045 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2046 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2047 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2048 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2049 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2050 | skipCall |= parameter_validation_vkResetFences(my_data->report_data, fenceCount, pFences); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2051 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2052 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2053 | result = get_dispatch_table(pc_device_table_map, device)->ResetFences(device, fenceCount, pFences); |
| 2054 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2055 | validate_result(my_data->report_data, "vkResetFences", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2056 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2057 | |
| 2058 | return result; |
| 2059 | } |
| 2060 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2061 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2062 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 2063 | bool skipCall = false; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2064 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2065 | assert(my_data != NULL); |
| 2066 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2067 | skipCall |= parameter_validation_vkGetFenceStatus(my_data->report_data, fence); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2068 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2069 | if (!skipCall) { |
| 2070 | result = get_dispatch_table(pc_device_table_map, device)->GetFenceStatus(device, fence); |
| 2071 | |
| 2072 | validate_result(my_data->report_data, "vkGetFenceStatus", result); |
| 2073 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2074 | |
| 2075 | return result; |
| 2076 | } |
| 2077 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2078 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2079 | vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout) { |
| 2080 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2081 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2082 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2083 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2084 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2085 | skipCall |= parameter_validation_vkWaitForFences(my_data->report_data, fenceCount, pFences, waitAll, timeout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2086 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2087 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2088 | result = get_dispatch_table(pc_device_table_map, device)->WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
| 2089 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2090 | validate_result(my_data->report_data, "vkWaitForFences", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2091 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2092 | |
| 2093 | return result; |
| 2094 | } |
| 2095 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2096 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, |
| 2097 | const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) { |
| 2098 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2099 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2100 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2101 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2102 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2103 | skipCall |= parameter_validation_vkCreateSemaphore(my_data->report_data, pCreateInfo, pAllocator, pSemaphore); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2104 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2105 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2106 | result = get_dispatch_table(pc_device_table_map, device)->CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore); |
| 2107 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2108 | validate_result(my_data->report_data, "vkCreateSemaphore", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2109 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2110 | |
| 2111 | return result; |
| 2112 | } |
| 2113 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2114 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2115 | vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2116 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2117 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2118 | assert(my_data != NULL); |
| 2119 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2120 | skipCall |= parameter_validation_vkDestroySemaphore(my_data->report_data, semaphore, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2121 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2122 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2123 | get_dispatch_table(pc_device_table_map, device)->DestroySemaphore(device, semaphore, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2124 | } |
| 2125 | } |
| 2126 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2127 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2128 | vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) { |
| 2129 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2130 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2131 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2132 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2133 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2134 | skipCall |= parameter_validation_vkCreateEvent(my_data->report_data, pCreateInfo, pAllocator, pEvent); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2135 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2136 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2137 | result = get_dispatch_table(pc_device_table_map, device)->CreateEvent(device, pCreateInfo, pAllocator, pEvent); |
| 2138 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2139 | validate_result(my_data->report_data, "vkCreateEvent", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2140 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2141 | |
| 2142 | return result; |
| 2143 | } |
| 2144 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2145 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2146 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2147 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2148 | assert(my_data != NULL); |
| 2149 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2150 | skipCall |= parameter_validation_vkDestroyEvent(my_data->report_data, event, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2151 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2152 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2153 | get_dispatch_table(pc_device_table_map, device)->DestroyEvent(device, event, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2154 | } |
| 2155 | } |
| 2156 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2157 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2158 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 2159 | bool skipCall = false; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2160 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2161 | assert(my_data != NULL); |
| 2162 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2163 | skipCall |= parameter_validation_vkGetEventStatus(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2164 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2165 | if (!skipCall) { |
| 2166 | result = get_dispatch_table(pc_device_table_map, device)->GetEventStatus(device, event); |
| 2167 | |
| 2168 | validate_result(my_data->report_data, "vkGetEventStatus", result); |
| 2169 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2170 | |
| 2171 | return result; |
| 2172 | } |
| 2173 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2174 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2175 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 2176 | bool skipCall = false; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2177 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2178 | assert(my_data != NULL); |
| 2179 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2180 | skipCall |= parameter_validation_vkSetEvent(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2181 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2182 | if (!skipCall) { |
| 2183 | result = get_dispatch_table(pc_device_table_map, device)->SetEvent(device, event); |
| 2184 | |
| 2185 | validate_result(my_data->report_data, "vkSetEvent", result); |
| 2186 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2187 | |
| 2188 | return result; |
| 2189 | } |
| 2190 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2191 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2192 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 2193 | bool skipCall = false; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2194 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2195 | assert(my_data != NULL); |
| 2196 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2197 | skipCall |= parameter_validation_vkResetEvent(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2198 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2199 | if (!skipCall) { |
| 2200 | result = get_dispatch_table(pc_device_table_map, device)->ResetEvent(device, event); |
| 2201 | |
| 2202 | validate_result(my_data->report_data, "vkResetEvent", result); |
| 2203 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2204 | |
| 2205 | return result; |
| 2206 | } |
| 2207 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2208 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, |
| 2209 | const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) { |
| 2210 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2211 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2212 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2213 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2214 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2215 | skipCall |= parameter_validation_vkCreateQueryPool(my_data->report_data, pCreateInfo, pAllocator, pQueryPool); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2216 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2217 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2218 | result = get_dispatch_table(pc_device_table_map, device)->CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool); |
| 2219 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2220 | validate_result(my_data->report_data, "vkCreateQueryPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2221 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2222 | |
| 2223 | return result; |
| 2224 | } |
| 2225 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2226 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2227 | vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2228 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2229 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2230 | assert(my_data != NULL); |
| 2231 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2232 | skipCall |= parameter_validation_vkDestroyQueryPool(my_data->report_data, queryPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2233 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2234 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2235 | get_dispatch_table(pc_device_table_map, device)->DestroyQueryPool(device, queryPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2236 | } |
| 2237 | } |
| 2238 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2239 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, |
| 2240 | uint32_t queryCount, size_t dataSize, void *pData, |
| 2241 | VkDeviceSize stride, VkQueryResultFlags flags) { |
| 2242 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2243 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2244 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2245 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2246 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2247 | skipCall |= |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2248 | parameter_validation_vkGetQueryPoolResults(my_data->report_data, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2249 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2250 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2251 | result = get_dispatch_table(pc_device_table_map, device) |
| 2252 | ->GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2253 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2254 | validate_result(my_data->report_data, "vkGetQueryPoolResults", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2255 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2256 | |
| 2257 | return result; |
| 2258 | } |
| 2259 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2260 | bool PreCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo) { |
| 2261 | if (pCreateInfo != nullptr) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2262 | if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 2263 | validate_queue_family_indices(device, "vkCreateBuffer", pCreateInfo->queueFamilyIndexCount, |
| 2264 | pCreateInfo->pQueueFamilyIndices); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2265 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2266 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2267 | |
| 2268 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2269 | } |
| 2270 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2271 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2272 | vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) { |
| 2273 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2274 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2275 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2276 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2277 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2278 | skipCall |= parameter_validation_vkCreateBuffer(my_data->report_data, pCreateInfo, pAllocator, pBuffer); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2279 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2280 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2281 | PreCreateBuffer(device, pCreateInfo); |
| 2282 | |
| 2283 | result = get_dispatch_table(pc_device_table_map, device)->CreateBuffer(device, pCreateInfo, pAllocator, pBuffer); |
| 2284 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2285 | validate_result(my_data->report_data, "vkCreateBuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2286 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2287 | |
| 2288 | return result; |
| 2289 | } |
| 2290 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2291 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2292 | vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2293 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2294 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2295 | assert(my_data != NULL); |
| 2296 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2297 | skipCall |= parameter_validation_vkDestroyBuffer(my_data->report_data, buffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2298 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2299 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2300 | get_dispatch_table(pc_device_table_map, device)->DestroyBuffer(device, buffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2301 | } |
| 2302 | } |
| 2303 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2304 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, |
| 2305 | const VkAllocationCallbacks *pAllocator, VkBufferView *pView) { |
| 2306 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2307 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2308 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2309 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2310 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2311 | skipCall |= parameter_validation_vkCreateBufferView(my_data->report_data, pCreateInfo, pAllocator, pView); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2312 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2313 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2314 | result = get_dispatch_table(pc_device_table_map, device)->CreateBufferView(device, pCreateInfo, pAllocator, pView); |
| 2315 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2316 | validate_result(my_data->report_data, "vkCreateBufferView", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2317 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2318 | |
| 2319 | return result; |
| 2320 | } |
| 2321 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2322 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2323 | vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2324 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2325 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2326 | assert(my_data != NULL); |
| 2327 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2328 | skipCall |= parameter_validation_vkDestroyBufferView(my_data->report_data, bufferView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2329 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2330 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2331 | get_dispatch_table(pc_device_table_map, device)->DestroyBufferView(device, bufferView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2332 | } |
| 2333 | } |
| 2334 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2335 | bool PreCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo) { |
| 2336 | if (pCreateInfo != nullptr) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2337 | if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 2338 | validate_queue_family_indices(device, "vkCreateImage", pCreateInfo->queueFamilyIndexCount, |
| 2339 | pCreateInfo->pQueueFamilyIndices); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2340 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2341 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2342 | |
| 2343 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2344 | } |
| 2345 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2346 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2347 | vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage) { |
| 2348 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2349 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2350 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2351 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2352 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2353 | skipCall |= parameter_validation_vkCreateImage(my_data->report_data, pCreateInfo, pAllocator, pImage); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2354 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2355 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2356 | PreCreateImage(device, pCreateInfo); |
| 2357 | |
| 2358 | result = get_dispatch_table(pc_device_table_map, device)->CreateImage(device, pCreateInfo, pAllocator, pImage); |
| 2359 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2360 | validate_result(my_data->report_data, "vkCreateImage", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2361 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2362 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2363 | return result; |
| 2364 | } |
| 2365 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2366 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2367 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2368 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2369 | assert(my_data != NULL); |
| 2370 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2371 | skipCall |= parameter_validation_vkDestroyImage(my_data->report_data, image, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2372 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2373 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2374 | get_dispatch_table(pc_device_table_map, device)->DestroyImage(device, image, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2375 | } |
| 2376 | } |
| 2377 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2378 | bool PreGetImageSubresourceLayout(VkDevice device, const VkImageSubresource *pSubresource) { |
| 2379 | if (pSubresource != nullptr) { |
| 2380 | if ((pSubresource->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 2381 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 2382 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2383 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2384 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspectMask, is an unrecognized enumerator"); |
| 2385 | return false; |
| 2386 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2387 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2388 | |
| 2389 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2390 | } |
| 2391 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2392 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2393 | vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2394 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2395 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2396 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2397 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2398 | skipCall |= parameter_validation_vkGetImageSubresourceLayout(my_data->report_data, image, pSubresource, pLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2399 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2400 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2401 | PreGetImageSubresourceLayout(device, pSubresource); |
| 2402 | |
| 2403 | get_dispatch_table(pc_device_table_map, device)->GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2404 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2405 | } |
| 2406 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2407 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, |
| 2408 | const VkAllocationCallbacks *pAllocator, VkImageView *pView) { |
| 2409 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2410 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2411 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2412 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2413 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2414 | skipCall |= parameter_validation_vkCreateImageView(my_data->report_data, pCreateInfo, pAllocator, pView); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2415 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2416 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2417 | result = get_dispatch_table(pc_device_table_map, device)->CreateImageView(device, pCreateInfo, pAllocator, pView); |
| 2418 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2419 | validate_result(my_data->report_data, "vkCreateImageView", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2420 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2421 | |
| 2422 | return result; |
| 2423 | } |
| 2424 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2425 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2426 | vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2427 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2428 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2429 | assert(my_data != NULL); |
| 2430 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2431 | skipCall |= parameter_validation_vkDestroyImageView(my_data->report_data, imageView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2432 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2433 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2434 | get_dispatch_table(pc_device_table_map, device)->DestroyImageView(device, imageView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2435 | } |
| 2436 | } |
| 2437 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2438 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, |
| 2439 | const VkAllocationCallbacks *pAllocator, |
| 2440 | VkShaderModule *pShaderModule) { |
| 2441 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2442 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2443 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2444 | assert(my_data != NULL); |
| 2445 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2446 | skipCall |= parameter_validation_vkCreateShaderModule(my_data->report_data, pCreateInfo, pAllocator, pShaderModule); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2447 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2448 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2449 | result = |
| 2450 | get_dispatch_table(pc_device_table_map, device)->CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2451 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2452 | validate_result(my_data->report_data, "vkCreateShaderModule", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2453 | } |
| 2454 | |
Michael Lentine | 03d8e57 | 2015-09-15 14:59:14 -0500 | [diff] [blame] | 2455 | return result; |
| 2456 | } |
| 2457 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2458 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2459 | vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2460 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2461 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2462 | assert(my_data != NULL); |
| 2463 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2464 | skipCall |= parameter_validation_vkDestroyShaderModule(my_data->report_data, shaderModule, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2465 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2466 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2467 | get_dispatch_table(pc_device_table_map, device)->DestroyShaderModule(device, shaderModule, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2468 | } |
| 2469 | } |
| 2470 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2471 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, |
| 2472 | const VkAllocationCallbacks *pAllocator, |
| 2473 | VkPipelineCache *pPipelineCache) { |
| 2474 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2475 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2476 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2477 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2478 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2479 | skipCall |= parameter_validation_vkCreatePipelineCache(my_data->report_data, pCreateInfo, pAllocator, pPipelineCache); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2480 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2481 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2482 | result = |
| 2483 | get_dispatch_table(pc_device_table_map, device)->CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2484 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2485 | validate_result(my_data->report_data, "vkCreatePipelineCache", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2486 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2487 | |
| 2488 | return result; |
| 2489 | } |
| 2490 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2491 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2492 | vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2493 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2494 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2495 | assert(my_data != NULL); |
| 2496 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2497 | skipCall |= parameter_validation_vkDestroyPipelineCache(my_data->report_data, pipelineCache, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2498 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2499 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2500 | get_dispatch_table(pc_device_table_map, device)->DestroyPipelineCache(device, pipelineCache, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2501 | } |
| 2502 | } |
| 2503 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2504 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2505 | vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData) { |
| 2506 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2507 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2508 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2509 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2510 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2511 | skipCall |= parameter_validation_vkGetPipelineCacheData(my_data->report_data, pipelineCache, pDataSize, pData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2512 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2513 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2514 | result = get_dispatch_table(pc_device_table_map, device)->GetPipelineCacheData(device, pipelineCache, pDataSize, pData); |
| 2515 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2516 | validate_result(my_data->report_data, "vkGetPipelineCacheData", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2517 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2518 | |
| 2519 | return result; |
| 2520 | } |
| 2521 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2522 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2523 | vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches) { |
| 2524 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2525 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2526 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2527 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2528 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2529 | skipCall |= parameter_validation_vkMergePipelineCaches(my_data->report_data, dstCache, srcCacheCount, pSrcCaches); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2530 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2531 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2532 | result = get_dispatch_table(pc_device_table_map, device)->MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches); |
| 2533 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2534 | validate_result(my_data->report_data, "vkMergePipelineCaches", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2535 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2536 | |
| 2537 | return result; |
| 2538 | } |
| 2539 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2540 | bool PreCreateGraphicsPipelines(VkDevice device, const VkGraphicsPipelineCreateInfo *pCreateInfos) { |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 2541 | layer_data *data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2542 | |
| 2543 | // TODO: Handle count |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2544 | if (pCreateInfos != nullptr) { |
| 2545 | if (pCreateInfos->flags | VK_PIPELINE_CREATE_DERIVATIVE_BIT) { |
| 2546 | if (pCreateInfos->basePipelineIndex != -1) { |
| 2547 | if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 2548 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2549 | INVALID_USAGE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2550 | "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineHandle, must be VK_NULL_HANDLE if " |
| 2551 | "pCreateInfos->flags " |
| 2552 | "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineIndex is not -1"); |
| 2553 | return false; |
| 2554 | } |
| 2555 | } |
| 2556 | |
| 2557 | if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { |
| 2558 | if (pCreateInfos->basePipelineIndex != -1) { |
| 2559 | log_msg( |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 2560 | mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2561 | INVALID_USAGE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2562 | "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineIndex, must be -1 if pCreateInfos->flags " |
| 2563 | "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineHandle is not " |
| 2564 | "VK_NULL_HANDLE"); |
| 2565 | return false; |
| 2566 | } |
Jeremy Hayes | 2fdaaf2 | 2016-03-01 17:51:54 -0700 | [diff] [blame] | 2567 | } |
| 2568 | } |
| 2569 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2570 | if (pCreateInfos->pRasterizationState != nullptr) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2571 | if (pCreateInfos->pRasterizationState->cullMode & ~VK_CULL_MODE_FRONT_AND_BACK) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 2572 | log_msg(mdd(device), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2573 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2574 | "vkCreateGraphicsPipelines parameter, VkCullMode pCreateInfos->pRasterizationState->cullMode, is an " |
| 2575 | "unrecognized enumerator"); |
| 2576 | return false; |
| 2577 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2578 | } |
Jeremy Hayes | 2fdaaf2 | 2016-03-01 17:51:54 -0700 | [diff] [blame] | 2579 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2580 | int i = 0; |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2581 | for (size_t j = 0; j < pCreateInfos[i].stageCount; j++) { |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 2582 | validate_string(data->report_data, "vkCreateGraphicsPipelines", "pCreateInfos[i].pStages[j].pName", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2583 | pCreateInfos[i].pStages[j].pName); |
| 2584 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2585 | } |
| 2586 | |
| 2587 | return true; |
| 2588 | } |
| 2589 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2590 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2591 | vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 2592 | const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, |
| 2593 | VkPipeline *pPipelines) { |
| 2594 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2595 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2596 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2597 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2598 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2599 | skipCall |= parameter_validation_vkCreateGraphicsPipelines(my_data->report_data, pipelineCache, createInfoCount, pCreateInfos, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2600 | pAllocator, pPipelines); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2601 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2602 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2603 | PreCreateGraphicsPipelines(device, pCreateInfos); |
| 2604 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2605 | result = get_dispatch_table(pc_device_table_map, device) |
| 2606 | ->CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2607 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2608 | validate_result(my_data->report_data, "vkCreateGraphicsPipelines", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2609 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2610 | |
| 2611 | return result; |
| 2612 | } |
| 2613 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2614 | bool PreCreateComputePipelines(VkDevice device, const VkComputePipelineCreateInfo *pCreateInfos) { |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 2615 | layer_data *data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2616 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2617 | if (pCreateInfos != nullptr) { |
| 2618 | // TODO: Handle count! |
| 2619 | int i = 0; |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 2620 | validate_string(data->report_data, "vkCreateComputePipelines", "pCreateInfos[i].stage.pName", pCreateInfos[i].stage.pName); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2621 | } |
| 2622 | |
| 2623 | return true; |
| 2624 | } |
| 2625 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2626 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2627 | vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 2628 | const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, |
| 2629 | VkPipeline *pPipelines) { |
| 2630 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2631 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2632 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2633 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2634 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2635 | skipCall |= parameter_validation_vkCreateComputePipelines(my_data->report_data, pipelineCache, createInfoCount, pCreateInfos, pAllocator, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2636 | pPipelines); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2637 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2638 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2639 | PreCreateComputePipelines(device, pCreateInfos); |
| 2640 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2641 | result = get_dispatch_table(pc_device_table_map, device) |
| 2642 | ->CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2643 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2644 | validate_result(my_data->report_data, "vkCreateComputePipelines", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2645 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2646 | |
| 2647 | return result; |
| 2648 | } |
| 2649 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2650 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2651 | vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2652 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2653 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2654 | assert(my_data != NULL); |
| 2655 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2656 | skipCall |= parameter_validation_vkDestroyPipeline(my_data->report_data, pipeline, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2657 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2658 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2659 | get_dispatch_table(pc_device_table_map, device)->DestroyPipeline(device, pipeline, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2660 | } |
| 2661 | } |
| 2662 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2663 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2664 | vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
| 2665 | VkPipelineLayout *pPipelineLayout) { |
| 2666 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2667 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2668 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2669 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2670 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2671 | skipCall |= parameter_validation_vkCreatePipelineLayout(my_data->report_data, pCreateInfo, pAllocator, pPipelineLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2672 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2673 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2674 | result = |
| 2675 | get_dispatch_table(pc_device_table_map, device)->CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2676 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2677 | validate_result(my_data->report_data, "vkCreatePipelineLayout", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2678 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2679 | |
| 2680 | return result; |
| 2681 | } |
| 2682 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2683 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2684 | vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2685 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2686 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2687 | assert(my_data != NULL); |
| 2688 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2689 | skipCall |= parameter_validation_vkDestroyPipelineLayout(my_data->report_data, pipelineLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2690 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2691 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2692 | get_dispatch_table(pc_device_table_map, device)->DestroyPipelineLayout(device, pipelineLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2693 | } |
| 2694 | } |
| 2695 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2696 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, |
| 2697 | const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) { |
| 2698 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2699 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2700 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2701 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2702 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2703 | skipCall |= parameter_validation_vkCreateSampler(my_data->report_data, pCreateInfo, pAllocator, pSampler); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2704 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2705 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2706 | result = get_dispatch_table(pc_device_table_map, device)->CreateSampler(device, pCreateInfo, pAllocator, pSampler); |
| 2707 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2708 | validate_result(my_data->report_data, "vkCreateSampler", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2709 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2710 | |
| 2711 | return result; |
| 2712 | } |
| 2713 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2714 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2715 | vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2716 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2717 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2718 | assert(my_data != NULL); |
| 2719 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2720 | skipCall |= parameter_validation_vkDestroySampler(my_data->report_data, sampler, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2721 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2722 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2723 | get_dispatch_table(pc_device_table_map, device)->DestroySampler(device, sampler, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2724 | } |
| 2725 | } |
| 2726 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2727 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2728 | vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, |
| 2729 | const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout) { |
| 2730 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2731 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2732 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2733 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2734 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2735 | skipCall |= parameter_validation_vkCreateDescriptorSetLayout(my_data->report_data, pCreateInfo, pAllocator, pSetLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2736 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2737 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2738 | result = |
| 2739 | get_dispatch_table(pc_device_table_map, device)->CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2740 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2741 | validate_result(my_data->report_data, "vkCreateDescriptorSetLayout", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2742 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2743 | |
| 2744 | return result; |
| 2745 | } |
| 2746 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2747 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2748 | vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2749 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2750 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2751 | assert(my_data != NULL); |
| 2752 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2753 | skipCall |= parameter_validation_vkDestroyDescriptorSetLayout(my_data->report_data, descriptorSetLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2754 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2755 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2756 | get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2757 | } |
| 2758 | } |
| 2759 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2760 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2761 | vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
| 2762 | VkDescriptorPool *pDescriptorPool) { |
| 2763 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2764 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2765 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2766 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2767 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2768 | skipCall |= parameter_validation_vkCreateDescriptorPool(my_data->report_data, pCreateInfo, pAllocator, pDescriptorPool); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2769 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2770 | /* TODOVV: How do we validate maxSets? Probably belongs in the limits layer? */ |
| 2771 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2772 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2773 | result = |
| 2774 | get_dispatch_table(pc_device_table_map, device)->CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2775 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2776 | validate_result(my_data->report_data, "vkCreateDescriptorPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2777 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2778 | |
| 2779 | return result; |
| 2780 | } |
| 2781 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2782 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2783 | vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2784 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2785 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2786 | assert(my_data != NULL); |
| 2787 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2788 | skipCall |= parameter_validation_vkDestroyDescriptorPool(my_data->report_data, descriptorPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2789 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2790 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2791 | get_dispatch_table(pc_device_table_map, device)->DestroyDescriptorPool(device, descriptorPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2792 | } |
| 2793 | } |
| 2794 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2795 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2796 | vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2797 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 2798 | bool skipCall = false; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2799 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2800 | assert(my_data != NULL); |
| 2801 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2802 | skipCall |= parameter_validation_vkResetDescriptorPool(my_data->report_data, descriptorPool, flags); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2803 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2804 | if (!skipCall) { |
| 2805 | result = get_dispatch_table(pc_device_table_map, device)->ResetDescriptorPool(device, descriptorPool, flags); |
| 2806 | |
| 2807 | validate_result(my_data->report_data, "vkResetDescriptorPool", result); |
| 2808 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2809 | |
| 2810 | return result; |
| 2811 | } |
| 2812 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2813 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2814 | vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets) { |
| 2815 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2816 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2817 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2818 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2819 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2820 | skipCall |= parameter_validation_vkAllocateDescriptorSets(my_data->report_data, pAllocateInfo, pDescriptorSets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2821 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2822 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2823 | result = get_dispatch_table(pc_device_table_map, device)->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); |
| 2824 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2825 | validate_result(my_data->report_data, "vkAllocateDescriptorSets", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2826 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2827 | |
| 2828 | return result; |
| 2829 | } |
| 2830 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2831 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, |
| 2832 | uint32_t descriptorSetCount, |
| 2833 | const VkDescriptorSet *pDescriptorSets) { |
| 2834 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2835 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2836 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2837 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2838 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2839 | skipCall |= parameter_validation_vkFreeDescriptorSets(my_data->report_data, descriptorPool, descriptorSetCount, pDescriptorSets); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2840 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2841 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2842 | result = get_dispatch_table(pc_device_table_map, device) |
| 2843 | ->FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2844 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2845 | validate_result(my_data->report_data, "vkFreeDescriptorSets", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2846 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2847 | |
| 2848 | return result; |
| 2849 | } |
| 2850 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2851 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2852 | vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, |
| 2853 | uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2854 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2855 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2856 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2857 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2858 | skipCall |= parameter_validation_vkUpdateDescriptorSets(my_data->report_data, descriptorWriteCount, pDescriptorWrites, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2859 | descriptorCopyCount, pDescriptorCopies); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2860 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2861 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2862 | get_dispatch_table(pc_device_table_map, device) |
| 2863 | ->UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2864 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2865 | } |
| 2866 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2867 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, |
| 2868 | const VkAllocationCallbacks *pAllocator, |
| 2869 | VkFramebuffer *pFramebuffer) { |
| 2870 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2871 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2872 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2873 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2874 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2875 | skipCall |= parameter_validation_vkCreateFramebuffer(my_data->report_data, pCreateInfo, pAllocator, pFramebuffer); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2876 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2877 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2878 | result = get_dispatch_table(pc_device_table_map, device)->CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer); |
| 2879 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2880 | validate_result(my_data->report_data, "vkCreateFramebuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2881 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2882 | |
| 2883 | return result; |
| 2884 | } |
| 2885 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2886 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2887 | vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2888 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2889 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2890 | assert(my_data != NULL); |
| 2891 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2892 | skipCall |= parameter_validation_vkDestroyFramebuffer(my_data->report_data, framebuffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2893 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2894 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2895 | get_dispatch_table(pc_device_table_map, device)->DestroyFramebuffer(device, framebuffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2896 | } |
| 2897 | } |
| 2898 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2899 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, |
| 2900 | const VkAllocationCallbacks *pAllocator, |
| 2901 | VkRenderPass *pRenderPass) { |
| 2902 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2903 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2904 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2905 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2906 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2907 | skipCall |= parameter_validation_vkCreateRenderPass(my_data->report_data, pCreateInfo, pAllocator, pRenderPass); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2908 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2909 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2910 | result = get_dispatch_table(pc_device_table_map, device)->CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); |
| 2911 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2912 | validate_result(my_data->report_data, "vkCreateRenderPass", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2913 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2914 | |
| 2915 | return result; |
| 2916 | } |
| 2917 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2918 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2919 | vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2920 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2921 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2922 | assert(my_data != NULL); |
| 2923 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2924 | skipCall |= parameter_validation_vkDestroyRenderPass(my_data->report_data, renderPass, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2925 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2926 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2927 | get_dispatch_table(pc_device_table_map, device)->DestroyRenderPass(device, renderPass, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2928 | } |
| 2929 | } |
| 2930 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2931 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 2932 | vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2933 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2934 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2935 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2936 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2937 | skipCall |= parameter_validation_vkGetRenderAreaGranularity(my_data->report_data, renderPass, pGranularity); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2938 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2939 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2940 | get_dispatch_table(pc_device_table_map, device)->GetRenderAreaGranularity(device, renderPass, pGranularity); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2941 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2942 | } |
| 2943 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2944 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, |
| 2945 | const VkAllocationCallbacks *pAllocator, |
| 2946 | VkCommandPool *pCommandPool) { |
| 2947 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 2948 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2949 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2950 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2951 | |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 2952 | skipCall |= validate_queue_family_indices(device, "vkCreateCommandPool", 1, &(pCreateInfo->queueFamilyIndex)); |
| 2953 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2954 | skipCall |= parameter_validation_vkCreateCommandPool(my_data->report_data, pCreateInfo, pAllocator, pCommandPool); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2955 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2956 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2957 | result = get_dispatch_table(pc_device_table_map, device)->CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); |
| 2958 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2959 | validate_result(my_data->report_data, "vkCreateCommandPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2960 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2961 | |
| 2962 | return result; |
| 2963 | } |
| 2964 | |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2965 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2966 | vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2967 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2968 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2969 | assert(my_data != NULL); |
| 2970 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 2971 | skipCall |= parameter_validation_vkDestroyCommandPool(my_data->report_data, commandPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2972 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2973 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2974 | get_dispatch_table(pc_device_table_map, device)->DestroyCommandPool(device, commandPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2975 | } |
| 2976 | } |
| 2977 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2978 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2979 | vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2980 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 2981 | bool skipCall = false; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2982 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 2983 | assert(my_data != NULL); |
| 2984 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2985 | skipCall |= parameter_validation_vkResetCommandPool(my_data->report_data, commandPool, flags); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2986 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2987 | if (!skipCall) { |
| 2988 | result = get_dispatch_table(pc_device_table_map, device)->ResetCommandPool(device, commandPool, flags); |
| 2989 | |
| 2990 | validate_result(my_data->report_data, "vkResetCommandPool", result); |
| 2991 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2992 | |
| 2993 | return result; |
| 2994 | } |
| 2995 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2996 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 2997 | vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers) { |
| 2998 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 2999 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3000 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3001 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3002 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3003 | skipCall |= parameter_validation_vkAllocateCommandBuffers(my_data->report_data, pAllocateInfo, pCommandBuffers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3004 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3005 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3006 | result = get_dispatch_table(pc_device_table_map, device)->AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers); |
| 3007 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3008 | validate_result(my_data->report_data, "vkAllocateCommandBuffers", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3009 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3010 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3011 | return result; |
| 3012 | } |
| 3013 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3014 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, |
| 3015 | uint32_t commandBufferCount, |
| 3016 | const VkCommandBuffer *pCommandBuffers) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3017 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3018 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3019 | assert(my_data != NULL); |
| 3020 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3021 | skipCall |= parameter_validation_vkFreeCommandBuffers(my_data->report_data, commandPool, commandBufferCount, pCommandBuffers); |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3022 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3023 | if (!skipCall) { |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3024 | get_dispatch_table(pc_device_table_map, device) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3025 | ->FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3026 | } |
| 3027 | } |
| 3028 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3029 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 3030 | vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) { |
| 3031 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3032 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3033 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3034 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3035 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3036 | skipCall |= parameter_validation_vkBeginCommandBuffer(my_data->report_data, pBeginInfo); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3037 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3038 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3039 | result = get_dispatch_table(pc_device_table_map, commandBuffer)->BeginCommandBuffer(commandBuffer, pBeginInfo); |
| 3040 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3041 | validate_result(my_data->report_data, "vkBeginCommandBuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3042 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3043 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3044 | return result; |
| 3045 | } |
| 3046 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3047 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer) { |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3048 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3049 | assert(my_data != NULL); |
| 3050 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3051 | VkResult result = get_dispatch_table(pc_device_table_map, commandBuffer)->EndCommandBuffer(commandBuffer); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3052 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3053 | validate_result(my_data->report_data, "vkEndCommandBuffer", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3054 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3055 | return result; |
| 3056 | } |
| 3057 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3058 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL |
| 3059 | vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) { |
Dustin Graves | 16d1897 | 2016-05-09 17:36:57 -0600 | [diff] [blame] | 3060 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3061 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3062 | assert(my_data != NULL); |
| 3063 | |
Dustin Graves | 16d1897 | 2016-05-09 17:36:57 -0600 | [diff] [blame] | 3064 | bool skip_call = parameter_validation_vkResetCommandBuffer(my_data->report_data, flags); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3065 | |
Dustin Graves | 16d1897 | 2016-05-09 17:36:57 -0600 | [diff] [blame] | 3066 | if (!skip_call) { |
| 3067 | result = get_dispatch_table(pc_device_table_map, commandBuffer)->ResetCommandBuffer(commandBuffer, flags); |
| 3068 | |
| 3069 | validate_result(my_data->report_data, "vkResetCommandBuffer", result); |
| 3070 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3071 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3072 | return result; |
| 3073 | } |
| 3074 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3075 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3076 | vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3077 | bool skipCall = false; |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3078 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3079 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3080 | |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3081 | skipCall |= parameter_validation_vkCmdBindPipeline(my_data->report_data, pipelineBindPoint, pipeline); |
| 3082 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3083 | if (!skipCall) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3084 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); |
| 3085 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3086 | } |
| 3087 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3088 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3089 | vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3090 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3091 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3092 | assert(my_data != NULL); |
| 3093 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3094 | skipCall |= parameter_validation_vkCmdSetViewport(my_data->report_data, firstViewport, viewportCount, pViewports); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3095 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3096 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3097 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3098 | ->CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3099 | } |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 3100 | } |
| 3101 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3102 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3103 | vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3104 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3105 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3106 | assert(my_data != NULL); |
| 3107 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3108 | skipCall |= parameter_validation_vkCmdSetScissor(my_data->report_data, firstScissor, scissorCount, pScissors); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3109 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3110 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3111 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors); |
| 3112 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3113 | } |
| 3114 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3115 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3116 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetLineWidth(commandBuffer, lineWidth); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3117 | } |
| 3118 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3119 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3120 | vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) { |
| 3121 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3122 | ->CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3123 | } |
| 3124 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3125 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3126 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3127 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3128 | assert(my_data != NULL); |
| 3129 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3130 | skipCall |= parameter_validation_vkCmdSetBlendConstants(my_data->report_data, blendConstants); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3131 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3132 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3133 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetBlendConstants(commandBuffer, blendConstants); |
| 3134 | } |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 3135 | } |
| 3136 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3137 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3138 | vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3139 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 3140 | } |
| 3141 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3142 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3143 | vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) { |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 3144 | bool skipCall = false; |
| 3145 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3146 | assert(my_data != NULL); |
| 3147 | |
| 3148 | skipCall |= parameter_validation_vkCmdSetStencilCompareMask(my_data->report_data, faceMask, compareMask); |
| 3149 | |
| 3150 | if (!skipCall) { |
| 3151 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask); |
| 3152 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3153 | } |
| 3154 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3155 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3156 | vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) { |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 3157 | bool skipCall = false; |
| 3158 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3159 | assert(my_data != NULL); |
| 3160 | |
| 3161 | skipCall |= parameter_validation_vkCmdSetStencilWriteMask(my_data->report_data, faceMask, writeMask); |
| 3162 | |
| 3163 | if (!skipCall) { |
| 3164 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask); |
| 3165 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3166 | } |
| 3167 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3168 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3169 | vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) { |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 3170 | bool skipCall = false; |
| 3171 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3172 | assert(my_data != NULL); |
| 3173 | |
| 3174 | skipCall |= parameter_validation_vkCmdSetStencilReference(my_data->report_data, faceMask, reference); |
| 3175 | |
| 3176 | if (!skipCall) { |
| 3177 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetStencilReference(commandBuffer, faceMask, reference); |
| 3178 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3179 | } |
| 3180 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3181 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3182 | vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, |
| 3183 | uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, |
| 3184 | uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3185 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3186 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3187 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3188 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3189 | skipCall |= parameter_validation_vkCmdBindDescriptorSets(my_data->report_data, pipelineBindPoint, layout, firstSet, descriptorSetCount, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3190 | pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3191 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3192 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3193 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3194 | ->CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, |
| 3195 | dynamicOffsetCount, pDynamicOffsets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3196 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3197 | } |
| 3198 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3199 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3200 | vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3201 | bool skipCall = false; |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3202 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3203 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3204 | |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3205 | skipCall |= parameter_validation_vkCmdBindIndexBuffer(my_data->report_data, buffer, offset, indexType); |
| 3206 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3207 | if (!skipCall) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3208 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType); |
| 3209 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3210 | } |
| 3211 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3212 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, |
| 3213 | uint32_t bindingCount, const VkBuffer *pBuffers, |
| 3214 | const VkDeviceSize *pOffsets) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3215 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3216 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3217 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3218 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3219 | skipCall |= parameter_validation_vkCmdBindVertexBuffers(my_data->report_data, firstBinding, bindingCount, pBuffers, pOffsets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3220 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3221 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3222 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3223 | ->CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3224 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3225 | } |
| 3226 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3227 | bool PreCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, |
| 3228 | uint32_t firstInstance) { |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 3229 | if (vertexCount == 0) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3230 | // TODO: Verify against Valid Usage section. I don't see a non-zero vertexCount listed, may need to add that and make |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 3231 | // this an error or leave as is. |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3232 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3233 | REQUIRED_PARAMETER, "PARAMCHECK", "vkCmdDraw parameter, uint32_t vertexCount, is 0"); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 3234 | return false; |
| 3235 | } |
| 3236 | |
| 3237 | if (instanceCount == 0) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3238 | // TODO: Verify against Valid Usage section. I don't see a non-zero instanceCount listed, may need to add that and make |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 3239 | // this an error or leave as is. |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3240 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3241 | REQUIRED_PARAMETER, "PARAMCHECK", "vkCmdDraw parameter, uint32_t instanceCount, is 0"); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 3242 | return false; |
| 3243 | } |
| 3244 | |
| 3245 | return true; |
| 3246 | } |
| 3247 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3248 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, |
| 3249 | uint32_t firstVertex, uint32_t firstInstance) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3250 | PreCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 3251 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3252 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3253 | ->CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3254 | } |
| 3255 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3256 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, |
| 3257 | uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, |
| 3258 | uint32_t firstInstance) { |
| 3259 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3260 | ->CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3261 | } |
| 3262 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3263 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3264 | vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3265 | bool skipCall = false; |
| 3266 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3267 | assert(my_data != NULL); |
| 3268 | |
| 3269 | skipCall |= parameter_validation_vkCmdDrawIndirect(my_data->report_data, buffer, offset, count, stride); |
| 3270 | |
| 3271 | if (!skipCall) { |
| 3272 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDrawIndirect(commandBuffer, buffer, offset, count, stride); |
| 3273 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3274 | } |
| 3275 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3276 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3277 | vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3278 | bool skipCall = false; |
| 3279 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3280 | assert(my_data != NULL); |
| 3281 | |
| 3282 | skipCall |= parameter_validation_vkCmdDrawIndexedIndirect(my_data->report_data, buffer, offset, count, stride); |
| 3283 | |
| 3284 | if (!skipCall) { |
| 3285 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3286 | ->CmdDrawIndexedIndirect(commandBuffer, buffer, offset, count, stride); |
| 3287 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3288 | } |
| 3289 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3290 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3291 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDispatch(commandBuffer, x, y, z); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3292 | } |
| 3293 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3294 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3295 | vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3296 | bool skipCall = false; |
| 3297 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3298 | assert(my_data != NULL); |
| 3299 | |
| 3300 | skipCall |= parameter_validation_vkCmdDispatchIndirect(my_data->report_data, buffer, offset); |
| 3301 | |
| 3302 | if (!skipCall) { |
| 3303 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdDispatchIndirect(commandBuffer, buffer, offset); |
| 3304 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3305 | } |
| 3306 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3307 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, |
| 3308 | uint32_t regionCount, const VkBufferCopy *pRegions) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3309 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3310 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3311 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3312 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3313 | skipCall |= parameter_validation_vkCmdCopyBuffer(my_data->report_data, srcBuffer, dstBuffer, regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3314 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3315 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3316 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3317 | ->CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3318 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3319 | } |
| 3320 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3321 | bool PreCmdCopyImage(VkCommandBuffer commandBuffer, const VkImageCopy *pRegions) { |
| 3322 | if (pRegions != nullptr) { |
| 3323 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3324 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3325 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3326 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3327 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
| 3328 | return false; |
| 3329 | } |
| 3330 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3331 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3332 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3333 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3334 | "vkCmdCopyImage parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
| 3335 | return false; |
| 3336 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3337 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3338 | |
| 3339 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3340 | } |
| 3341 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3342 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3343 | vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 3344 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3345 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3346 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3347 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3348 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3349 | skipCall |= |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3350 | parameter_validation_vkCmdCopyImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3351 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3352 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3353 | PreCmdCopyImage(commandBuffer, pRegions); |
| 3354 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3355 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3356 | ->CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3357 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3358 | } |
| 3359 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3360 | bool PreCmdBlitImage(VkCommandBuffer commandBuffer, const VkImageBlit *pRegions) { |
| 3361 | if (pRegions != nullptr) { |
| 3362 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3363 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3364 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3365 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3366 | "vkCmdCopyImage parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
| 3367 | return false; |
| 3368 | } |
| 3369 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3370 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3371 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3372 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3373 | "vkCmdCopyImage parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
| 3374 | return false; |
| 3375 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3376 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3377 | |
| 3378 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3379 | } |
| 3380 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3381 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3382 | vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 3383 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3384 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3385 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3386 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3387 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3388 | skipCall |= parameter_validation_vkCmdBlitImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3389 | pRegions, filter); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3390 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3391 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3392 | PreCmdBlitImage(commandBuffer, pRegions); |
| 3393 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3394 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3395 | ->CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3396 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3397 | } |
| 3398 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3399 | bool PreCmdCopyBufferToImage(VkCommandBuffer commandBuffer, const VkBufferImageCopy *pRegions) { |
| 3400 | if (pRegions != nullptr) { |
| 3401 | if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3402 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3403 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3404 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3405 | "vkCmdCopyBufferToImage parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " |
| 3406 | "enumerator"); |
| 3407 | return false; |
| 3408 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3409 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3410 | |
| 3411 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3412 | } |
| 3413 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3414 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, |
| 3415 | VkImage dstImage, VkImageLayout dstImageLayout, |
| 3416 | uint32_t regionCount, const VkBufferImageCopy *pRegions) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3417 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3418 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3419 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3420 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3421 | skipCall |= |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3422 | parameter_validation_vkCmdCopyBufferToImage(my_data->report_data, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3423 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3424 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3425 | PreCmdCopyBufferToImage(commandBuffer, pRegions); |
| 3426 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3427 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3428 | ->CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3429 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3430 | } |
| 3431 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3432 | bool PreCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, const VkBufferImageCopy *pRegions) { |
| 3433 | if (pRegions != nullptr) { |
| 3434 | if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3435 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3436 | log_msg(mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3437 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3438 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " |
| 3439 | "enumerator"); |
| 3440 | return false; |
| 3441 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3442 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3443 | |
| 3444 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3445 | } |
| 3446 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3447 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, |
| 3448 | VkImageLayout srcImageLayout, VkBuffer dstBuffer, |
| 3449 | uint32_t regionCount, const VkBufferImageCopy *pRegions) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3450 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3451 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3452 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3453 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3454 | skipCall |= |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3455 | parameter_validation_vkCmdCopyImageToBuffer(my_data->report_data, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3456 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3457 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3458 | PreCmdCopyImageToBuffer(commandBuffer, pRegions); |
| 3459 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3460 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3461 | ->CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3462 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3463 | } |
| 3464 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3465 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, |
| 3466 | VkDeviceSize dstOffset, VkDeviceSize dataSize, const uint32_t *pData) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3467 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3468 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3469 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3470 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3471 | skipCall |= parameter_validation_vkCmdUpdateBuffer(my_data->report_data, dstBuffer, dstOffset, dataSize, pData); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3472 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3473 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3474 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3475 | ->CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3476 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3477 | } |
| 3478 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3479 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3480 | vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3481 | bool skipCall = false; |
| 3482 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3483 | assert(my_data != NULL); |
| 3484 | |
| 3485 | skipCall |= parameter_validation_vkCmdFillBuffer(my_data->report_data, dstBuffer, dstOffset, size, data); |
| 3486 | |
| 3487 | if (!skipCall) { |
| 3488 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); |
| 3489 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3490 | } |
| 3491 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3492 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, |
| 3493 | VkImageLayout imageLayout, const VkClearColorValue *pColor, |
| 3494 | uint32_t rangeCount, const VkImageSubresourceRange *pRanges) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3495 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3496 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3497 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3498 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3499 | skipCall |= parameter_validation_vkCmdClearColorImage(my_data->report_data, image, imageLayout, pColor, rangeCount, pRanges); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3500 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3501 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3502 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3503 | ->CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3504 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3505 | } |
| 3506 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3507 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3508 | vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 3509 | const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, |
| 3510 | const VkImageSubresourceRange *pRanges) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3511 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3512 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3513 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3514 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3515 | skipCall |= |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3516 | parameter_validation_vkCmdClearDepthStencilImage(my_data->report_data, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3517 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3518 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3519 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3520 | ->CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3521 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3522 | } |
| 3523 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3524 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, |
| 3525 | const VkClearAttachment *pAttachments, uint32_t rectCount, |
| 3526 | const VkClearRect *pRects) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3527 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3528 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3529 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3530 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3531 | skipCall |= parameter_validation_vkCmdClearAttachments(my_data->report_data, attachmentCount, pAttachments, rectCount, pRects); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3532 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3533 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3534 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3535 | ->CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3536 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3537 | } |
| 3538 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3539 | bool PreCmdResolveImage(VkCommandBuffer commandBuffer, const VkImageResolve *pRegions) { |
| 3540 | if (pRegions != nullptr) { |
| 3541 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3542 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3543 | log_msg( |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3544 | mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3545 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3546 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
| 3547 | return false; |
| 3548 | } |
| 3549 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 3550 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 3551 | log_msg( |
Dustin Graves | f233e50 | 2016-05-05 13:44:21 -0600 | [diff] [blame] | 3552 | mdd(commandBuffer), VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3553 | UNRECOGNIZED_VALUE, "PARAMCHECK", |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3554 | "vkCmdResolveImage parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
| 3555 | return false; |
| 3556 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3557 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3558 | |
| 3559 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3560 | } |
| 3561 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3562 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3563 | vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, |
| 3564 | VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3565 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3566 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3567 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3568 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3569 | skipCall |= parameter_validation_vkCmdResolveImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3570 | pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3571 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3572 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3573 | PreCmdResolveImage(commandBuffer, pRegions); |
| 3574 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3575 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3576 | ->CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3577 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3578 | } |
| 3579 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3580 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3581 | vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3582 | bool skipCall = false; |
| 3583 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3584 | assert(my_data != NULL); |
| 3585 | |
| 3586 | skipCall |= parameter_validation_vkCmdSetEvent(my_data->report_data, event, stageMask); |
| 3587 | |
| 3588 | if (!skipCall) { |
| 3589 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdSetEvent(commandBuffer, event, stageMask); |
| 3590 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3591 | } |
| 3592 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3593 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3594 | vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3595 | bool skipCall = false; |
| 3596 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3597 | assert(my_data != NULL); |
| 3598 | |
| 3599 | skipCall |= parameter_validation_vkCmdResetEvent(my_data->report_data, event, stageMask); |
| 3600 | |
| 3601 | if (!skipCall) { |
| 3602 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdResetEvent(commandBuffer, event, stageMask); |
| 3603 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3604 | } |
| 3605 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3606 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3607 | vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, |
| 3608 | VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 3609 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 3610 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3611 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3612 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3613 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3614 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3615 | skipCall |= parameter_validation_vkCmdWaitEvents(my_data->report_data, eventCount, pEvents, srcStageMask, dstStageMask, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3616 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, |
| 3617 | imageMemoryBarrierCount, pImageMemoryBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3618 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3619 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3620 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3621 | ->CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, |
| 3622 | bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3623 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3624 | } |
| 3625 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3626 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3627 | vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, |
| 3628 | VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 3629 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 3630 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3631 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3632 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3633 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3634 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3635 | skipCall |= parameter_validation_vkCmdPipelineBarrier(my_data->report_data, srcStageMask, dstStageMask, dependencyFlags, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3636 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, |
| 3637 | pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3638 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3639 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3640 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3641 | ->CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, |
| 3642 | bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3643 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3644 | } |
| 3645 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3646 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3647 | vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3648 | bool skipCall = false; |
| 3649 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3650 | assert(my_data != NULL); |
| 3651 | |
| 3652 | skipCall |= parameter_validation_vkCmdBeginQuery(my_data->report_data, queryPool, slot, flags); |
| 3653 | |
| 3654 | if (!skipCall) { |
| 3655 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBeginQuery(commandBuffer, queryPool, slot, flags); |
| 3656 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3657 | } |
| 3658 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3659 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3660 | bool skipCall = false; |
| 3661 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3662 | assert(my_data != NULL); |
| 3663 | |
| 3664 | skipCall |= parameter_validation_vkCmdEndQuery(my_data->report_data, queryPool, slot); |
| 3665 | |
| 3666 | if (!skipCall) { |
| 3667 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdEndQuery(commandBuffer, queryPool, slot); |
| 3668 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3669 | } |
| 3670 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3671 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3672 | vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3673 | bool skipCall = false; |
| 3674 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3675 | assert(my_data != NULL); |
| 3676 | |
| 3677 | skipCall |= parameter_validation_vkCmdResetQueryPool(my_data->report_data, queryPool, firstQuery, queryCount); |
| 3678 | |
| 3679 | if (!skipCall) { |
| 3680 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount); |
| 3681 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3682 | } |
| 3683 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3684 | bool PostCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, |
| 3685 | uint32_t slot) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3686 | |
Chia-I Wu | 51ce5ea | 2015-10-26 19:40:27 +0800 | [diff] [blame] | 3687 | ValidateEnumerator(pipelineStage); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3688 | |
| 3689 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3690 | } |
| 3691 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3692 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, |
| 3693 | VkQueryPool queryPool, uint32_t query) { |
| 3694 | bool skipCall = false; |
| 3695 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3696 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3697 | |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3698 | skipCall |= parameter_validation_vkCmdWriteTimestamp(my_data->report_data, pipelineStage, queryPool, query); |
| 3699 | |
| 3700 | if (!skipCall) { |
| 3701 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query); |
| 3702 | |
| 3703 | PostCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query); |
| 3704 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3705 | } |
| 3706 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3707 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3708 | vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, |
| 3709 | VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3710 | bool skipCall = false; |
| 3711 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3712 | assert(my_data != NULL); |
| 3713 | |
| 3714 | skipCall |= parameter_validation_vkCmdCopyQueryPoolResults(my_data->report_data, queryPool, firstQuery, queryCount, dstBuffer, |
| 3715 | dstOffset, stride, flags); |
| 3716 | |
| 3717 | if (!skipCall) { |
| 3718 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3719 | ->CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags); |
| 3720 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3721 | } |
| 3722 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3723 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, |
| 3724 | VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, |
| 3725 | const void *pValues) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3726 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3727 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3728 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3729 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3730 | skipCall |= parameter_validation_vkCmdPushConstants(my_data->report_data, layout, stageFlags, offset, size, pValues); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3731 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3732 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3733 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3734 | ->CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3735 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3736 | } |
| 3737 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3738 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3739 | vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3740 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3741 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3742 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3743 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3744 | skipCall |= parameter_validation_vkCmdBeginRenderPass(my_data->report_data, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3745 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3746 | if (!skipCall) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3747 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3748 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3749 | } |
| 3750 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3751 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3752 | bool skipCall = false; |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3753 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
| 3754 | assert(my_data != NULL); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 3755 | |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3756 | skipCall |= parameter_validation_vkCmdNextSubpass(my_data->report_data, contents); |
| 3757 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3758 | if (!skipCall) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3759 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdNextSubpass(commandBuffer, contents); |
| 3760 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3761 | } |
| 3762 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3763 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 3764 | get_dispatch_table(pc_device_table_map, commandBuffer)->CmdEndRenderPass(commandBuffer); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3765 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3766 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3767 | VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL |
| 3768 | vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) { |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3769 | bool skipCall = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3770 | layer_data *my_data = get_my_data_ptr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3771 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3772 | |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 3773 | skipCall |= parameter_validation_vkCmdExecuteCommands(my_data->report_data, commandBufferCount, pCommandBuffers); |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 3774 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3775 | if (!skipCall) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3776 | get_dispatch_table(pc_device_table_map, commandBuffer) |
| 3777 | ->CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3778 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 3779 | } |
| 3780 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3781 | VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *funcName) { |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 3782 | layer_data *data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); |
| 3783 | |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 3784 | if (validate_string(data->report_data, "vkGetDeviceProcAddr", "funcName", funcName)) { |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 3785 | return NULL; |
| 3786 | } |
| 3787 | |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 3788 | if (!strcmp(funcName, "vkGetDeviceProcAddr")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3789 | return (PFN_vkVoidFunction)vkGetDeviceProcAddr; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3790 | if (!strcmp(funcName, "vkDestroyDevice")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3791 | return (PFN_vkVoidFunction)vkDestroyDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3792 | if (!strcmp(funcName, "vkGetDeviceQueue")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3793 | return (PFN_vkVoidFunction)vkGetDeviceQueue; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3794 | if (!strcmp(funcName, "vkQueueSubmit")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3795 | return (PFN_vkVoidFunction)vkQueueSubmit; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3796 | if (!strcmp(funcName, "vkQueueWaitIdle")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3797 | return (PFN_vkVoidFunction)vkQueueWaitIdle; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3798 | if (!strcmp(funcName, "vkDeviceWaitIdle")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3799 | return (PFN_vkVoidFunction)vkDeviceWaitIdle; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 3800 | if (!strcmp(funcName, "vkAllocateMemory")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3801 | return (PFN_vkVoidFunction)vkAllocateMemory; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3802 | if (!strcmp(funcName, "vkFreeMemory")) |
| 3803 | return (PFN_vkVoidFunction)vkFreeMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3804 | if (!strcmp(funcName, "vkMapMemory")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3805 | return (PFN_vkVoidFunction)vkMapMemory; |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3806 | if (!strcmp(funcName, "vkUnmapMemory")) |
| 3807 | return (PFN_vkVoidFunction)vkUnmapMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3808 | if (!strcmp(funcName, "vkFlushMappedMemoryRanges")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3809 | return (PFN_vkVoidFunction)vkFlushMappedMemoryRanges; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3810 | if (!strcmp(funcName, "vkInvalidateMappedMemoryRanges")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3811 | return (PFN_vkVoidFunction)vkInvalidateMappedMemoryRanges; |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3812 | if (!strcmp(funcName, "vkGetDeviceMemoryCommitment")) |
| 3813 | return (PFN_vkVoidFunction)vkGetDeviceMemoryCommitment; |
| 3814 | if (!strcmp(funcName, "vkBindBufferMemory")) |
| 3815 | return (PFN_vkVoidFunction)vkBindBufferMemory; |
| 3816 | if (!strcmp(funcName, "vkBindImageMemory")) |
| 3817 | return (PFN_vkVoidFunction)vkBindImageMemory; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3818 | if (!strcmp(funcName, "vkCreateFence")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3819 | return (PFN_vkVoidFunction)vkCreateFence; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3820 | if (!strcmp(funcName, "vkDestroyFence")) |
| 3821 | return (PFN_vkVoidFunction)vkDestroyFence; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3822 | if (!strcmp(funcName, "vkResetFences")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3823 | return (PFN_vkVoidFunction)vkResetFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3824 | if (!strcmp(funcName, "vkGetFenceStatus")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3825 | return (PFN_vkVoidFunction)vkGetFenceStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3826 | if (!strcmp(funcName, "vkWaitForFences")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3827 | return (PFN_vkVoidFunction)vkWaitForFences; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3828 | if (!strcmp(funcName, "vkCreateSemaphore")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3829 | return (PFN_vkVoidFunction)vkCreateSemaphore; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3830 | if (!strcmp(funcName, "vkDestroySemaphore")) |
| 3831 | return (PFN_vkVoidFunction)vkDestroySemaphore; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3832 | if (!strcmp(funcName, "vkCreateEvent")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3833 | return (PFN_vkVoidFunction)vkCreateEvent; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3834 | if (!strcmp(funcName, "vkDestroyEvent")) |
| 3835 | return (PFN_vkVoidFunction)vkDestroyEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3836 | if (!strcmp(funcName, "vkGetEventStatus")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3837 | return (PFN_vkVoidFunction)vkGetEventStatus; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3838 | if (!strcmp(funcName, "vkSetEvent")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3839 | return (PFN_vkVoidFunction)vkSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3840 | if (!strcmp(funcName, "vkResetEvent")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3841 | return (PFN_vkVoidFunction)vkResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3842 | if (!strcmp(funcName, "vkCreateQueryPool")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3843 | return (PFN_vkVoidFunction)vkCreateQueryPool; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3844 | if (!strcmp(funcName, "vkDestroyQueryPool")) |
| 3845 | return (PFN_vkVoidFunction)vkDestroyQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3846 | if (!strcmp(funcName, "vkGetQueryPoolResults")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3847 | return (PFN_vkVoidFunction)vkGetQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3848 | if (!strcmp(funcName, "vkCreateBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3849 | return (PFN_vkVoidFunction)vkCreateBuffer; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3850 | if (!strcmp(funcName, "vkDestroyBuffer")) |
| 3851 | return (PFN_vkVoidFunction)vkDestroyBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3852 | if (!strcmp(funcName, "vkCreateBufferView")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3853 | return (PFN_vkVoidFunction)vkCreateBufferView; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3854 | if (!strcmp(funcName, "vkDestroyBufferView")) |
| 3855 | return (PFN_vkVoidFunction)vkDestroyBufferView; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3856 | if (!strcmp(funcName, "vkCreateImage")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3857 | return (PFN_vkVoidFunction)vkCreateImage; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3858 | if (!strcmp(funcName, "vkDestroyImage")) |
| 3859 | return (PFN_vkVoidFunction)vkDestroyImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3860 | if (!strcmp(funcName, "vkGetImageSubresourceLayout")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3861 | return (PFN_vkVoidFunction)vkGetImageSubresourceLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3862 | if (!strcmp(funcName, "vkCreateImageView")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3863 | return (PFN_vkVoidFunction)vkCreateImageView; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3864 | if (!strcmp(funcName, "vkDestroyImageView")) |
| 3865 | return (PFN_vkVoidFunction)vkDestroyImageView; |
Michael Lentine | 03d8e57 | 2015-09-15 14:59:14 -0500 | [diff] [blame] | 3866 | if (!strcmp(funcName, "vkCreateShaderModule")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3867 | return (PFN_vkVoidFunction)vkCreateShaderModule; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3868 | if (!strcmp(funcName, "vkDestroyShaderModule")) |
| 3869 | return (PFN_vkVoidFunction)vkDestroyShaderModule; |
| 3870 | if (!strcmp(funcName, "vkCreatePipelineCache")) |
| 3871 | return (PFN_vkVoidFunction)vkCreatePipelineCache; |
| 3872 | if (!strcmp(funcName, "vkDestroyPipelineCache")) |
| 3873 | return (PFN_vkVoidFunction)vkDestroyPipelineCache; |
| 3874 | if (!strcmp(funcName, "vkGetPipelineCacheData")) |
| 3875 | return (PFN_vkVoidFunction)vkGetPipelineCacheData; |
| 3876 | if (!strcmp(funcName, "vkMergePipelineCaches")) |
| 3877 | return (PFN_vkVoidFunction)vkMergePipelineCaches; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 3878 | if (!strcmp(funcName, "vkCreateGraphicsPipelines")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3879 | return (PFN_vkVoidFunction)vkCreateGraphicsPipelines; |
Jon Ashburn | c669cc6 | 2015-07-09 15:02:25 -0600 | [diff] [blame] | 3880 | if (!strcmp(funcName, "vkCreateComputePipelines")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3881 | return (PFN_vkVoidFunction)vkCreateComputePipelines; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3882 | if (!strcmp(funcName, "vkDestroyPipeline")) |
| 3883 | return (PFN_vkVoidFunction)vkDestroyPipeline; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3884 | if (!strcmp(funcName, "vkCreatePipelineLayout")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3885 | return (PFN_vkVoidFunction)vkCreatePipelineLayout; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3886 | if (!strcmp(funcName, "vkDestroyPipelineLayout")) |
| 3887 | return (PFN_vkVoidFunction)vkDestroyPipelineLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3888 | if (!strcmp(funcName, "vkCreateSampler")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3889 | return (PFN_vkVoidFunction)vkCreateSampler; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3890 | if (!strcmp(funcName, "vkDestroySampler")) |
| 3891 | return (PFN_vkVoidFunction)vkDestroySampler; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3892 | if (!strcmp(funcName, "vkCreateDescriptorSetLayout")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3893 | return (PFN_vkVoidFunction)vkCreateDescriptorSetLayout; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3894 | if (!strcmp(funcName, "vkDestroyDescriptorSetLayout")) |
| 3895 | return (PFN_vkVoidFunction)vkDestroyDescriptorSetLayout; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3896 | if (!strcmp(funcName, "vkCreateDescriptorPool")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3897 | return (PFN_vkVoidFunction)vkCreateDescriptorPool; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3898 | if (!strcmp(funcName, "vkDestroyDescriptorPool")) |
| 3899 | return (PFN_vkVoidFunction)vkDestroyDescriptorPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3900 | if (!strcmp(funcName, "vkResetDescriptorPool")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3901 | return (PFN_vkVoidFunction)vkResetDescriptorPool; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 3902 | if (!strcmp(funcName, "vkAllocateDescriptorSets")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3903 | return (PFN_vkVoidFunction)vkAllocateDescriptorSets; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3904 | if (!strcmp(funcName, "vkCmdSetViewport")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3905 | return (PFN_vkVoidFunction)vkCmdSetViewport; |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 3906 | if (!strcmp(funcName, "vkCmdSetScissor")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3907 | return (PFN_vkVoidFunction)vkCmdSetScissor; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3908 | if (!strcmp(funcName, "vkCmdSetLineWidth")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3909 | return (PFN_vkVoidFunction)vkCmdSetLineWidth; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3910 | if (!strcmp(funcName, "vkCmdSetDepthBias")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3911 | return (PFN_vkVoidFunction)vkCmdSetDepthBias; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3912 | if (!strcmp(funcName, "vkCmdSetBlendConstants")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3913 | return (PFN_vkVoidFunction)vkCmdSetBlendConstants; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3914 | if (!strcmp(funcName, "vkCmdSetDepthBounds")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3915 | return (PFN_vkVoidFunction)vkCmdSetDepthBounds; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3916 | if (!strcmp(funcName, "vkCmdSetStencilCompareMask")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3917 | return (PFN_vkVoidFunction)vkCmdSetStencilCompareMask; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3918 | if (!strcmp(funcName, "vkCmdSetStencilWriteMask")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3919 | return (PFN_vkVoidFunction)vkCmdSetStencilWriteMask; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 3920 | if (!strcmp(funcName, "vkCmdSetStencilReference")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3921 | return (PFN_vkVoidFunction)vkCmdSetStencilReference; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 3922 | if (!strcmp(funcName, "vkAllocateCommandBuffers")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3923 | return (PFN_vkVoidFunction)vkAllocateCommandBuffers; |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3924 | if (!strcmp(funcName, "vkFreeCommandBuffers")) |
| 3925 | return (PFN_vkVoidFunction)vkFreeCommandBuffers; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3926 | if (!strcmp(funcName, "vkBeginCommandBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3927 | return (PFN_vkVoidFunction)vkBeginCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3928 | if (!strcmp(funcName, "vkEndCommandBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3929 | return (PFN_vkVoidFunction)vkEndCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3930 | if (!strcmp(funcName, "vkResetCommandBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3931 | return (PFN_vkVoidFunction)vkResetCommandBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3932 | if (!strcmp(funcName, "vkCmdBindPipeline")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3933 | return (PFN_vkVoidFunction)vkCmdBindPipeline; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3934 | if (!strcmp(funcName, "vkCmdBindDescriptorSets")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3935 | return (PFN_vkVoidFunction)vkCmdBindDescriptorSets; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3936 | if (!strcmp(funcName, "vkCmdBindVertexBuffers")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3937 | return (PFN_vkVoidFunction)vkCmdBindVertexBuffers; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3938 | if (!strcmp(funcName, "vkCmdBindIndexBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3939 | return (PFN_vkVoidFunction)vkCmdBindIndexBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3940 | if (!strcmp(funcName, "vkCmdDraw")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3941 | return (PFN_vkVoidFunction)vkCmdDraw; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3942 | if (!strcmp(funcName, "vkCmdDrawIndexed")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3943 | return (PFN_vkVoidFunction)vkCmdDrawIndexed; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3944 | if (!strcmp(funcName, "vkCmdDrawIndirect")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3945 | return (PFN_vkVoidFunction)vkCmdDrawIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3946 | if (!strcmp(funcName, "vkCmdDrawIndexedIndirect")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3947 | return (PFN_vkVoidFunction)vkCmdDrawIndexedIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3948 | if (!strcmp(funcName, "vkCmdDispatch")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3949 | return (PFN_vkVoidFunction)vkCmdDispatch; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3950 | if (!strcmp(funcName, "vkCmdDispatchIndirect")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3951 | return (PFN_vkVoidFunction)vkCmdDispatchIndirect; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3952 | if (!strcmp(funcName, "vkCmdCopyBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3953 | return (PFN_vkVoidFunction)vkCmdCopyBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3954 | if (!strcmp(funcName, "vkCmdCopyImage")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3955 | return (PFN_vkVoidFunction)vkCmdCopyImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3956 | if (!strcmp(funcName, "vkCmdBlitImage")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3957 | return (PFN_vkVoidFunction)vkCmdBlitImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3958 | if (!strcmp(funcName, "vkCmdCopyBufferToImage")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3959 | return (PFN_vkVoidFunction)vkCmdCopyBufferToImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3960 | if (!strcmp(funcName, "vkCmdCopyImageToBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3961 | return (PFN_vkVoidFunction)vkCmdCopyImageToBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3962 | if (!strcmp(funcName, "vkCmdUpdateBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3963 | return (PFN_vkVoidFunction)vkCmdUpdateBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3964 | if (!strcmp(funcName, "vkCmdFillBuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3965 | return (PFN_vkVoidFunction)vkCmdFillBuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3966 | if (!strcmp(funcName, "vkCmdClearColorImage")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3967 | return (PFN_vkVoidFunction)vkCmdClearColorImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3968 | if (!strcmp(funcName, "vkCmdResolveImage")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3969 | return (PFN_vkVoidFunction)vkCmdResolveImage; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3970 | if (!strcmp(funcName, "vkCmdSetEvent")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3971 | return (PFN_vkVoidFunction)vkCmdSetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3972 | if (!strcmp(funcName, "vkCmdResetEvent")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3973 | return (PFN_vkVoidFunction)vkCmdResetEvent; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3974 | if (!strcmp(funcName, "vkCmdWaitEvents")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3975 | return (PFN_vkVoidFunction)vkCmdWaitEvents; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3976 | if (!strcmp(funcName, "vkCmdPipelineBarrier")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3977 | return (PFN_vkVoidFunction)vkCmdPipelineBarrier; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3978 | if (!strcmp(funcName, "vkCmdBeginQuery")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3979 | return (PFN_vkVoidFunction)vkCmdBeginQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3980 | if (!strcmp(funcName, "vkCmdEndQuery")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3981 | return (PFN_vkVoidFunction)vkCmdEndQuery; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3982 | if (!strcmp(funcName, "vkCmdResetQueryPool")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3983 | return (PFN_vkVoidFunction)vkCmdResetQueryPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3984 | if (!strcmp(funcName, "vkCmdWriteTimestamp")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3985 | return (PFN_vkVoidFunction)vkCmdWriteTimestamp; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3986 | if (!strcmp(funcName, "vkCmdCopyQueryPoolResults")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3987 | return (PFN_vkVoidFunction)vkCmdCopyQueryPoolResults; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3988 | if (!strcmp(funcName, "vkCreateFramebuffer")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3989 | return (PFN_vkVoidFunction)vkCreateFramebuffer; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3990 | if (!strcmp(funcName, "vkDestroyFramebuffer")) |
| 3991 | return (PFN_vkVoidFunction)vkDestroyFramebuffer; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3992 | if (!strcmp(funcName, "vkCreateRenderPass")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3993 | return (PFN_vkVoidFunction)vkCreateRenderPass; |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3994 | if (!strcmp(funcName, "vkDestroyRenderPass")) |
| 3995 | return (PFN_vkVoidFunction)vkDestroyRenderPass; |
| 3996 | if (!strcmp(funcName, "vkGetRenderAreaGranularity")) |
| 3997 | return (PFN_vkVoidFunction)vkGetRenderAreaGranularity; |
| 3998 | if (!strcmp(funcName, "vkCreateCommandPool")) |
| 3999 | return (PFN_vkVoidFunction)vkCreateCommandPool; |
| 4000 | if (!strcmp(funcName, "vkDestroyCommandPool")) |
| 4001 | return (PFN_vkVoidFunction)vkDestroyCommandPool; |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4002 | if (!strcmp(funcName, "vkResetCommandPool")) |
| 4003 | return (PFN_vkVoidFunction)vkResetCommandPool; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4004 | if (!strcmp(funcName, "vkCmdBeginRenderPass")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4005 | return (PFN_vkVoidFunction)vkCmdBeginRenderPass; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4006 | if (!strcmp(funcName, "vkCmdNextSubpass")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4007 | return (PFN_vkVoidFunction)vkCmdNextSubpass; |
Jon Ashburn | eab3449 | 2015-06-01 09:37:38 -0600 | [diff] [blame] | 4008 | |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 4009 | if (device == NULL) { |
| 4010 | return NULL; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4011 | } |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 4012 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4013 | if (get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr == NULL) |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 4014 | return NULL; |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4015 | return get_dispatch_table(pc_device_table_map, device)->GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4016 | } |
| 4017 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4018 | VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *funcName) { |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 4019 | if (!strcmp(funcName, "vkGetInstanceProcAddr")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4020 | return (PFN_vkVoidFunction)vkGetInstanceProcAddr; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4021 | if (!strcmp(funcName, "vkCreateInstance")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4022 | return (PFN_vkVoidFunction)vkCreateInstance; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4023 | if (!strcmp(funcName, "vkDestroyInstance")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4024 | return (PFN_vkVoidFunction)vkDestroyInstance; |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 4025 | if (!strcmp(funcName, "vkCreateDevice")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4026 | return (PFN_vkVoidFunction)vkCreateDevice; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4027 | if (!strcmp(funcName, "vkEnumeratePhysicalDevices")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4028 | return (PFN_vkVoidFunction)vkEnumeratePhysicalDevices; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4029 | if (!strcmp(funcName, "vkGetPhysicalDeviceProperties")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4030 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceProperties; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4031 | if (!strcmp(funcName, "vkGetPhysicalDeviceFeatures")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4032 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceFeatures; |
Courtney Goeltzenleuchter | 2caec86 | 2015-07-12 12:52:09 -0600 | [diff] [blame] | 4033 | if (!strcmp(funcName, "vkGetPhysicalDeviceFormatProperties")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4034 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceFormatProperties; |
Dustin Graves | 16d1897 | 2016-05-09 17:36:57 -0600 | [diff] [blame] | 4035 | if (!strcmp(funcName, "vkGetPhysicalDeviceImageFormatProperties")) |
| 4036 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceImageFormatProperties; |
| 4037 | if (!strcmp(funcName, "vkGetPhysicalDeviceSparseImageFormatProperties")) |
| 4038 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceSparseImageFormatProperties; |
| 4039 | if (!strcmp(funcName, "vkGetPhysicalDeviceQueueFamilyProperties")) |
| 4040 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceQueueFamilyProperties; |
| 4041 | if (!strcmp(funcName, "vkGetPhysicalDeviceMemoryProperties")) |
| 4042 | return (PFN_vkVoidFunction)vkGetPhysicalDeviceMemoryProperties; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 4043 | if (!strcmp(funcName, "vkEnumerateInstanceLayerProperties")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4044 | return (PFN_vkVoidFunction)vkEnumerateInstanceLayerProperties; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 4045 | if (!strcmp(funcName, "vkEnumerateInstanceExtensionProperties")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4046 | return (PFN_vkVoidFunction)vkEnumerateInstanceExtensionProperties; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 4047 | if (!strcmp(funcName, "vkEnumerateDeviceLayerProperties")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4048 | return (PFN_vkVoidFunction)vkEnumerateDeviceLayerProperties; |
Courtney Goeltzenleuchter | 35985f6 | 2015-09-14 17:22:16 -0600 | [diff] [blame] | 4049 | if (!strcmp(funcName, "vkEnumerateDeviceExtensionProperties")) |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4050 | return (PFN_vkVoidFunction)vkEnumerateDeviceExtensionProperties; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 4051 | |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 4052 | if (instance == NULL) { |
| 4053 | return NULL; |
| 4054 | } |
| 4055 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4056 | layer_data *data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 4057 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4058 | PFN_vkVoidFunction fptr = debug_report_get_instance_proc_addr(data->report_data, funcName); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4059 | if (fptr) |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 4060 | return fptr; |
| 4061 | |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4062 | if (get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr == NULL) |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 4063 | return NULL; |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4064 | return get_dispatch_table(pc_instance_table_map, instance)->GetInstanceProcAddr(instance, funcName); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 4065 | } |