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> |
Chris Forbes | b93e59e | 2016-11-24 14:52:24 +1300 | [diff] [blame] | 22 | * Author: Chris Forbes <chrisforbes@google.com> |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 23 | */ |
| 24 | |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 25 | #define NOMINMAX |
| 26 | |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 27 | #include <limits.h> |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 28 | #include <math.h> |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 29 | #include <stdio.h> |
| 30 | #include <stdlib.h> |
| 31 | #include <string.h> |
| 32 | |
| 33 | #include <iostream> |
| 34 | #include <string> |
| 35 | #include <sstream> |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 36 | #include <unordered_map> |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 37 | #include <unordered_set> |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 38 | #include <vector> |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 39 | |
Chris Forbes | f90cef9 | 2016-11-29 09:49:19 +1300 | [diff] [blame] | 40 | #include "vk_loader_platform.h" |
| 41 | #include "vulkan/vk_layer.h" |
| 42 | #include "vk_layer_config.h" |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 43 | #include "vk_dispatch_table_helper.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 44 | |
Tobin Ehlis | a0cb02e | 2015-07-03 10:15:26 -0600 | [diff] [blame] | 45 | #include "vk_layer_table.h" |
| 46 | #include "vk_layer_data.h" |
| 47 | #include "vk_layer_logging.h" |
Courtney Goeltzenleuchter | f13293f | 2015-07-07 11:02:42 -0600 | [diff] [blame] | 48 | #include "vk_layer_extension_utils.h" |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 49 | #include "vk_layer_utils.h" |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 50 | |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 51 | #include "parameter_name.h" |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 52 | #include "parameter_validation.h" |
Chris Forbes | 8976f74 | 2017-05-02 14:52:05 -0700 | [diff] [blame] | 53 | #include "device_extensions.h" |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 54 | |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 55 | namespace parameter_validation { |
Dustin Graves | b83fc2d | 2016-05-04 12:56:08 -0600 | [diff] [blame] | 56 | |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 57 | struct instance_layer_data { |
Chris Forbes | 7b57a39 | 2016-11-02 17:56:50 +1300 | [diff] [blame] | 58 | VkInstance instance = VK_NULL_HANDLE; |
Chia-I Wu | a570b7c | 2016-05-16 07:48:14 +0800 | [diff] [blame] | 59 | |
Chris Forbes | 7b57a39 | 2016-11-02 17:56:50 +1300 | [diff] [blame] | 60 | debug_report_data *report_data = nullptr; |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 61 | std::vector<VkDebugReportCallbackEXT> logging_callback; |
Cody Northrop | 55443ef | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 62 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 63 | // The following are for keeping track of the temporary callbacks that can |
| 64 | // be used in vkCreateInstance and vkDestroyInstance: |
Chris Forbes | 7b57a39 | 2016-11-02 17:56:50 +1300 | [diff] [blame] | 65 | uint32_t num_tmp_callbacks = 0; |
| 66 | VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos = nullptr; |
| 67 | VkDebugReportCallbackEXT *tmp_callbacks = nullptr; |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 68 | InstanceExtensions extensions = {}; |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 69 | |
| 70 | VkLayerInstanceDispatchTable dispatch_table = {}; |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 71 | }; |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 72 | |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 73 | struct layer_data { |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 74 | debug_report_data *report_data = nullptr; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 75 | // Map for queue family index to queue count |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 76 | std::unordered_map<uint32_t, uint32_t> queueFamilyIndexMap; |
Chris Forbes | 7b57a39 | 2016-11-02 17:56:50 +1300 | [diff] [blame] | 77 | VkPhysicalDeviceLimits device_limits = {}; |
| 78 | VkPhysicalDeviceFeatures physical_device_features = {}; |
| 79 | VkPhysicalDevice physical_device = VK_NULL_HANDLE; |
Chris Forbes | 8976f74 | 2017-05-02 14:52:05 -0700 | [diff] [blame] | 80 | DeviceExtensions enables; |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 81 | |
| 82 | VkLayerDispatchTable dispatch_table = {}; |
Cody Northrop | 55443ef | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 83 | }; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 84 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 85 | static uint32_t loader_layer_if_version = CURRENT_LOADER_LAYER_INTERFACE_VERSION; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 86 | static std::unordered_map<void *, layer_data *> layer_data_map; |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 87 | static std::unordered_map<void *, instance_layer_data *> instance_layer_data_map; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 88 | |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 89 | static void init_parameter_validation(instance_layer_data *my_data, const VkAllocationCallbacks *pAllocator) { |
Mark Lobodzinski | 739391a | 2016-03-17 15:08:18 -0600 | [diff] [blame] | 90 | 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] | 91 | } |
| 92 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 93 | VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT(VkInstance instance, |
| 94 | const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 95 | const VkAllocationCallbacks *pAllocator, |
| 96 | VkDebugReportCallbackEXT *pMsgCallback) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 97 | auto data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 98 | VkResult result = data->dispatch_table.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 99 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 100 | if (result == VK_SUCCESS) { |
Mark Lobodzinski | 97c4d51 | 2016-05-19 15:27:18 -0600 | [diff] [blame] | 101 | result = layer_create_msg_callback(data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | return result; |
| 105 | } |
| 106 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 107 | VKAPI_ATTR void VKAPI_CALL DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT msgCallback, |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 108 | const VkAllocationCallbacks *pAllocator) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 109 | auto data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 110 | data->dispatch_table.DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); |
| 111 | |
Courtney Goeltzenleuchter | 05854bf | 2015-11-30 12:13:14 -0700 | [diff] [blame] | 112 | layer_destroy_msg_callback(data->report_data, msgCallback, pAllocator); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 113 | } |
| 114 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 115 | VKAPI_ATTR void VKAPI_CALL DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, |
| 116 | VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, |
| 117 | int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 118 | auto data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 119 | data->dispatch_table.DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); |
Courtney Goeltzenleuchter | f0de724 | 2015-12-01 14:10:55 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 122 | 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] | 123 | |
Chia-I Wu | 3384db8 | 2016-05-16 07:30:58 +0800 | [diff] [blame] | 124 | static const VkLayerProperties global_layer = { |
Jon Ashburn | dc9111c | 2016-03-22 12:57:13 -0600 | [diff] [blame] | 125 | "VK_LAYER_LUNARG_parameter_validation", VK_LAYER_API_VERSION, 1, "LunarG Validation Layer", |
Chia-I Wu | 3384db8 | 2016-05-16 07:30:58 +0800 | [diff] [blame] | 126 | }; |
Courtney Goeltzenleuchter | 5285766 | 2015-12-01 14:08:28 -0700 | [diff] [blame] | 127 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 128 | static bool ValidateEnumerator(VkFormatFeatureFlagBits const &enumerator) { |
Courtney Goeltzenleuchter | f1ece60 | 2015-09-10 16:25:49 -0600 | [diff] [blame] | 129 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 130 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 131 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 132 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 133 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
| 134 | 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] | 135 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 136 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 137 | return false; |
| 138 | } |
| 139 | |
| 140 | return true; |
| 141 | } |
| 142 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 143 | static std::string EnumeratorString(VkFormatFeatureFlagBits const &enumerator) { |
| 144 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 145 | return "unrecognized enumerator"; |
| 146 | } |
| 147 | |
| 148 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 149 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 150 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 151 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 152 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 153 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 154 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 155 | if (enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 156 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 157 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 158 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 159 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 160 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 161 | if (enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 162 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 163 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 164 | if (enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 165 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 166 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 167 | if (enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 168 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 169 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 170 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 171 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 172 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 173 | if (enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 174 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 175 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 176 | if (enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 177 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 178 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 179 | if (enumerator & VK_FORMAT_FEATURE_BLIT_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 180 | strings.push_back("VK_FORMAT_FEATURE_BLIT_SRC_BIT"); |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 181 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 182 | if (enumerator & VK_FORMAT_FEATURE_BLIT_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 183 | strings.push_back("VK_FORMAT_FEATURE_BLIT_DST_BIT"); |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 184 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 185 | if (enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) { |
Jon Ashburn | 766866a | 2016-01-22 15:39:20 -0700 | [diff] [blame] | 186 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT"); |
| 187 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 188 | |
| 189 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 190 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 191 | enumeratorString += string; |
| 192 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 193 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 194 | enumeratorString += '|'; |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | return enumeratorString; |
| 199 | } |
| 200 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 201 | static bool ValidateEnumerator(VkImageUsageFlagBits const &enumerator) { |
| 202 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)( |
| 203 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 204 | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | |
| 205 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT); |
| 206 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 207 | return false; |
| 208 | } |
| 209 | |
| 210 | return true; |
| 211 | } |
| 212 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 213 | static std::string EnumeratorString(VkImageUsageFlagBits const &enumerator) { |
| 214 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 215 | return "unrecognized enumerator"; |
| 216 | } |
| 217 | |
| 218 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 219 | if (enumerator & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 220 | strings.push_back("VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT"); |
| 221 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 222 | if (enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 223 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 224 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 225 | if (enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 226 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 227 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 228 | if (enumerator & VK_IMAGE_USAGE_STORAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 229 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 230 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 231 | if (enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 232 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 233 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 234 | if (enumerator & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 235 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DST_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 236 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 237 | if (enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 238 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 239 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 240 | if (enumerator & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 241 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SRC_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 242 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 243 | |
| 244 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 245 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 246 | enumeratorString += string; |
| 247 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 248 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 249 | enumeratorString += '|'; |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | return enumeratorString; |
| 254 | } |
| 255 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 256 | static bool ValidateEnumerator(VkQueueFlagBits const &enumerator) { |
| 257 | VkQueueFlagBits allFlags = |
| 258 | (VkQueueFlagBits)(VK_QUEUE_TRANSFER_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_SPARSE_BINDING_BIT | VK_QUEUE_GRAPHICS_BIT); |
| 259 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 260 | return false; |
| 261 | } |
| 262 | |
| 263 | return true; |
| 264 | } |
| 265 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 266 | static std::string EnumeratorString(VkQueueFlagBits const &enumerator) { |
| 267 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 268 | return "unrecognized enumerator"; |
| 269 | } |
| 270 | |
| 271 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 272 | if (enumerator & VK_QUEUE_TRANSFER_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 273 | strings.push_back("VK_QUEUE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 274 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 275 | if (enumerator & VK_QUEUE_COMPUTE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 276 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 277 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 278 | if (enumerator & VK_QUEUE_SPARSE_BINDING_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 279 | strings.push_back("VK_QUEUE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 280 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 281 | if (enumerator & VK_QUEUE_GRAPHICS_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 282 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 283 | } |
| 284 | |
| 285 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 286 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 287 | enumeratorString += string; |
| 288 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 289 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 290 | enumeratorString += '|'; |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | return enumeratorString; |
| 295 | } |
| 296 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 297 | static bool ValidateEnumerator(VkMemoryPropertyFlagBits const &enumerator) { |
| 298 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)( |
| 299 | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 300 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); |
| 301 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 302 | return false; |
| 303 | } |
| 304 | |
| 305 | return true; |
| 306 | } |
| 307 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 308 | static std::string EnumeratorString(VkMemoryPropertyFlagBits const &enumerator) { |
| 309 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 310 | return "unrecognized enumerator"; |
| 311 | } |
| 312 | |
| 313 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 314 | if (enumerator & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 315 | strings.push_back("VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT"); |
| 316 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 317 | if (enumerator & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 318 | strings.push_back("VK_MEMORY_PROPERTY_HOST_COHERENT_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_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 321 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 322 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 323 | if (enumerator & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 324 | strings.push_back("VK_MEMORY_PROPERTY_HOST_CACHED_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 325 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 326 | if (enumerator & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 327 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 328 | } |
| 329 | |
| 330 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 331 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 332 | enumeratorString += string; |
| 333 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 334 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 335 | enumeratorString += '|'; |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | return enumeratorString; |
| 340 | } |
| 341 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 342 | static bool ValidateEnumerator(VkMemoryHeapFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 343 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_DEVICE_LOCAL_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 344 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 345 | return false; |
| 346 | } |
| 347 | |
| 348 | return true; |
| 349 | } |
| 350 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 351 | static std::string EnumeratorString(VkMemoryHeapFlagBits const &enumerator) { |
| 352 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 353 | return "unrecognized enumerator"; |
| 354 | } |
| 355 | |
| 356 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 357 | if (enumerator & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 358 | strings.push_back("VK_MEMORY_HEAP_DEVICE_LOCAL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 362 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 363 | enumeratorString += string; |
| 364 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 365 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 366 | enumeratorString += '|'; |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | return enumeratorString; |
| 371 | } |
| 372 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 373 | static bool ValidateEnumerator(VkSparseImageFormatFlagBits const &enumerator) { |
| 374 | VkSparseImageFormatFlagBits allFlags = |
| 375 | (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT | |
| 376 | VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT | VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT); |
| 377 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 378 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 379 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 380 | |
| 381 | return true; |
| 382 | } |
| 383 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 384 | static std::string EnumeratorString(VkSparseImageFormatFlagBits const &enumerator) { |
| 385 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 386 | return "unrecognized enumerator"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 387 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 388 | |
| 389 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 390 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 391 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 392 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 393 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 394 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 395 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 396 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 397 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 398 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 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 | f4b6f56 | 2015-07-29 11:23:46 -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 | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 405 | enumeratorString += '|'; |
| 406 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 407 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 408 | |
| 409 | return enumeratorString; |
| 410 | } |
| 411 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 412 | static bool ValidateEnumerator(VkFenceCreateFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 413 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 414 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 415 | return false; |
| 416 | } |
| 417 | |
| 418 | return true; |
| 419 | } |
| 420 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 421 | static std::string EnumeratorString(VkFenceCreateFlagBits const &enumerator) { |
| 422 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 423 | return "unrecognized enumerator"; |
| 424 | } |
| 425 | |
| 426 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 427 | if (enumerator & VK_FENCE_CREATE_SIGNALED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 428 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 429 | } |
| 430 | |
| 431 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 432 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 433 | enumeratorString += string; |
| 434 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 435 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 436 | enumeratorString += '|'; |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | return enumeratorString; |
| 441 | } |
| 442 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 443 | static bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const &enumerator) { |
| 444 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)( |
| 445 | VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT | |
| 446 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT | |
| 447 | VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT | |
| 448 | 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] | 449 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT | |
| 450 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT | |
| 451 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 452 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 453 | return false; |
| 454 | } |
| 455 | |
| 456 | return true; |
| 457 | } |
| 458 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 459 | static std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const &enumerator) { |
| 460 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 461 | return "unrecognized enumerator"; |
| 462 | } |
| 463 | |
| 464 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 465 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 466 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 467 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 468 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 469 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 470 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 471 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 472 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 473 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 474 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 475 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 476 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 477 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 478 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 479 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 480 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 481 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 482 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 483 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 484 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 485 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 486 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 487 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 488 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 489 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 490 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 491 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 492 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 493 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 494 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 495 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 496 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 497 | } |
| 498 | |
| 499 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 500 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 501 | enumeratorString += string; |
| 502 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 503 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 504 | enumeratorString += '|'; |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | return enumeratorString; |
| 509 | } |
| 510 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 511 | static bool ValidateEnumerator(VkQueryResultFlagBits const &enumerator) { |
| 512 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 513 | VK_QUERY_RESULT_WAIT_BIT | VK_QUERY_RESULT_64_BIT); |
| 514 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 515 | return false; |
| 516 | } |
| 517 | |
| 518 | return true; |
| 519 | } |
| 520 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 521 | static std::string EnumeratorString(VkQueryResultFlagBits const &enumerator) { |
| 522 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 523 | return "unrecognized enumerator"; |
| 524 | } |
| 525 | |
| 526 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 527 | if (enumerator & VK_QUERY_RESULT_PARTIAL_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 528 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 529 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 530 | if (enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 531 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 532 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 533 | if (enumerator & VK_QUERY_RESULT_WAIT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 534 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 535 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 536 | if (enumerator & VK_QUERY_RESULT_64_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 537 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 538 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 539 | |
| 540 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 541 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 542 | enumeratorString += string; |
| 543 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 544 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 545 | enumeratorString += '|'; |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | return enumeratorString; |
| 550 | } |
| 551 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 552 | static bool ValidateEnumerator(VkBufferUsageFlagBits const &enumerator) { |
| 553 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)( |
| 554 | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 555 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | |
| 556 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); |
| 557 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 558 | return false; |
| 559 | } |
| 560 | |
| 561 | return true; |
| 562 | } |
| 563 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 564 | static std::string EnumeratorString(VkBufferUsageFlagBits const &enumerator) { |
| 565 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 566 | return "unrecognized enumerator"; |
| 567 | } |
| 568 | |
| 569 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 570 | if (enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 571 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 572 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 573 | if (enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 574 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 575 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 576 | if (enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 577 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 578 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 579 | if (enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 580 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 581 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 582 | if (enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 583 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 584 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 585 | if (enumerator & VK_BUFFER_USAGE_TRANSFER_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 586 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 587 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 588 | if (enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 589 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 590 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 591 | if (enumerator & VK_BUFFER_USAGE_TRANSFER_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 592 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SRC_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 593 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 594 | if (enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 595 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 596 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 597 | |
| 598 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 599 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 600 | enumeratorString += string; |
| 601 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 602 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 603 | enumeratorString += '|'; |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | return enumeratorString; |
| 608 | } |
| 609 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 610 | static bool ValidateEnumerator(VkBufferCreateFlagBits const &enumerator) { |
| 611 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)( |
| 612 | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT); |
| 613 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 614 | return false; |
| 615 | } |
| 616 | |
| 617 | return true; |
| 618 | } |
| 619 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 620 | static std::string EnumeratorString(VkBufferCreateFlagBits const &enumerator) { |
| 621 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 622 | return "unrecognized enumerator"; |
| 623 | } |
| 624 | |
| 625 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 626 | if (enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 627 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 628 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 629 | if (enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 630 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 631 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 632 | if (enumerator & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 633 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 634 | } |
| 635 | |
| 636 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 637 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 638 | enumeratorString += string; |
| 639 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 640 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 641 | enumeratorString += '|'; |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | return enumeratorString; |
| 646 | } |
| 647 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 648 | static bool ValidateEnumerator(VkImageCreateFlagBits const &enumerator) { |
| 649 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)( |
| 650 | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
| 651 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_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(VkImageCreateFlagBits 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_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 666 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 667 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 668 | if (enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 669 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 670 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 671 | if (enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 672 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 673 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 674 | if (enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 675 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 676 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 677 | if (enumerator & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 678 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 679 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 680 | |
| 681 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 682 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 683 | enumeratorString += string; |
| 684 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 685 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 686 | enumeratorString += '|'; |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | return enumeratorString; |
| 691 | } |
| 692 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 693 | static bool ValidateEnumerator(VkColorComponentFlagBits const &enumerator) { |
| 694 | VkColorComponentFlagBits allFlags = (VkColorComponentFlagBits)(VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | |
| 695 | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); |
| 696 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 697 | return false; |
| 698 | } |
| 699 | |
| 700 | return true; |
| 701 | } |
| 702 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 703 | static std::string EnumeratorString(VkColorComponentFlagBits const &enumerator) { |
| 704 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 705 | return "unrecognized enumerator"; |
| 706 | } |
| 707 | |
| 708 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 709 | if (enumerator & VK_COLOR_COMPONENT_A_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 710 | strings.push_back("VK_COLOR_COMPONENT_A_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 711 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 712 | if (enumerator & VK_COLOR_COMPONENT_B_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 713 | strings.push_back("VK_COLOR_COMPONENT_B_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 714 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 715 | if (enumerator & VK_COLOR_COMPONENT_G_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 716 | strings.push_back("VK_COLOR_COMPONENT_G_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 717 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 718 | if (enumerator & VK_COLOR_COMPONENT_R_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 719 | strings.push_back("VK_COLOR_COMPONENT_R_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 720 | } |
| 721 | |
| 722 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 723 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 724 | enumeratorString += string; |
| 725 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 726 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 727 | enumeratorString += '|'; |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | return enumeratorString; |
| 732 | } |
| 733 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 734 | static bool ValidateEnumerator(VkPipelineCreateFlagBits const &enumerator) { |
| 735 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)( |
| 736 | VK_PIPELINE_CREATE_DERIVATIVE_BIT | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
| 737 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 738 | return false; |
| 739 | } |
| 740 | |
| 741 | return true; |
| 742 | } |
| 743 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 744 | static std::string EnumeratorString(VkPipelineCreateFlagBits const &enumerator) { |
| 745 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 746 | return "unrecognized enumerator"; |
| 747 | } |
| 748 | |
| 749 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 750 | if (enumerator & VK_PIPELINE_CREATE_DERIVATIVE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 751 | strings.push_back("VK_PIPELINE_CREATE_DERIVATIVE_BIT"); |
| 752 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 753 | if (enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 754 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 755 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 756 | if (enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 757 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 758 | } |
| 759 | |
| 760 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 761 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 762 | enumeratorString += string; |
| 763 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 764 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 765 | enumeratorString += '|'; |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | return enumeratorString; |
| 770 | } |
| 771 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 772 | static bool ValidateEnumerator(VkShaderStageFlagBits const &enumerator) { |
| 773 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)( |
| 774 | VK_SHADER_STAGE_ALL | VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_GEOMETRY_BIT | VK_SHADER_STAGE_COMPUTE_BIT | |
| 775 | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_VERTEX_BIT); |
| 776 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -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(VkShaderStageFlagBits const &enumerator) { |
| 784 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -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_SHADER_STAGE_ALL) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 790 | strings.push_back("VK_SHADER_STAGE_ALL"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 791 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 792 | if (enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 793 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 794 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 795 | if (enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 796 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 797 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 798 | if (enumerator & VK_SHADER_STAGE_COMPUTE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 799 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 800 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 801 | if (enumerator & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 802 | strings.push_back("VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 803 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 804 | if (enumerator & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 805 | strings.push_back("VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 806 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 807 | if (enumerator & VK_SHADER_STAGE_VERTEX_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 808 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 809 | } |
| 810 | |
| 811 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 812 | for (auto const &string : strings) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 813 | enumeratorString += string; |
| 814 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 815 | if (string != strings.back()) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 816 | enumeratorString += '|'; |
| 817 | } |
| 818 | } |
| 819 | |
| 820 | return enumeratorString; |
| 821 | } |
| 822 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 823 | static bool ValidateEnumerator(VkPipelineStageFlagBits const &enumerator) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 824 | VkPipelineStageFlagBits allFlags = (VkPipelineStageFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 825 | VK_PIPELINE_STAGE_ALL_COMMANDS_BIT | VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_HOST_BIT | |
| 826 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | |
| 827 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | |
| 828 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | |
| 829 | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | |
| 830 | 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] | 831 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 832 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 833 | return false; |
| 834 | } |
| 835 | |
| 836 | return true; |
| 837 | } |
| 838 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 839 | static std::string EnumeratorString(VkPipelineStageFlagBits const &enumerator) { |
| 840 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 841 | return "unrecognized enumerator"; |
| 842 | } |
| 843 | |
| 844 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 845 | if (enumerator & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 846 | strings.push_back("VK_PIPELINE_STAGE_ALL_COMMANDS_BIT"); |
| 847 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 848 | if (enumerator & VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 849 | strings.push_back("VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 850 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 851 | if (enumerator & VK_PIPELINE_STAGE_HOST_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 852 | strings.push_back("VK_PIPELINE_STAGE_HOST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 853 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 854 | if (enumerator & VK_PIPELINE_STAGE_TRANSFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 855 | strings.push_back("VK_PIPELINE_STAGE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 856 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 857 | if (enumerator & VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 858 | strings.push_back("VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 859 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 860 | if (enumerator & VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT) { |
Jon Ashburn | 4bf8ba4 | 2015-12-31 12:14:37 -0700 | [diff] [blame] | 861 | strings.push_back("VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 862 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 863 | if (enumerator & VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 864 | strings.push_back("VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 865 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 866 | if (enumerator & VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 867 | strings.push_back("VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 868 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 869 | if (enumerator & VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 870 | strings.push_back("VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 871 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 872 | if (enumerator & VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 873 | strings.push_back("VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 874 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 875 | if (enumerator & VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 876 | strings.push_back("VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT"); |
| 877 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 878 | if (enumerator & VK_PIPELINE_STAGE_VERTEX_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 879 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_SHADER_BIT"); |
| 880 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 881 | if (enumerator & VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 882 | strings.push_back("VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 883 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 884 | if (enumerator & VK_PIPELINE_STAGE_VERTEX_INPUT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 885 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_INPUT_BIT"); |
| 886 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 887 | if (enumerator & VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 888 | strings.push_back("VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT"); |
| 889 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 890 | if (enumerator & VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 891 | strings.push_back("VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT"); |
| 892 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 893 | if (enumerator & VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 894 | strings.push_back("VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 895 | } |
| 896 | |
| 897 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 898 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 899 | enumeratorString += string; |
| 900 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 901 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 902 | enumeratorString += '|'; |
| 903 | } |
| 904 | } |
| 905 | |
| 906 | return enumeratorString; |
| 907 | } |
| 908 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 909 | static bool ValidateEnumerator(VkAccessFlagBits const &enumerator) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 910 | VkAccessFlagBits allFlags = (VkAccessFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 911 | VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_INDEX_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | |
| 912 | VK_ACCESS_UNIFORM_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | |
| 913 | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | |
| 914 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | |
| 915 | 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] | 916 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 917 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 918 | return false; |
| 919 | } |
| 920 | |
| 921 | return true; |
| 922 | } |
| 923 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 924 | static std::string EnumeratorString(VkAccessFlagBits const &enumerator) { |
| 925 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 926 | return "unrecognized enumerator"; |
| 927 | } |
| 928 | |
| 929 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 930 | if (enumerator & VK_ACCESS_INDIRECT_COMMAND_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 931 | strings.push_back("VK_ACCESS_INDIRECT_COMMAND_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 932 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 933 | if (enumerator & VK_ACCESS_INDEX_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 934 | strings.push_back("VK_ACCESS_INDEX_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 935 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 936 | if (enumerator & VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 937 | strings.push_back("VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 938 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 939 | if (enumerator & VK_ACCESS_UNIFORM_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 940 | strings.push_back("VK_ACCESS_UNIFORM_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 941 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 942 | if (enumerator & VK_ACCESS_INPUT_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 943 | strings.push_back("VK_ACCESS_INPUT_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 944 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 945 | if (enumerator & VK_ACCESS_SHADER_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 946 | strings.push_back("VK_ACCESS_SHADER_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 947 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 948 | if (enumerator & VK_ACCESS_SHADER_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 949 | strings.push_back("VK_ACCESS_SHADER_WRITE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 950 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 951 | if (enumerator & VK_ACCESS_COLOR_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 952 | strings.push_back("VK_ACCESS_COLOR_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 953 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 954 | if (enumerator & VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 955 | strings.push_back("VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 956 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 957 | if (enumerator & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 958 | strings.push_back("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 959 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 960 | if (enumerator & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 961 | strings.push_back("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 962 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 963 | if (enumerator & VK_ACCESS_TRANSFER_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 964 | strings.push_back("VK_ACCESS_TRANSFER_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 965 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 966 | if (enumerator & VK_ACCESS_TRANSFER_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 967 | strings.push_back("VK_ACCESS_TRANSFER_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 968 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 969 | if (enumerator & VK_ACCESS_HOST_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 970 | strings.push_back("VK_ACCESS_HOST_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 971 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 972 | if (enumerator & VK_ACCESS_HOST_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 973 | strings.push_back("VK_ACCESS_HOST_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 974 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 975 | if (enumerator & VK_ACCESS_MEMORY_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 976 | strings.push_back("VK_ACCESS_MEMORY_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_MEMORY_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 979 | strings.push_back("VK_ACCESS_MEMORY_WRITE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 980 | } |
| 981 | |
| 982 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 983 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 984 | enumeratorString += string; |
| 985 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 986 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 987 | enumeratorString += '|'; |
| 988 | } |
| 989 | } |
| 990 | |
| 991 | return enumeratorString; |
| 992 | } |
| 993 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 994 | static bool ValidateEnumerator(VkCommandPoolCreateFlagBits const &enumerator) { |
| 995 | VkCommandPoolCreateFlagBits allFlags = |
| 996 | (VkCommandPoolCreateFlagBits)(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT); |
| 997 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 998 | return false; |
| 999 | } |
| 1000 | |
| 1001 | return true; |
| 1002 | } |
| 1003 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1004 | static std::string EnumeratorString(VkCommandPoolCreateFlagBits const &enumerator) { |
| 1005 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1006 | return "unrecognized enumerator"; |
| 1007 | } |
| 1008 | |
| 1009 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1010 | if (enumerator & VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1011 | strings.push_back("VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1012 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1013 | if (enumerator & VK_COMMAND_POOL_CREATE_TRANSIENT_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1014 | strings.push_back("VK_COMMAND_POOL_CREATE_TRANSIENT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1015 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1016 | |
| 1017 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1018 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1019 | enumeratorString += string; |
| 1020 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1021 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1022 | enumeratorString += '|'; |
| 1023 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1024 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1025 | |
| 1026 | return enumeratorString; |
| 1027 | } |
| 1028 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1029 | static bool ValidateEnumerator(VkCommandPoolResetFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1030 | VkCommandPoolResetFlagBits allFlags = (VkCommandPoolResetFlagBits)(VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1031 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1032 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1033 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1034 | |
| 1035 | return true; |
| 1036 | } |
| 1037 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1038 | static std::string EnumeratorString(VkCommandPoolResetFlagBits const &enumerator) { |
| 1039 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1040 | return "unrecognized enumerator"; |
| 1041 | } |
| 1042 | |
| 1043 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1044 | if (enumerator & VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1045 | strings.push_back("VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1046 | } |
| 1047 | |
| 1048 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1049 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1050 | enumeratorString += string; |
| 1051 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1052 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1053 | enumeratorString += '|'; |
| 1054 | } |
| 1055 | } |
| 1056 | |
| 1057 | return enumeratorString; |
| 1058 | } |
| 1059 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1060 | static bool ValidateEnumerator(VkCommandBufferUsageFlags const &enumerator) { |
| 1061 | VkCommandBufferUsageFlags allFlags = |
| 1062 | (VkCommandBufferUsageFlags)(VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT | VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT | |
| 1063 | VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT); |
| 1064 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1065 | return false; |
| 1066 | } |
| 1067 | |
| 1068 | return true; |
| 1069 | } |
| 1070 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1071 | static std::string EnumeratorString(VkCommandBufferUsageFlags const &enumerator) { |
| 1072 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1073 | return "unrecognized enumerator"; |
| 1074 | } |
| 1075 | |
| 1076 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1077 | if (enumerator & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1078 | strings.push_back("VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1079 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1080 | if (enumerator & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1081 | strings.push_back("VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1082 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1083 | if (enumerator & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1084 | strings.push_back("VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_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(VkCommandBufferResetFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1100 | VkCommandBufferResetFlagBits allFlags = (VkCommandBufferResetFlagBits)(VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1101 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1102 | return false; |
| 1103 | } |
| 1104 | |
| 1105 | return true; |
| 1106 | } |
| 1107 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1108 | static std::string EnumeratorString(VkCommandBufferResetFlagBits const &enumerator) { |
| 1109 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1110 | return "unrecognized enumerator"; |
| 1111 | } |
| 1112 | |
| 1113 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1114 | if (enumerator & VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1115 | strings.push_back("VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1116 | } |
| 1117 | |
| 1118 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1119 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1120 | enumeratorString += string; |
| 1121 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1122 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1123 | enumeratorString += '|'; |
| 1124 | } |
| 1125 | } |
| 1126 | |
| 1127 | return enumeratorString; |
| 1128 | } |
| 1129 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1130 | static bool ValidateEnumerator(VkImageAspectFlagBits const &enumerator) { |
| 1131 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_METADATA_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1132 | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_COLOR_BIT); |
| 1133 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1134 | return false; |
| 1135 | } |
| 1136 | |
| 1137 | return true; |
| 1138 | } |
| 1139 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1140 | static std::string EnumeratorString(VkImageAspectFlagBits const &enumerator) { |
| 1141 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1142 | return "unrecognized enumerator"; |
| 1143 | } |
| 1144 | |
| 1145 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1146 | if (enumerator & VK_IMAGE_ASPECT_METADATA_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1147 | strings.push_back("VK_IMAGE_ASPECT_METADATA_BIT"); |
| 1148 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1149 | if (enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1150 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1151 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1152 | if (enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1153 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1154 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1155 | if (enumerator & VK_IMAGE_ASPECT_COLOR_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1156 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1157 | } |
| 1158 | |
| 1159 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1160 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1161 | enumeratorString += string; |
| 1162 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1163 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1164 | enumeratorString += '|'; |
| 1165 | } |
| 1166 | } |
| 1167 | |
| 1168 | return enumeratorString; |
| 1169 | } |
| 1170 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1171 | static bool ValidateEnumerator(VkQueryControlFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1172 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_PRECISE_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1173 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1174 | return false; |
| 1175 | } |
| 1176 | |
| 1177 | return true; |
| 1178 | } |
| 1179 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1180 | static std::string EnumeratorString(VkQueryControlFlagBits const &enumerator) { |
| 1181 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1182 | return "unrecognized enumerator"; |
| 1183 | } |
| 1184 | |
| 1185 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1186 | if (enumerator & VK_QUERY_CONTROL_PRECISE_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 1187 | strings.push_back("VK_QUERY_CONTROL_PRECISE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1188 | } |
| 1189 | |
| 1190 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1191 | for (auto const &string : strings) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1192 | enumeratorString += string; |
| 1193 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1194 | if (string != strings.back()) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1195 | enumeratorString += '|'; |
| 1196 | } |
| 1197 | } |
| 1198 | |
| 1199 | return enumeratorString; |
| 1200 | } |
| 1201 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1202 | static const int MaxParamCheckerStringLength = 256; |
| 1203 | |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 1204 | static bool validate_string(debug_report_data *report_data, const char *apiName, const ParameterName &stringName, |
Dustin Graves | 080069b | 2016-04-05 13:48:15 -0600 | [diff] [blame] | 1205 | const char *validateString) { |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1206 | assert(apiName != nullptr); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1207 | assert(validateString != nullptr); |
| 1208 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1209 | bool skip = false; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1210 | |
| 1211 | VkStringErrorFlags result = vk_string_validate(MaxParamCheckerStringLength, validateString); |
| 1212 | |
| 1213 | if (result == VK_STRING_ERROR_NONE) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1214 | return skip; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1215 | } else if (result & VK_STRING_ERROR_LENGTH) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1216 | skip = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1217 | INVALID_USAGE, LayerName, "%s: string %s exceeds max length %d", apiName, stringName.get_name().c_str(), |
| 1218 | MaxParamCheckerStringLength); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1219 | } else if (result & VK_STRING_ERROR_BAD_DATA) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1220 | skip = log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1221 | INVALID_USAGE, LayerName, "%s: string %s contains invalid characters or is badly formed", apiName, |
| 1222 | stringName.get_name().c_str()); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1223 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1224 | return skip; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1225 | } |
| 1226 | |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1227 | static bool validate_queue_family_index(layer_data *device_data, const char *function_name, const char *parameter_name, |
| 1228 | uint32_t index) { |
| 1229 | assert(device_data != nullptr); |
| 1230 | debug_report_data *report_data = device_data->report_data; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1231 | bool skip = false; |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1232 | |
| 1233 | if (index == VK_QUEUE_FAMILY_IGNORED) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 1234 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 1235 | LayerName, "%s: %s cannot be VK_QUEUE_FAMILY_IGNORED.", function_name, parameter_name); |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1236 | } else { |
| 1237 | const auto &queue_data = device_data->queueFamilyIndexMap.find(index); |
| 1238 | if (queue_data == device_data->queueFamilyIndexMap.end()) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 1239 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 1240 | LayerName, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1241 | "%s: %s (%d) must be one of the indices specified when the device was created, via " |
| 1242 | "the VkDeviceQueueCreateInfo structure.", |
| 1243 | function_name, parameter_name, index); |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1244 | return false; |
| 1245 | } |
| 1246 | } |
| 1247 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1248 | return skip; |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1249 | } |
| 1250 | |
| 1251 | static bool validate_queue_family_indices(layer_data *device_data, const char *function_name, const char *parameter_name, |
| 1252 | const uint32_t count, const uint32_t *indices) { |
| 1253 | assert(device_data != nullptr); |
| 1254 | debug_report_data *report_data = device_data->report_data; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1255 | bool skip = false; |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1256 | |
| 1257 | if (indices != nullptr) { |
| 1258 | for (uint32_t i = 0; i < count; i++) { |
| 1259 | if (indices[i] == VK_QUEUE_FAMILY_IGNORED) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 1260 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1261 | LayerName, "%s: %s[%d] cannot be VK_QUEUE_FAMILY_IGNORED.", function_name, parameter_name, i); |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1262 | } else { |
| 1263 | const auto &queue_data = device_data->queueFamilyIndexMap.find(indices[i]); |
| 1264 | if (queue_data == device_data->queueFamilyIndexMap.end()) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 1265 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 1266 | __LINE__, 1, LayerName, |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 1267 | "%s: %s[%d] (%d) must be one of the indices specified when the device was " |
| 1268 | "created, via the VkDeviceQueueCreateInfo structure.", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1269 | function_name, parameter_name, i, indices[i]); |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1270 | return false; |
| 1271 | } |
| 1272 | } |
| 1273 | } |
| 1274 | } |
| 1275 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1276 | return skip; |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1277 | } |
| 1278 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1279 | VKAPI_ATTR VkResult VKAPI_CALL CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
| 1280 | VkInstance *pInstance) { |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1281 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1282 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1283 | VkLayerInstanceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1284 | assert(chain_info != nullptr); |
| 1285 | assert(chain_info->u.pLayerInfo != nullptr); |
| 1286 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1287 | PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr; |
| 1288 | PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance)fpGetInstanceProcAddr(NULL, "vkCreateInstance"); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1289 | if (fpCreateInstance == NULL) { |
| 1290 | return VK_ERROR_INITIALIZATION_FAILED; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1291 | } |
| 1292 | |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1293 | // Advance the link info for the next element on the chain |
| 1294 | chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext; |
| 1295 | |
| 1296 | result = fpCreateInstance(pCreateInfo, pAllocator, pInstance); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1297 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1298 | if (result == VK_SUCCESS) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1299 | auto my_instance_data = GetLayerDataPtr(get_dispatch_key(*pInstance), instance_layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1300 | assert(my_instance_data != nullptr); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1301 | |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1302 | layer_init_instance_dispatch_table(*pInstance, &my_instance_data->dispatch_table, fpGetInstanceProcAddr); |
Chia-I Wu | a570b7c | 2016-05-16 07:48:14 +0800 | [diff] [blame] | 1303 | my_instance_data->instance = *pInstance; |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1304 | my_instance_data->report_data = |
| 1305 | debug_report_create_instance(&my_instance_data->dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount, |
| 1306 | pCreateInfo->ppEnabledExtensionNames); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1307 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1308 | // Look for one or more debug report create info structures |
| 1309 | // and setup a callback(s) for each one found. |
| 1310 | if (!layer_copy_tmp_callbacks(pCreateInfo->pNext, &my_instance_data->num_tmp_callbacks, |
| 1311 | &my_instance_data->tmp_dbg_create_infos, &my_instance_data->tmp_callbacks)) { |
| 1312 | if (my_instance_data->num_tmp_callbacks > 0) { |
| 1313 | // Setup the temporary callback(s) here to catch early issues: |
| 1314 | if (layer_enable_tmp_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_callbacks, |
| 1315 | my_instance_data->tmp_dbg_create_infos, my_instance_data->tmp_callbacks)) { |
| 1316 | // Failure of setting up one or more of the callback. |
| 1317 | // Therefore, clean up and don't use those callbacks: |
| 1318 | layer_free_tmp_callbacks(my_instance_data->tmp_dbg_create_infos, my_instance_data->tmp_callbacks); |
| 1319 | my_instance_data->num_tmp_callbacks = 0; |
| 1320 | } |
| 1321 | } |
| 1322 | } |
| 1323 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1324 | init_parameter_validation(my_instance_data, pAllocator); |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 1325 | my_instance_data->extensions.InitFromInstanceCreateInfo(pCreateInfo); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1326 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1327 | // Ordinarily we'd check these before calling down the chain, but none of the layer |
| 1328 | // support is in place until now, if we survive we can report the issue now. |
| 1329 | parameter_validation_vkCreateInstance(my_instance_data->report_data, pCreateInfo, pAllocator, pInstance); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1330 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1331 | if (pCreateInfo->pApplicationInfo) { |
| 1332 | if (pCreateInfo->pApplicationInfo->pApplicationName) { |
| 1333 | validate_string(my_instance_data->report_data, "vkCreateInstance", |
| 1334 | "pCreateInfo->VkApplicationInfo->pApplicationName", |
| 1335 | pCreateInfo->pApplicationInfo->pApplicationName); |
| 1336 | } |
Courtney Goeltzenleuchter | 842691b | 2016-02-10 14:00:52 -0700 | [diff] [blame] | 1337 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1338 | if (pCreateInfo->pApplicationInfo->pEngineName) { |
| 1339 | validate_string(my_instance_data->report_data, "vkCreateInstance", "pCreateInfo->VkApplicationInfo->pEngineName", |
| 1340 | pCreateInfo->pApplicationInfo->pEngineName); |
| 1341 | } |
Courtney Goeltzenleuchter | 41c5c4b | 2016-02-10 15:13:55 -0700 | [diff] [blame] | 1342 | } |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1343 | |
| 1344 | // Disable the tmp callbacks: |
| 1345 | if (my_instance_data->num_tmp_callbacks > 0) { |
| 1346 | layer_disable_tmp_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_callbacks, |
| 1347 | my_instance_data->tmp_callbacks); |
| 1348 | } |
Courtney Goeltzenleuchter | 842691b | 2016-02-10 14:00:52 -0700 | [diff] [blame] | 1349 | } |
| 1350 | |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1351 | return result; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1352 | } |
| 1353 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1354 | VKAPI_ATTR void VKAPI_CALL DestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1355 | // Grab the key before the instance is destroyed. |
| 1356 | dispatch_key key = get_dispatch_key(instance); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1357 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1358 | auto my_data = GetLayerDataPtr(key, instance_layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1359 | assert(my_data != NULL); |
| 1360 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1361 | // Enable the temporary callback(s) here to catch vkDestroyInstance issues: |
| 1362 | bool callback_setup = false; |
| 1363 | if (my_data->num_tmp_callbacks > 0) { |
| 1364 | if (!layer_enable_tmp_callbacks(my_data->report_data, my_data->num_tmp_callbacks, my_data->tmp_dbg_create_infos, |
| 1365 | my_data->tmp_callbacks)) { |
| 1366 | callback_setup = true; |
| 1367 | } |
| 1368 | } |
| 1369 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1370 | skip |= parameter_validation_vkDestroyInstance(my_data->report_data, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1371 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1372 | // Disable and cleanup the temporary callback(s): |
| 1373 | if (callback_setup) { |
| 1374 | layer_disable_tmp_callbacks(my_data->report_data, my_data->num_tmp_callbacks, my_data->tmp_callbacks); |
| 1375 | } |
| 1376 | if (my_data->num_tmp_callbacks > 0) { |
| 1377 | layer_free_tmp_callbacks(my_data->tmp_dbg_create_infos, my_data->tmp_callbacks); |
| 1378 | my_data->num_tmp_callbacks = 0; |
| 1379 | } |
| 1380 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1381 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1382 | my_data->dispatch_table.DestroyInstance(instance, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1383 | |
| 1384 | // Clean up logging callback, if any |
| 1385 | while (my_data->logging_callback.size() > 0) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1386 | VkDebugReportCallbackEXT callback = my_data->logging_callback.back(); |
| 1387 | layer_destroy_msg_callback(my_data->report_data, callback, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1388 | my_data->logging_callback.pop_back(); |
| 1389 | } |
| 1390 | |
Chris Forbes | 78a56b0 | 2016-11-02 16:13:01 +1300 | [diff] [blame] | 1391 | layer_debug_report_destroy_instance(my_data->report_data); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1392 | instance_layer_data_map.erase(key); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1393 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1394 | } |
| 1395 | |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 1396 | VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, |
| 1397 | VkPhysicalDevice *pPhysicalDevices) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1398 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1399 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1400 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1401 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1402 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1403 | skip |= parameter_validation_vkEnumeratePhysicalDevices(my_data->report_data, pPhysicalDeviceCount, pPhysicalDevices); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1404 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1405 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1406 | result = my_data->dispatch_table.EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1407 | validate_result(my_data->report_data, "vkEnumeratePhysicalDevices", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1408 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1409 | return result; |
| 1410 | } |
| 1411 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1412 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1413 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1414 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1415 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1416 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1417 | skip |= parameter_validation_vkGetPhysicalDeviceFeatures(my_data->report_data, pFeatures); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1418 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1419 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1420 | my_data->dispatch_table.GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1421 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1422 | } |
| 1423 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1424 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 1425 | VkFormatProperties *pFormatProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1426 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1427 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1428 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1429 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1430 | skip |= parameter_validation_vkGetPhysicalDeviceFormatProperties(my_data->report_data, format, pFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1431 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1432 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1433 | my_data->dispatch_table.GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1434 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1435 | } |
| 1436 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1437 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 1438 | VkImageType type, VkImageTiling tiling, |
| 1439 | VkImageUsageFlags usage, VkImageCreateFlags flags, |
| 1440 | VkImageFormatProperties *pImageFormatProperties) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1441 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1442 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1443 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1444 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1445 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1446 | skip |= parameter_validation_vkGetPhysicalDeviceImageFormatProperties(my_data->report_data, format, type, tiling, usage, flags, |
| 1447 | pImageFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1448 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1449 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1450 | result = my_data->dispatch_table.GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, |
| 1451 | pImageFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1452 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1453 | validate_result(my_data->report_data, "vkGetPhysicalDeviceImageFormatProperties", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1454 | } |
Chia-I Wu | 1724104 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 1455 | |
| 1456 | return result; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1457 | } |
| 1458 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1459 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1460 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1461 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1462 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1463 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1464 | skip |= parameter_validation_vkGetPhysicalDeviceProperties(my_data->report_data, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1465 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1466 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1467 | my_data->dispatch_table.GetPhysicalDeviceProperties(physicalDevice, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1468 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1469 | } |
| 1470 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1471 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, |
| 1472 | uint32_t *pQueueFamilyPropertyCount, |
| 1473 | VkQueueFamilyProperties *pQueueFamilyProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1474 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1475 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1476 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1477 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1478 | skip |= parameter_validation_vkGetPhysicalDeviceQueueFamilyProperties(my_data->report_data, pQueueFamilyPropertyCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1479 | pQueueFamilyProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1480 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1481 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1482 | my_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, |
| 1483 | pQueueFamilyProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1484 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1485 | } |
| 1486 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1487 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, |
| 1488 | VkPhysicalDeviceMemoryProperties *pMemoryProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1489 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1490 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1491 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1492 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1493 | skip |= parameter_validation_vkGetPhysicalDeviceMemoryProperties(my_data->report_data, pMemoryProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1494 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1495 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1496 | my_data->dispatch_table.GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1497 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1498 | } |
| 1499 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 1500 | static void validateDeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1501 | const std::vector<VkQueueFamilyProperties> properties) { |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1502 | std::unordered_set<uint32_t> set; |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1503 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1504 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1505 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1506 | if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { |
| 1507 | for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) { |
| 1508 | if (set.count(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex)) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1509 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 1510 | VALIDATION_ERROR_00035, LayerName, |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1511 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueFamilyIndex, is not unique within this " |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 1512 | "structure. %s", |
| 1513 | i, validation_error_map[VALIDATION_ERROR_00035]); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1514 | } else { |
| 1515 | set.insert(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex); |
Michael Lentine | fa71bd5 | 2016-01-27 12:50:30 -0600 | [diff] [blame] | 1516 | } |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1517 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1518 | if (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities != nullptr) { |
| 1519 | for (uint32_t j = 0; j < pCreateInfo->pQueueCreateInfos[i].queueCount; ++j) { |
| 1520 | if ((pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j] < 0.f) || |
| 1521 | (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j] > 1.f)) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1522 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 1523 | __LINE__, INVALID_USAGE, LayerName, |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1524 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->pQueuePriorities[%d], must be " |
| 1525 | "between 0 and 1. Actual value is %f", |
| 1526 | i, j, pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j]); |
| 1527 | } |
| 1528 | } |
| 1529 | } |
| 1530 | |
| 1531 | if (pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex >= properties.size()) { |
| 1532 | log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1533 | my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 1534 | INVALID_USAGE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1535 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueFamilyIndex cannot be more than the number " |
| 1536 | "of queue families.", |
| 1537 | i); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1538 | } else if (pCreateInfo->pQueueCreateInfos[i].queueCount > |
| 1539 | properties[pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex].queueCount) { |
| 1540 | log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1541 | my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 1542 | INVALID_USAGE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1543 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueCount cannot be more than the number of " |
| 1544 | "queues for the given family index.", |
| 1545 | i); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1546 | } |
Michael Lentine | 774704f | 2016-01-27 13:36:46 -0600 | [diff] [blame] | 1547 | } |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1548 | } |
| 1549 | } |
| 1550 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1551 | void storeCreateDeviceData(VkDevice device, const VkDeviceCreateInfo *pCreateInfo) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1552 | layer_data *my_device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1553 | |
| 1554 | if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { |
| 1555 | for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) { |
| 1556 | my_device_data->queueFamilyIndexMap.insert( |
| 1557 | std::make_pair(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex, pCreateInfo->pQueueCreateInfos[i].queueCount)); |
| 1558 | } |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1559 | } |
| 1560 | } |
| 1561 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1562 | VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1563 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { |
Courtney Goeltzenleuchter | bafcdf3 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 1564 | /* |
Courtney Goeltzenleuchter | bafcdf3 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 1565 | * NOTE: We do not validate physicalDevice or any dispatchable |
| 1566 | * object as the first parameter. We couldn't get here if it was wrong! |
| 1567 | */ |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1568 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1569 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1570 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1571 | auto my_instance_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1572 | assert(my_instance_data != nullptr); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1573 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1574 | skip |= parameter_validation_vkCreateDevice(my_instance_data->report_data, pCreateInfo, pAllocator, pDevice); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1575 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1576 | if (pCreateInfo != NULL) { |
| 1577 | if ((pCreateInfo->enabledLayerCount > 0) && (pCreateInfo->ppEnabledLayerNames != NULL)) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 1578 | for (size_t i = 0; i < pCreateInfo->enabledLayerCount; i++) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1579 | skip |= validate_string(my_instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledLayerNames", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1580 | pCreateInfo->ppEnabledLayerNames[i]); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1581 | } |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1582 | } |
Michael Lentine | 774704f | 2016-01-27 13:36:46 -0600 | [diff] [blame] | 1583 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1584 | if ((pCreateInfo->enabledExtensionCount > 0) && (pCreateInfo->ppEnabledExtensionNames != NULL)) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 1585 | for (size_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1586 | skip |= validate_string(my_instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledExtensionNames", |
| 1587 | pCreateInfo->ppEnabledExtensionNames[i]); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1588 | } |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1589 | } |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 1590 | if (pCreateInfo->pNext != NULL && pCreateInfo->pEnabledFeatures) { |
| 1591 | // Check for get_physical_device_properties2 struct |
| 1592 | struct std_header { |
| 1593 | VkStructureType sType; |
| 1594 | const void *pNext; |
| 1595 | }; |
| 1596 | std_header *cur_pnext = (std_header *)pCreateInfo->pNext; |
| 1597 | while (cur_pnext) { |
| 1598 | if (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR == cur_pnext->sType) { |
| 1599 | // Cannot include VkPhysicalDeviceFeatures2KHR and have non-null pEnabledFeatures |
| 1600 | skip |= log_msg(my_instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, |
| 1601 | VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, LayerName, |
| 1602 | "VkDeviceCreateInfo->pNext includes a VkPhysicalDeviceFeatures2KHR struct when " |
| 1603 | "pCreateInfo->pEnabledFeatures is non-NULL."); |
| 1604 | break; |
| 1605 | } |
| 1606 | cur_pnext = (std_header *)cur_pnext->pNext; |
| 1607 | } |
| 1608 | } |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 1609 | if (pCreateInfo->pNext != NULL && pCreateInfo->pEnabledFeatures) { |
| 1610 | // Check for get_physical_device_properties2 struct |
| 1611 | struct std_header { |
| 1612 | VkStructureType sType; |
| 1613 | const void *pNext; |
| 1614 | }; |
| 1615 | std_header *cur_pnext = (std_header *)pCreateInfo->pNext; |
| 1616 | while (cur_pnext) { |
| 1617 | if (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR == cur_pnext->sType) { |
| 1618 | // Cannot include VkPhysicalDeviceFeatures2KHR and have non-null pEnabledFeatures |
| 1619 | skip |= log_msg(my_instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, |
| 1620 | VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, LayerName, |
| 1621 | "VkDeviceCreateInfo->pNext includes a VkPhysicalDeviceFeatures2KHR struct when " |
| 1622 | "pCreateInfo->pEnabledFeatures is non-NULL."); |
| 1623 | break; |
| 1624 | } |
| 1625 | cur_pnext = (std_header *)cur_pnext->pNext; |
| 1626 | } |
| 1627 | } |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1628 | } |
| 1629 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1630 | if (!skip) { |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1631 | VkLayerDeviceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1632 | assert(chain_info != nullptr); |
| 1633 | assert(chain_info->u.pLayerInfo != nullptr); |
| 1634 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1635 | PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr; |
| 1636 | PFN_vkGetDeviceProcAddr fpGetDeviceProcAddr = chain_info->u.pLayerInfo->pfnNextGetDeviceProcAddr; |
Chia-I Wu | a570b7c | 2016-05-16 07:48:14 +0800 | [diff] [blame] | 1637 | PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice)fpGetInstanceProcAddr(my_instance_data->instance, "vkCreateDevice"); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1638 | if (fpCreateDevice == NULL) { |
| 1639 | return VK_ERROR_INITIALIZATION_FAILED; |
| 1640 | } |
| 1641 | |
| 1642 | // Advance the link info for the next element on the chain |
| 1643 | chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext; |
| 1644 | |
| 1645 | result = fpCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1646 | |
| 1647 | validate_result(my_instance_data->report_data, "vkCreateDevice", result); |
| 1648 | |
| 1649 | if (result == VK_SUCCESS) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1650 | layer_data *my_device_data = GetLayerDataPtr(get_dispatch_key(*pDevice), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1651 | assert(my_device_data != nullptr); |
| 1652 | |
| 1653 | my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1654 | layer_init_device_dispatch_table(*pDevice, &my_device_data->dispatch_table, fpGetDeviceProcAddr); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1655 | |
Chris Forbes | 8976f74 | 2017-05-02 14:52:05 -0700 | [diff] [blame] | 1656 | my_device_data->enables.InitFromDeviceCreateInfo(pCreateInfo); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1657 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1658 | uint32_t count; |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1659 | my_instance_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, nullptr); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1660 | std::vector<VkQueueFamilyProperties> properties(count); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1661 | my_instance_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, &properties[0]); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1662 | |
| 1663 | validateDeviceCreateInfo(physicalDevice, pCreateInfo, properties); |
| 1664 | storeCreateDeviceData(*pDevice, pCreateInfo); |
Mark Lobodzinski | a493251 | 2016-06-27 15:13:00 -0600 | [diff] [blame] | 1665 | |
| 1666 | // Query and save physical device limits for this device |
| 1667 | VkPhysicalDeviceProperties device_properties = {}; |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1668 | my_instance_data->dispatch_table.GetPhysicalDeviceProperties(physicalDevice, &device_properties); |
Mark Lobodzinski | a493251 | 2016-06-27 15:13:00 -0600 | [diff] [blame] | 1669 | memcpy(&my_device_data->device_limits, &device_properties.limits, sizeof(VkPhysicalDeviceLimits)); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 1670 | my_device_data->physical_device = physicalDevice; |
Mark Lobodzinski | 7bdd9f2 | 2016-08-09 13:41:09 -0600 | [diff] [blame] | 1671 | |
| 1672 | // Save app-enabled features in this device's layer_data structure |
| 1673 | if (pCreateInfo->pEnabledFeatures) { |
| 1674 | my_device_data->physical_device_features = *pCreateInfo->pEnabledFeatures; |
| 1675 | } else { |
| 1676 | memset(&my_device_data->physical_device_features, 0, sizeof(VkPhysicalDeviceFeatures)); |
| 1677 | } |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1678 | } |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1679 | } |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1680 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1681 | return result; |
| 1682 | } |
| 1683 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1684 | VKAPI_ATTR void VKAPI_CALL DestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1685 | dispatch_key key = get_dispatch_key(device); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1686 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1687 | layer_data *my_data = GetLayerDataPtr(key, layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1688 | assert(my_data != NULL); |
| 1689 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1690 | skip |= parameter_validation_vkDestroyDevice(my_data->report_data, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1691 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1692 | if (!skip) { |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1693 | layer_debug_report_destroy_device(device); |
| 1694 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1695 | #if DISPATCH_MAP_DEBUG |
Mark Mueller | aab3650 | 2016-05-03 13:17:29 -0600 | [diff] [blame] | 1696 | fprintf(stderr, "Device: 0x%p, key: 0x%p\n", device, key); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1697 | #endif |
| 1698 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1699 | my_data->dispatch_table.DestroyDevice(device, pAllocator); |
Tony Barbour | d4eb06d | 2016-03-29 15:14:59 -0600 | [diff] [blame] | 1700 | layer_data_map.erase(key); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1701 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1702 | } |
| 1703 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 1704 | static bool PreGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1705 | layer_data *my_device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1706 | assert(my_device_data != nullptr); |
| 1707 | |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1708 | validate_queue_family_index(my_device_data, "vkGetDeviceQueue", "queueFamilyIndex", queueFamilyIndex); |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 1709 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1710 | const auto &queue_data = my_device_data->queueFamilyIndexMap.find(queueFamilyIndex); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1711 | if (queue_data->second <= queueIndex) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 1712 | log_msg( |
| 1713 | my_device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 1714 | VALIDATION_ERROR_00061, LayerName, |
| 1715 | "vkGetDeviceQueue() parameter, uint32_t queueIndex %d, must be less than the number of queues given when the device " |
| 1716 | "was created. %s", |
| 1717 | queueIndex, validation_error_map[VALIDATION_ERROR_00061]); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1718 | return false; |
| 1719 | } |
| 1720 | return true; |
| 1721 | } |
| 1722 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1723 | VKAPI_ATTR void VKAPI_CALL GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1724 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1725 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1726 | assert(my_data != NULL); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1727 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1728 | skip |= parameter_validation_vkGetDeviceQueue(my_data->report_data, queueFamilyIndex, queueIndex, pQueue); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1729 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1730 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1731 | PreGetDeviceQueue(device, queueFamilyIndex, queueIndex); |
| 1732 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1733 | my_data->dispatch_table.GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1734 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1735 | } |
| 1736 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1737 | VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1738 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1739 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1740 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1741 | assert(my_data != NULL); |
| 1742 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1743 | skip |= parameter_validation_vkQueueSubmit(my_data->report_data, submitCount, pSubmits, fence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1744 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1745 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1746 | result = my_data->dispatch_table.QueueSubmit(queue, submitCount, pSubmits, fence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1747 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1748 | validate_result(my_data->report_data, "vkQueueSubmit", result); |
Courtney Goeltzenleuchter | 646b907 | 2015-10-20 18:04:07 -0600 | [diff] [blame] | 1749 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1750 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1751 | return result; |
| 1752 | } |
| 1753 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1754 | VKAPI_ATTR VkResult VKAPI_CALL QueueWaitIdle(VkQueue queue) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1755 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1756 | assert(my_data != NULL); |
| 1757 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1758 | VkResult result = my_data->dispatch_table.QueueWaitIdle(queue); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1759 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1760 | validate_result(my_data->report_data, "vkQueueWaitIdle", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1761 | |
| 1762 | return result; |
| 1763 | } |
| 1764 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1765 | VKAPI_ATTR VkResult VKAPI_CALL DeviceWaitIdle(VkDevice device) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1766 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1767 | assert(my_data != NULL); |
| 1768 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1769 | VkResult result = my_data->dispatch_table.DeviceWaitIdle(device); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1770 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1771 | validate_result(my_data->report_data, "vkDeviceWaitIdle", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1772 | |
| 1773 | return result; |
| 1774 | } |
| 1775 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1776 | VKAPI_ATTR VkResult VKAPI_CALL AllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1777 | const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1778 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1779 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1780 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1781 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1782 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1783 | skip |= parameter_validation_vkAllocateMemory(my_data->report_data, pAllocateInfo, pAllocator, pMemory); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1784 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1785 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1786 | result = my_data->dispatch_table.AllocateMemory(device, pAllocateInfo, pAllocator, pMemory); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1787 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1788 | validate_result(my_data->report_data, "vkAllocateMemory", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1789 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1790 | |
| 1791 | return result; |
| 1792 | } |
| 1793 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1794 | VKAPI_ATTR void VKAPI_CALL FreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1795 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1796 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1797 | assert(my_data != NULL); |
| 1798 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1799 | skip |= parameter_validation_vkFreeMemory(my_data->report_data, memory, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1800 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1801 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1802 | my_data->dispatch_table.FreeMemory(device, memory, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1803 | } |
| 1804 | } |
| 1805 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1806 | VKAPI_ATTR VkResult VKAPI_CALL MapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, |
| 1807 | VkMemoryMapFlags flags, void **ppData) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1808 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1809 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1810 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1811 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1812 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1813 | skip |= parameter_validation_vkMapMemory(my_data->report_data, memory, offset, size, flags, ppData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1814 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1815 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1816 | result = my_data->dispatch_table.MapMemory(device, memory, offset, size, flags, ppData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1817 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1818 | validate_result(my_data->report_data, "vkMapMemory", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1819 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1820 | |
| 1821 | return result; |
| 1822 | } |
| 1823 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1824 | VKAPI_ATTR void VKAPI_CALL UnmapMemory(VkDevice device, VkDeviceMemory memory) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1825 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1826 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1827 | assert(my_data != NULL); |
| 1828 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1829 | skip |= parameter_validation_vkUnmapMemory(my_data->report_data, memory); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1830 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1831 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1832 | my_data->dispatch_table.UnmapMemory(device, memory); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1833 | } |
| 1834 | } |
| 1835 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1836 | VKAPI_ATTR VkResult VKAPI_CALL FlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, |
| 1837 | const VkMappedMemoryRange *pMemoryRanges) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1838 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1839 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1840 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1841 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1842 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1843 | skip |= parameter_validation_vkFlushMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges); |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 1844 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1845 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1846 | result = my_data->dispatch_table.FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1847 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1848 | validate_result(my_data->report_data, "vkFlushMappedMemoryRanges", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1849 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1850 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1851 | return result; |
| 1852 | } |
| 1853 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1854 | VKAPI_ATTR VkResult VKAPI_CALL InvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, |
| 1855 | const VkMappedMemoryRange *pMemoryRanges) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1856 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1857 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1858 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1859 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1860 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1861 | skip |= parameter_validation_vkInvalidateMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges); |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1862 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1863 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1864 | result = my_data->dispatch_table.InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1865 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1866 | validate_result(my_data->report_data, "vkInvalidateMappedMemoryRanges", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1867 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1868 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 1869 | return result; |
| 1870 | } |
| 1871 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1872 | VKAPI_ATTR void VKAPI_CALL GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, |
| 1873 | VkDeviceSize *pCommittedMemoryInBytes) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1874 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1875 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1876 | assert(my_data != NULL); |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1877 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1878 | skip |= parameter_validation_vkGetDeviceMemoryCommitment(my_data->report_data, memory, pCommittedMemoryInBytes); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1879 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1880 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1881 | my_data->dispatch_table.GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1882 | } |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 1883 | } |
| 1884 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1885 | VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, |
| 1886 | VkDeviceSize memoryOffset) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1887 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1888 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1889 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1890 | assert(my_data != NULL); |
| 1891 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1892 | skip |= parameter_validation_vkBindBufferMemory(my_data->report_data, buffer, memory, memoryOffset); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1893 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1894 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1895 | result = my_data->dispatch_table.BindBufferMemory(device, buffer, memory, memoryOffset); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1896 | |
| 1897 | validate_result(my_data->report_data, "vkBindBufferMemory", result); |
| 1898 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1899 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1900 | return result; |
| 1901 | } |
| 1902 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1903 | VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1904 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1905 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1906 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1907 | assert(my_data != NULL); |
| 1908 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1909 | skip |= parameter_validation_vkBindImageMemory(my_data->report_data, image, memory, memoryOffset); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1910 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1911 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1912 | result = my_data->dispatch_table.BindImageMemory(device, image, memory, memoryOffset); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1913 | |
| 1914 | validate_result(my_data->report_data, "vkBindImageMemory", result); |
| 1915 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1916 | |
| 1917 | return result; |
| 1918 | } |
| 1919 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1920 | VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, |
| 1921 | VkMemoryRequirements *pMemoryRequirements) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1922 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1923 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1924 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1925 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1926 | skip |= parameter_validation_vkGetBufferMemoryRequirements(my_data->report_data, buffer, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1927 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1928 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1929 | my_data->dispatch_table.GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1930 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1931 | } |
| 1932 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1933 | VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1934 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1935 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1936 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1937 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1938 | skip |= parameter_validation_vkGetImageMemoryRequirements(my_data->report_data, image, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1939 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1940 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1941 | my_data->dispatch_table.GetImageMemoryRequirements(device, image, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1942 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1943 | } |
| 1944 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 1945 | static bool PostGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pNumRequirements, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1946 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1947 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1948 | if (pSparseMemoryRequirements != nullptr) { |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1949 | if ((pSparseMemoryRequirements->formatProperties.aspectMask & |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1950 | (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1951 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1952 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 1953 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1954 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect " |
| 1955 | "pSparseMemoryRequirements->formatProperties.aspectMask, is an unrecognized enumerator"); |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1956 | return false; |
| 1957 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1958 | } |
| 1959 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1960 | return true; |
| 1961 | } |
| 1962 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1963 | VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, |
| 1964 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1965 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1966 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1967 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1968 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1969 | skip |= parameter_validation_vkGetImageSparseMemoryRequirements(my_data->report_data, image, pSparseMemoryRequirementCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1970 | pSparseMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1971 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1972 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1973 | my_data->dispatch_table.GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, |
| 1974 | pSparseMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1975 | |
| 1976 | PostGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 1977 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1978 | } |
| 1979 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 1980 | static bool PostGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1981 | VkSampleCountFlagBits samples, VkImageUsageFlags usage, |
| 1982 | VkImageTiling tiling, uint32_t *pNumProperties, |
| 1983 | VkSparseImageFormatProperties *pProperties) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1984 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1985 | if (pProperties != nullptr) { |
| 1986 | if ((pProperties->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1987 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1988 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 1989 | LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1990 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspectMask, is an " |
| 1991 | "unrecognized enumerator"); |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 1992 | return false; |
| 1993 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1994 | } |
| 1995 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1996 | return true; |
| 1997 | } |
| 1998 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1999 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 2000 | VkImageType type, VkSampleCountFlagBits samples, |
| 2001 | VkImageUsageFlags usage, VkImageTiling tiling, |
| 2002 | uint32_t *pPropertyCount, |
| 2003 | VkSparseImageFormatProperties *pProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2004 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2005 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2006 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2007 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2008 | skip |= parameter_validation_vkGetPhysicalDeviceSparseImageFormatProperties(my_data->report_data, format, type, samples, usage, |
| 2009 | tiling, pPropertyCount, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2010 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2011 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 2012 | my_data->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, |
| 2013 | pPropertyCount, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2014 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2015 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, |
| 2016 | pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2017 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2018 | } |
| 2019 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2020 | VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, |
| 2021 | VkFence fence) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2022 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2023 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2024 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2025 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2026 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2027 | skip |= parameter_validation_vkQueueBindSparse(my_data->report_data, bindInfoCount, pBindInfo, fence); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2028 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2029 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2030 | result = my_data->dispatch_table.QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2031 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2032 | validate_result(my_data->report_data, "vkQueueBindSparse", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2033 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2034 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2035 | return result; |
| 2036 | } |
| 2037 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2038 | VKAPI_ATTR VkResult VKAPI_CALL CreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, |
| 2039 | const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2040 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2041 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2042 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2043 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2044 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2045 | skip |= parameter_validation_vkCreateFence(my_data->report_data, pCreateInfo, pAllocator, pFence); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2046 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2047 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2048 | result = my_data->dispatch_table.CreateFence(device, pCreateInfo, pAllocator, pFence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2049 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2050 | validate_result(my_data->report_data, "vkCreateFence", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2051 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2052 | |
| 2053 | return result; |
| 2054 | } |
| 2055 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2056 | VKAPI_ATTR void VKAPI_CALL DestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2057 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2058 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2059 | assert(my_data != NULL); |
| 2060 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2061 | skip |= parameter_validation_vkDestroyFence(my_data->report_data, fence, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2062 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2063 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2064 | my_data->dispatch_table.DestroyFence(device, fence, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2065 | } |
| 2066 | } |
| 2067 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2068 | VKAPI_ATTR VkResult VKAPI_CALL ResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2069 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2070 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2071 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2072 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2073 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2074 | skip |= parameter_validation_vkResetFences(my_data->report_data, fenceCount, pFences); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2075 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2076 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2077 | result = my_data->dispatch_table.ResetFences(device, fenceCount, pFences); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2078 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2079 | validate_result(my_data->report_data, "vkResetFences", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2080 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2081 | |
| 2082 | return result; |
| 2083 | } |
| 2084 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2085 | VKAPI_ATTR VkResult VKAPI_CALL GetFenceStatus(VkDevice device, VkFence fence) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2086 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2087 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2088 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2089 | assert(my_data != NULL); |
| 2090 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2091 | skip |= parameter_validation_vkGetFenceStatus(my_data->report_data, fence); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2092 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2093 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2094 | result = my_data->dispatch_table.GetFenceStatus(device, fence); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2095 | |
| 2096 | validate_result(my_data->report_data, "vkGetFenceStatus", result); |
| 2097 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2098 | |
| 2099 | return result; |
| 2100 | } |
| 2101 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2102 | VKAPI_ATTR VkResult VKAPI_CALL WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, |
| 2103 | uint64_t timeout) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2104 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2105 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2106 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2107 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2108 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2109 | skip |= parameter_validation_vkWaitForFences(my_data->report_data, fenceCount, pFences, waitAll, timeout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2110 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2111 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2112 | result = my_data->dispatch_table.WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2113 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2114 | validate_result(my_data->report_data, "vkWaitForFences", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2115 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2116 | |
| 2117 | return result; |
| 2118 | } |
| 2119 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2120 | VKAPI_ATTR VkResult VKAPI_CALL CreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2121 | const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2122 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2123 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2124 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2125 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2126 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2127 | skip |= parameter_validation_vkCreateSemaphore(my_data->report_data, pCreateInfo, pAllocator, pSemaphore); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2128 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2129 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2130 | result = my_data->dispatch_table.CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2131 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2132 | validate_result(my_data->report_data, "vkCreateSemaphore", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2133 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2134 | |
| 2135 | return result; |
| 2136 | } |
| 2137 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2138 | VKAPI_ATTR void VKAPI_CALL DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2139 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2140 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2141 | assert(my_data != NULL); |
| 2142 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2143 | skip |= parameter_validation_vkDestroySemaphore(my_data->report_data, semaphore, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2144 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2145 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2146 | my_data->dispatch_table.DestroySemaphore(device, semaphore, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2147 | } |
| 2148 | } |
| 2149 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2150 | VKAPI_ATTR VkResult VKAPI_CALL CreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, |
| 2151 | const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2152 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2153 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2154 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2155 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2156 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2157 | skip |= parameter_validation_vkCreateEvent(my_data->report_data, pCreateInfo, pAllocator, pEvent); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2158 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2159 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2160 | result = my_data->dispatch_table.CreateEvent(device, pCreateInfo, pAllocator, pEvent); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2161 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2162 | validate_result(my_data->report_data, "vkCreateEvent", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2163 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2164 | |
| 2165 | return result; |
| 2166 | } |
| 2167 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2168 | VKAPI_ATTR void VKAPI_CALL DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2169 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2170 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2171 | assert(my_data != NULL); |
| 2172 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2173 | skip |= parameter_validation_vkDestroyEvent(my_data->report_data, event, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2174 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2175 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2176 | my_data->dispatch_table.DestroyEvent(device, event, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2177 | } |
| 2178 | } |
| 2179 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2180 | VKAPI_ATTR VkResult VKAPI_CALL GetEventStatus(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2181 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2182 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2183 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2184 | assert(my_data != NULL); |
| 2185 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2186 | skip |= parameter_validation_vkGetEventStatus(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2187 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2188 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2189 | result = my_data->dispatch_table.GetEventStatus(device, event); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2190 | |
| 2191 | validate_result(my_data->report_data, "vkGetEventStatus", result); |
| 2192 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2193 | |
| 2194 | return result; |
| 2195 | } |
| 2196 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2197 | VKAPI_ATTR VkResult VKAPI_CALL SetEvent(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2198 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2199 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2200 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2201 | assert(my_data != NULL); |
| 2202 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2203 | skip |= parameter_validation_vkSetEvent(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2204 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2205 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2206 | result = my_data->dispatch_table.SetEvent(device, event); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2207 | |
| 2208 | validate_result(my_data->report_data, "vkSetEvent", result); |
| 2209 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2210 | |
| 2211 | return result; |
| 2212 | } |
| 2213 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2214 | VKAPI_ATTR VkResult VKAPI_CALL ResetEvent(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2215 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2216 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2217 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2218 | assert(my_data != NULL); |
| 2219 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2220 | skip |= parameter_validation_vkResetEvent(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2221 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2222 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2223 | result = my_data->dispatch_table.ResetEvent(device, event); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2224 | |
| 2225 | validate_result(my_data->report_data, "vkResetEvent", result); |
| 2226 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2227 | |
| 2228 | return result; |
| 2229 | } |
| 2230 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2231 | VKAPI_ATTR VkResult VKAPI_CALL CreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2232 | const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2233 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2234 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2235 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2236 | assert(device_data != nullptr); |
| 2237 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2238 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2239 | skip |= parameter_validation_vkCreateQueryPool(device_data->report_data, pCreateInfo, pAllocator, pQueryPool); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2240 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2241 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 2242 | if (pCreateInfo != nullptr) { |
| 2243 | // If queryType is VK_QUERY_TYPE_PIPELINE_STATISTICS, pipelineStatistics must be a valid combination of |
| 2244 | // VkQueryPipelineStatisticFlagBits values |
| 2245 | if ((pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS) && (pCreateInfo->pipelineStatistics != 0) && |
| 2246 | ((pCreateInfo->pipelineStatistics & (~AllVkQueryPipelineStatisticFlagBits)) != 0)) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2247 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2248 | VALIDATION_ERROR_01007, LayerName, |
| 2249 | "vkCreateQueryPool(): if pCreateInfo->queryType is " |
| 2250 | "VK_QUERY_TYPE_PIPELINE_STATISTICS, pCreateInfo->pipelineStatistics must be " |
| 2251 | "a valid combination of VkQueryPipelineStatisticFlagBits values. %s", |
| 2252 | validation_error_map[VALIDATION_ERROR_01007]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2253 | } |
| 2254 | } |
| 2255 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2256 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2257 | result = device_data->dispatch_table.CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2258 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2259 | validate_result(report_data, "vkCreateQueryPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2260 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2261 | |
| 2262 | return result; |
| 2263 | } |
| 2264 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2265 | VKAPI_ATTR void VKAPI_CALL DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2266 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2267 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2268 | assert(my_data != NULL); |
| 2269 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2270 | skip |= parameter_validation_vkDestroyQueryPool(my_data->report_data, queryPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2271 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2272 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2273 | my_data->dispatch_table.DestroyQueryPool(device, queryPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2274 | } |
| 2275 | } |
| 2276 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2277 | VKAPI_ATTR VkResult VKAPI_CALL GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, |
| 2278 | size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2279 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2280 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2281 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2282 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2283 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2284 | skip |= parameter_validation_vkGetQueryPoolResults(my_data->report_data, queryPool, firstQuery, queryCount, dataSize, pData, |
| 2285 | stride, flags); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2286 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2287 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2288 | result = |
| 2289 | my_data->dispatch_table.GetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2290 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2291 | validate_result(my_data->report_data, "vkGetQueryPoolResults", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2292 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2293 | |
| 2294 | return result; |
| 2295 | } |
| 2296 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2297 | VKAPI_ATTR VkResult VKAPI_CALL CreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, |
| 2298 | const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2299 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2300 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2301 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2302 | assert(device_data != nullptr); |
| 2303 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2304 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2305 | skip |= parameter_validation_vkCreateBuffer(report_data, pCreateInfo, pAllocator, pBuffer); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2306 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2307 | if (pCreateInfo != nullptr) { |
Maciej Jesionowski | 420b1c3 | 2016-12-14 11:01:21 +0100 | [diff] [blame] | 2308 | // Buffer size must be greater than 0 (error 00663) |
| 2309 | skip |= |
| 2310 | ValidateGreaterThan(report_data, "vkCreateBuffer", "pCreateInfo->size", static_cast<uint32_t>(pCreateInfo->size), 0u); |
| 2311 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2312 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 2313 | if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { |
| 2314 | // If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1 |
| 2315 | if (pCreateInfo->queueFamilyIndexCount <= 1) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2316 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2317 | VALIDATION_ERROR_00665, LayerName, |
| 2318 | "vkCreateBuffer: if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " |
| 2319 | "pCreateInfo->queueFamilyIndexCount must be greater than 1. %s", |
| 2320 | validation_error_map[VALIDATION_ERROR_00665]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2321 | } |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2322 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2323 | // If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a pointer to an array of |
| 2324 | // queueFamilyIndexCount uint32_t values |
| 2325 | if (pCreateInfo->pQueueFamilyIndices == nullptr) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2326 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2327 | VALIDATION_ERROR_00664, LayerName, |
| 2328 | "vkCreateBuffer: if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " |
| 2329 | "pCreateInfo->pQueueFamilyIndices must be a pointer to an array of " |
| 2330 | "pCreateInfo->queueFamilyIndexCount uint32_t values. %s", |
| 2331 | validation_error_map[VALIDATION_ERROR_00664]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2332 | } |
| 2333 | |
| 2334 | // Ensure that the queue family indices were specified at device creation |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2335 | skip |= validate_queue_family_indices(device_data, "vkCreateBuffer", "pCreateInfo->pQueueFamilyIndices", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2336 | pCreateInfo->queueFamilyIndexCount, pCreateInfo->pQueueFamilyIndices); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2337 | } |
Maciej Jesionowski | 420b1c3 | 2016-12-14 11:01:21 +0100 | [diff] [blame] | 2338 | |
| 2339 | // If flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain |
| 2340 | // VK_BUFFER_CREATE_SPARSE_BINDING_BIT |
| 2341 | if (((pCreateInfo->flags & (VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT)) != 0) && |
| 2342 | ((pCreateInfo->flags & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) != VK_BUFFER_CREATE_SPARSE_BINDING_BIT)) { |
Mark Lobodzinski | 181ec3a | 2016-12-14 13:37:04 -0700 | [diff] [blame] | 2343 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2344 | VALIDATION_ERROR_00669, LayerName, |
| 2345 | "vkCreateBuffer: if pCreateInfo->flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or " |
| 2346 | "VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT. %s", |
| 2347 | validation_error_map[VALIDATION_ERROR_00669]); |
Maciej Jesionowski | 420b1c3 | 2016-12-14 11:01:21 +0100 | [diff] [blame] | 2348 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2349 | } |
| 2350 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2351 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2352 | result = device_data->dispatch_table.CreateBuffer(device, pCreateInfo, pAllocator, pBuffer); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2353 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2354 | validate_result(report_data, "vkCreateBuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2355 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2356 | |
| 2357 | return result; |
| 2358 | } |
| 2359 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2360 | VKAPI_ATTR void VKAPI_CALL DestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2361 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2362 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2363 | assert(my_data != NULL); |
| 2364 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2365 | skip |= parameter_validation_vkDestroyBuffer(my_data->report_data, buffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2366 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2367 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2368 | my_data->dispatch_table.DestroyBuffer(device, buffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2369 | } |
| 2370 | } |
| 2371 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2372 | VKAPI_ATTR VkResult VKAPI_CALL CreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, |
| 2373 | const VkAllocationCallbacks *pAllocator, VkBufferView *pView) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2374 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2375 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2376 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2377 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2378 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2379 | skip |= parameter_validation_vkCreateBufferView(my_data->report_data, pCreateInfo, pAllocator, pView); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2380 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2381 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2382 | result = my_data->dispatch_table.CreateBufferView(device, pCreateInfo, pAllocator, pView); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2383 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2384 | validate_result(my_data->report_data, "vkCreateBufferView", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2385 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2386 | |
| 2387 | return result; |
| 2388 | } |
| 2389 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2390 | VKAPI_ATTR void VKAPI_CALL DestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2391 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2392 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2393 | assert(my_data != NULL); |
| 2394 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2395 | skip |= parameter_validation_vkDestroyBufferView(my_data->report_data, bufferView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2396 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2397 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2398 | my_data->dispatch_table.DestroyBufferView(device, bufferView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2399 | } |
| 2400 | } |
| 2401 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2402 | VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, |
| 2403 | const VkAllocationCallbacks *pAllocator, VkImage *pImage) { |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2404 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2405 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2406 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2407 | assert(device_data != nullptr); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2408 | debug_report_data *report_data = device_data->report_data; |
| 2409 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2410 | skip |= parameter_validation_vkCreateImage(report_data, pCreateInfo, pAllocator, pImage); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2411 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2412 | if (pCreateInfo != nullptr) { |
Mark Lobodzinski | 7d9ef88 | 2017-03-01 16:15:02 -0700 | [diff] [blame] | 2413 | |
| 2414 | if ((device_data->physical_device_features.textureCompressionETC2 == false) && |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 2415 | FormatIsCompressed_ETC2_EAC(pCreateInfo->format)) { |
Mark Lobodzinski | 7d9ef88 | 2017-03-01 16:15:02 -0700 | [diff] [blame] | 2416 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2417 | DEVICE_FEATURE, LayerName, |
| 2418 | "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionETC2 feature is " |
| 2419 | "not enabled: neither ETC2 nor EAC formats can be used to create images.", |
| 2420 | string_VkFormat(pCreateInfo->format)); |
| 2421 | } |
| 2422 | |
Mark Lobodzinski | 846c214 | 2017-03-01 16:17:39 -0700 | [diff] [blame] | 2423 | if ((device_data->physical_device_features.textureCompressionASTC_LDR == false) && |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 2424 | FormatIsCompressed_ASTC_LDR(pCreateInfo->format)) { |
Mark Lobodzinski | 846c214 | 2017-03-01 16:17:39 -0700 | [diff] [blame] | 2425 | skip |= |
| 2426 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2427 | DEVICE_FEATURE, LayerName, |
| 2428 | "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionASTC_LDR feature is " |
| 2429 | "not enabled: ASTC formats cannot be used to create images.", |
| 2430 | string_VkFormat(pCreateInfo->format)); |
| 2431 | } |
| 2432 | |
Mark Lobodzinski | 64f374e | 2017-03-01 16:19:36 -0700 | [diff] [blame] | 2433 | if ((device_data->physical_device_features.textureCompressionBC == false) && |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 2434 | FormatIsCompressed_BC(pCreateInfo->format)) { |
Mark Lobodzinski | 64f374e | 2017-03-01 16:19:36 -0700 | [diff] [blame] | 2435 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2436 | DEVICE_FEATURE, LayerName, |
| 2437 | "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionBC feature is " |
| 2438 | "not enabled: BC compressed formats cannot be used to create images.", |
| 2439 | string_VkFormat(pCreateInfo->format)); |
| 2440 | } |
| 2441 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2442 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2443 | if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2444 | // If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1 |
| 2445 | if (pCreateInfo->queueFamilyIndexCount <= 1) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2446 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2447 | VALIDATION_ERROR_00714, LayerName, |
| 2448 | "vkCreateImage(): if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " |
| 2449 | "pCreateInfo->queueFamilyIndexCount must be greater than 1. %s", |
| 2450 | validation_error_map[VALIDATION_ERROR_00714]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2451 | } |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2452 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2453 | // If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a pointer to an array of |
| 2454 | // queueFamilyIndexCount uint32_t values |
| 2455 | if (pCreateInfo->pQueueFamilyIndices == nullptr) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2456 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2457 | VALIDATION_ERROR_00713, LayerName, |
| 2458 | "vkCreateImage(): if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " |
| 2459 | "pCreateInfo->pQueueFamilyIndices must be a pointer to an array of " |
| 2460 | "pCreateInfo->queueFamilyIndexCount uint32_t values. %s", |
| 2461 | validation_error_map[VALIDATION_ERROR_00713]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2462 | } |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2463 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2464 | skip |= validate_queue_family_indices(device_data, "vkCreateImage", "pCreateInfo->pQueueFamilyIndices", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2465 | pCreateInfo->queueFamilyIndexCount, pCreateInfo->pQueueFamilyIndices); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2466 | } |
| 2467 | |
| 2468 | // width, height, and depth members of extent must be greater than 0 |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2469 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.width", pCreateInfo->extent.width, 0u); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2470 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.height", pCreateInfo->extent.height, 0u); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2471 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.depth", pCreateInfo->extent.depth, 0u); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2472 | |
| 2473 | // mipLevels must be greater than 0 |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2474 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->mipLevels", pCreateInfo->mipLevels, 0u); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2475 | |
| 2476 | // arrayLayers must be greater than 0 |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2477 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->arrayLayers", pCreateInfo->arrayLayers, 0u); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2478 | |
| 2479 | // If imageType is VK_IMAGE_TYPE_1D, both extent.height and extent.depth must be 1 |
| 2480 | if ((pCreateInfo->imageType == VK_IMAGE_TYPE_1D) && (pCreateInfo->extent.height != 1) && (pCreateInfo->extent.depth != 1)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2481 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 2482 | VALIDATION_ERROR_02129, LayerName, |
| 2483 | "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_1D, both " |
| 2484 | "pCreateInfo->extent.height and pCreateInfo->extent.depth must be 1. %s", |
| 2485 | validation_error_map[VALIDATION_ERROR_02129]); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2486 | } |
| 2487 | |
| 2488 | if (pCreateInfo->imageType == VK_IMAGE_TYPE_2D) { |
| 2489 | // If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and |
| 2490 | // extent.height must be equal |
| 2491 | if ((pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) && |
| 2492 | (pCreateInfo->extent.width != pCreateInfo->extent.height)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2493 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2494 | VALIDATION_ERROR_02127, LayerName, |
| 2495 | "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D and " |
| 2496 | "pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, " |
| 2497 | "pCreateInfo->extent.width and pCreateInfo->extent.height must be equal. %s", |
| 2498 | validation_error_map[VALIDATION_ERROR_02127]); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2499 | } |
| 2500 | |
| 2501 | if (pCreateInfo->extent.depth != 1) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2502 | skip |= log_msg( |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2503 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2504 | VALIDATION_ERROR_02130, LayerName, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2505 | "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D, pCreateInfo->extent.depth must be 1. %s", |
| 2506 | validation_error_map[VALIDATION_ERROR_02130]); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2507 | } |
| 2508 | } |
| 2509 | |
| 2510 | // mipLevels must be less than or equal to floor(log2(max(extent.width,extent.height,extent.depth)))+1 |
| 2511 | uint32_t maxDim = std::max(std::max(pCreateInfo->extent.width, pCreateInfo->extent.height), pCreateInfo->extent.depth); |
| 2512 | if (pCreateInfo->mipLevels > (floor(log2(maxDim)) + 1)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2513 | skip |= |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2514 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2515 | VALIDATION_ERROR_02131, LayerName, |
Mike Weiblen | fa0fd07 | 2017-01-06 16:20:51 -0700 | [diff] [blame] | 2516 | "vkCreateImage(): pCreateInfo->mipLevels must be less than or equal to " |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2517 | "floor(log2(max(pCreateInfo->extent.width, pCreateInfo->extent.height, pCreateInfo->extent.depth)))+1. %s", |
| 2518 | validation_error_map[VALIDATION_ERROR_02131]); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2519 | } |
| 2520 | |
| 2521 | // If flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain |
| 2522 | // VK_IMAGE_CREATE_SPARSE_BINDING_BIT |
| 2523 | if (((pCreateInfo->flags & (VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT)) != 0) && |
| 2524 | ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) != VK_IMAGE_CREATE_SPARSE_BINDING_BIT)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2525 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 181ec3a | 2016-12-14 13:37:04 -0700 | [diff] [blame] | 2526 | VALIDATION_ERROR_02160, LayerName, |
| 2527 | "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or " |
| 2528 | "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT. %s", |
| 2529 | validation_error_map[VALIDATION_ERROR_02160]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2530 | } |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2531 | |
| 2532 | // Check for combinations of attributes that are incompatible with having VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT set |
| 2533 | if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) != 0) { |
| 2534 | // Linear tiling is unsupported |
| 2535 | if (VK_IMAGE_TILING_LINEAR == pCreateInfo->tiling) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2536 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 2537 | INVALID_USAGE, LayerName, |
| 2538 | "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT " |
| 2539 | "then image tiling of VK_IMAGE_TILING_LINEAR is not supported"); |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2540 | } |
| 2541 | |
| 2542 | // Sparse 1D image isn't valid |
| 2543 | if (VK_IMAGE_TYPE_1D == pCreateInfo->imageType) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2544 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 2545 | VALIDATION_ERROR_02352, LayerName, |
| 2546 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 1D image. %s", |
| 2547 | validation_error_map[VALIDATION_ERROR_02352]); |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2548 | } |
| 2549 | |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2550 | // Sparse 2D image when device doesn't support it |
| 2551 | if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage2D) && |
| 2552 | (VK_IMAGE_TYPE_2D == pCreateInfo->imageType)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2553 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2554 | VALIDATION_ERROR_02144, LayerName, |
| 2555 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2D image if corresponding " |
| 2556 | "feature is not enabled on the device. %s", |
| 2557 | validation_error_map[VALIDATION_ERROR_02144]); |
| 2558 | } |
| 2559 | |
| 2560 | // Sparse 3D image when device doesn't support it |
| 2561 | if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage3D) && |
| 2562 | (VK_IMAGE_TYPE_3D == pCreateInfo->imageType)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2563 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2564 | VALIDATION_ERROR_02145, LayerName, |
| 2565 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 3D image if corresponding " |
| 2566 | "feature is not enabled on the device. %s", |
| 2567 | validation_error_map[VALIDATION_ERROR_02145]); |
| 2568 | } |
| 2569 | |
| 2570 | // Multi-sample 2D image when device doesn't support it |
| 2571 | if (VK_IMAGE_TYPE_2D == pCreateInfo->imageType) { |
| 2572 | if ((VK_FALSE == device_data->physical_device_features.sparseResidency2Samples) && |
| 2573 | (VK_SAMPLE_COUNT_2_BIT == pCreateInfo->samples)) { |
| 2574 | skip |= log_msg( |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2575 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2576 | VALIDATION_ERROR_02146, LayerName, |
| 2577 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2-sample image if corresponding " |
| 2578 | "feature is not enabled on the device. %s", |
| 2579 | validation_error_map[VALIDATION_ERROR_02146]); |
| 2580 | } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency4Samples) && |
| 2581 | (VK_SAMPLE_COUNT_4_BIT == pCreateInfo->samples)) { |
| 2582 | skip |= log_msg( |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2583 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2584 | VALIDATION_ERROR_02147, LayerName, |
| 2585 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 4-sample image if corresponding " |
| 2586 | "feature is not enabled on the device. %s", |
| 2587 | validation_error_map[VALIDATION_ERROR_02147]); |
| 2588 | } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency8Samples) && |
| 2589 | (VK_SAMPLE_COUNT_8_BIT == pCreateInfo->samples)) { |
| 2590 | skip |= log_msg( |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2591 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2592 | VALIDATION_ERROR_02148, LayerName, |
| 2593 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 8-sample image if corresponding " |
| 2594 | "feature is not enabled on the device. %s", |
| 2595 | validation_error_map[VALIDATION_ERROR_02148]); |
| 2596 | } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency16Samples) && |
| 2597 | (VK_SAMPLE_COUNT_16_BIT == pCreateInfo->samples)) { |
| 2598 | skip |= log_msg( |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2599 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2600 | VALIDATION_ERROR_02149, LayerName, |
| 2601 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 16-sample image if corresponding " |
| 2602 | "feature is not enabled on the device. %s", |
| 2603 | validation_error_map[VALIDATION_ERROR_02149]); |
| 2604 | } |
| 2605 | } |
| 2606 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2607 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2608 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2609 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2610 | result = device_data->dispatch_table.CreateImage(device, pCreateInfo, pAllocator, pImage); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2611 | |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2612 | validate_result(report_data, "vkCreateImage", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2613 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2614 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2615 | return result; |
| 2616 | } |
| 2617 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2618 | VKAPI_ATTR void VKAPI_CALL DestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2619 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2620 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2621 | assert(my_data != NULL); |
| 2622 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2623 | skip |= parameter_validation_vkDestroyImage(my_data->report_data, image, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2624 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2625 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2626 | my_data->dispatch_table.DestroyImage(device, image, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2627 | } |
| 2628 | } |
| 2629 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 2630 | static bool PreGetImageSubresourceLayout(VkDevice device, const VkImageSubresource *pSubresource) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2631 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2632 | if (pSubresource != nullptr) { |
| 2633 | if ((pSubresource->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 2634 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 2635 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 2636 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2637 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspectMask, is an unrecognized enumerator"); |
| 2638 | return false; |
| 2639 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2640 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2641 | |
| 2642 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2643 | } |
| 2644 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2645 | VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, |
| 2646 | VkSubresourceLayout *pLayout) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2647 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2648 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2649 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2650 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2651 | skip |= parameter_validation_vkGetImageSubresourceLayout(my_data->report_data, image, pSubresource, pLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2652 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2653 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2654 | PreGetImageSubresourceLayout(device, pSubresource); |
| 2655 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2656 | my_data->dispatch_table.GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2657 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2658 | } |
| 2659 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2660 | VKAPI_ATTR VkResult VKAPI_CALL CreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, |
| 2661 | const VkAllocationCallbacks *pAllocator, VkImageView *pView) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2662 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2663 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2664 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2665 | assert(my_data != NULL); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2666 | debug_report_data *report_data = my_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2667 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2668 | skip |= parameter_validation_vkCreateImageView(report_data, pCreateInfo, pAllocator, pView); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2669 | |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2670 | if (pCreateInfo != nullptr) { |
| 2671 | if ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D) || (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D)) { |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2672 | if ((pCreateInfo->subresourceRange.layerCount != 1) && |
| 2673 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2674 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 2675 | LayerName, |
| 2676 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD, " |
| 2677 | "pCreateInfo->subresourceRange.layerCount must be 1", |
| 2678 | ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D) ? 1 : 2)); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2679 | } |
| 2680 | } else if ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D_ARRAY) || |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2681 | (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D_ARRAY)) { |
| 2682 | if ((pCreateInfo->subresourceRange.layerCount < 1) && |
| 2683 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2684 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 2685 | LayerName, |
| 2686 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD_ARRAY, " |
| 2687 | "pCreateInfo->subresourceRange.layerCount must be >= 1", |
| 2688 | ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D_ARRAY) ? 1 : 2)); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2689 | } |
| 2690 | } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE) { |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2691 | if ((pCreateInfo->subresourceRange.layerCount != 6) && |
| 2692 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2693 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 2694 | LayerName, |
| 2695 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE, " |
| 2696 | "pCreateInfo->subresourceRange.layerCount must be 6"); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2697 | } |
| 2698 | } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) { |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2699 | if (((pCreateInfo->subresourceRange.layerCount == 0) || ((pCreateInfo->subresourceRange.layerCount % 6) != 0)) && |
| 2700 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2701 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 2702 | LayerName, |
| 2703 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE_ARRAY, " |
| 2704 | "pCreateInfo->subresourceRange.layerCount must be a multiple of 6"); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2705 | } |
Mark Lobodzinski | 3d7e6b5 | 2017-02-28 13:45:20 -0700 | [diff] [blame] | 2706 | if (!my_data->physical_device_features.imageCubeArray) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2707 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
Mark Lobodzinski | 3d7e6b5 | 2017-02-28 13:45:20 -0700 | [diff] [blame] | 2708 | LayerName, "vkCreateImageView: Device feature imageCubeArray not enabled."); |
| 2709 | } |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2710 | } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_3D) { |
| 2711 | if (pCreateInfo->subresourceRange.baseArrayLayer != 0) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2712 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 2713 | LayerName, |
| 2714 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " |
| 2715 | "pCreateInfo->subresourceRange.baseArrayLayer must be 0"); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2716 | } |
| 2717 | |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2718 | if ((pCreateInfo->subresourceRange.layerCount != 1) && |
| 2719 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2720 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, 1, |
| 2721 | LayerName, |
| 2722 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " |
| 2723 | "pCreateInfo->subresourceRange.layerCount must be 1"); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2724 | } |
| 2725 | } |
| 2726 | } |
| 2727 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2728 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2729 | result = my_data->dispatch_table.CreateImageView(device, pCreateInfo, pAllocator, pView); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2730 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2731 | validate_result(my_data->report_data, "vkCreateImageView", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2732 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2733 | |
| 2734 | return result; |
| 2735 | } |
| 2736 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2737 | VKAPI_ATTR void VKAPI_CALL DestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2738 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2739 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2740 | assert(my_data != NULL); |
| 2741 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2742 | skip |= parameter_validation_vkDestroyImageView(my_data->report_data, imageView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2743 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2744 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2745 | my_data->dispatch_table.DestroyImageView(device, imageView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2746 | } |
| 2747 | } |
| 2748 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2749 | VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2750 | const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2751 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2752 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2753 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2754 | assert(my_data != NULL); |
| 2755 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2756 | skip |= parameter_validation_vkCreateShaderModule(my_data->report_data, pCreateInfo, pAllocator, pShaderModule); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2757 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2758 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2759 | result = my_data->dispatch_table.CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2760 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2761 | validate_result(my_data->report_data, "vkCreateShaderModule", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2762 | } |
| 2763 | |
Michael Lentine | 03d8e57 | 2015-09-15 14:59:14 -0500 | [diff] [blame] | 2764 | return result; |
| 2765 | } |
| 2766 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2767 | VKAPI_ATTR void VKAPI_CALL DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, |
| 2768 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2769 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2770 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2771 | assert(my_data != NULL); |
| 2772 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2773 | skip |= parameter_validation_vkDestroyShaderModule(my_data->report_data, shaderModule, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2774 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2775 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2776 | my_data->dispatch_table.DestroyShaderModule(device, shaderModule, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2777 | } |
| 2778 | } |
| 2779 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2780 | VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2781 | const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2782 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2783 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2784 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2785 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2786 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2787 | skip |= parameter_validation_vkCreatePipelineCache(my_data->report_data, pCreateInfo, pAllocator, pPipelineCache); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2788 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2789 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2790 | result = my_data->dispatch_table.CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2791 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2792 | validate_result(my_data->report_data, "vkCreatePipelineCache", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2793 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2794 | |
| 2795 | return result; |
| 2796 | } |
| 2797 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2798 | VKAPI_ATTR void VKAPI_CALL DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, |
| 2799 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2800 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2801 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2802 | assert(my_data != NULL); |
| 2803 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2804 | skip |= parameter_validation_vkDestroyPipelineCache(my_data->report_data, pipelineCache, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2805 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2806 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2807 | my_data->dispatch_table.DestroyPipelineCache(device, pipelineCache, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2808 | } |
| 2809 | } |
| 2810 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2811 | VKAPI_ATTR VkResult VKAPI_CALL GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, |
| 2812 | void *pData) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2813 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2814 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2815 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2816 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2817 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2818 | skip |= parameter_validation_vkGetPipelineCacheData(my_data->report_data, pipelineCache, pDataSize, pData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2819 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2820 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2821 | result = my_data->dispatch_table.GetPipelineCacheData(device, pipelineCache, pDataSize, pData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2822 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2823 | validate_result(my_data->report_data, "vkGetPipelineCacheData", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2824 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2825 | |
| 2826 | return result; |
| 2827 | } |
| 2828 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2829 | VKAPI_ATTR VkResult VKAPI_CALL MergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, |
| 2830 | const VkPipelineCache *pSrcCaches) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2831 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2832 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2833 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2834 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2835 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2836 | skip |= parameter_validation_vkMergePipelineCaches(my_data->report_data, dstCache, srcCacheCount, pSrcCaches); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2837 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2838 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2839 | result = my_data->dispatch_table.MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2840 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2841 | validate_result(my_data->report_data, "vkMergePipelineCaches", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2842 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2843 | |
| 2844 | return result; |
| 2845 | } |
| 2846 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 2847 | static bool PreCreateGraphicsPipelines(VkDevice device, const VkGraphicsPipelineCreateInfo *pCreateInfos) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2848 | layer_data *data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2849 | bool skip = false; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 2850 | |
| 2851 | // TODO: Handle count |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2852 | if (pCreateInfos != nullptr) { |
Maks Naumov | 34f52a1 | 2016-12-28 01:15:17 +0200 | [diff] [blame] | 2853 | if (pCreateInfos->flags & VK_PIPELINE_CREATE_DERIVATIVE_BIT) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2854 | if (pCreateInfos->basePipelineIndex != -1) { |
| 2855 | if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2856 | skip |= log_msg( |
| 2857 | data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2858 | VALIDATION_ERROR_00526, LayerName, |
| 2859 | "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineHandle, must be VK_NULL_HANDLE if " |
| 2860 | "pCreateInfos->flags " |
| 2861 | "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineIndex is not -1. %s", |
| 2862 | validation_error_map[VALIDATION_ERROR_00526]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2863 | } |
| 2864 | } |
| 2865 | |
| 2866 | if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { |
| 2867 | if (pCreateInfos->basePipelineIndex != -1) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2868 | skip |= log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 2869 | data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 2870 | VALIDATION_ERROR_00528, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2871 | "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineIndex, must be -1 if pCreateInfos->flags " |
| 2872 | "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineHandle is not " |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 2873 | "VK_NULL_HANDLE. %s", |
| 2874 | validation_error_map[VALIDATION_ERROR_00528]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2875 | } |
Jeremy Hayes | 2fdaaf2 | 2016-03-01 17:51:54 -0700 | [diff] [blame] | 2876 | } |
| 2877 | } |
| 2878 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2879 | if (pCreateInfos->pRasterizationState != nullptr) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2880 | if (pCreateInfos->pRasterizationState->cullMode & ~VK_CULL_MODE_FRONT_AND_BACK) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2881 | skip |= |
| 2882 | log_msg(data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2883 | UNRECOGNIZED_VALUE, LayerName, |
| 2884 | "vkCreateGraphicsPipelines parameter, VkCullMode pCreateInfos->pRasterizationState->cullMode, is an " |
| 2885 | "unrecognized enumerator"); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2886 | } |
Mark Lobodzinski | 2e67fdb | 2016-08-09 13:10:51 -0600 | [diff] [blame] | 2887 | |
| 2888 | if ((pCreateInfos->pRasterizationState->polygonMode != VK_POLYGON_MODE_FILL) && |
| 2889 | (data->physical_device_features.fillModeNonSolid == false)) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2890 | skip |= log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 2891 | data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 2e67fdb | 2016-08-09 13:10:51 -0600 | [diff] [blame] | 2892 | DEVICE_FEATURE, LayerName, |
| 2893 | "vkCreateGraphicsPipelines parameter, VkPolygonMode pCreateInfos->pRasterizationState->polygonMode cannot be " |
| 2894 | "VK_POLYGON_MODE_POINT or VK_POLYGON_MODE_LINE if VkPhysicalDeviceFeatures->fillModeNonSolid is false."); |
Mark Lobodzinski | 2e67fdb | 2016-08-09 13:10:51 -0600 | [diff] [blame] | 2895 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2896 | } |
Jeremy Hayes | 2fdaaf2 | 2016-03-01 17:51:54 -0700 | [diff] [blame] | 2897 | |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 2898 | size_t i = 0; |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 2899 | for (size_t j = 0; j < pCreateInfos[i].stageCount; j++) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2900 | skip |= validate_string(data->report_data, "vkCreateGraphicsPipelines", |
| 2901 | ParameterName("pCreateInfos[%i].pStages[%i].pName", ParameterName::IndexVector{i, j}), |
| 2902 | pCreateInfos[i].pStages[j].pName); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2903 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2904 | } |
| 2905 | |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2906 | return skip; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2907 | } |
| 2908 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2909 | VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 2910 | const VkGraphicsPipelineCreateInfo *pCreateInfos, |
| 2911 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2912 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2913 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2914 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2915 | assert(device_data != nullptr); |
| 2916 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2917 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2918 | skip |= parameter_validation_vkCreateGraphicsPipelines(report_data, pipelineCache, createInfoCount, pCreateInfos, pAllocator, |
| 2919 | pPipelines); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2920 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2921 | if (pCreateInfos != nullptr) { |
| 2922 | for (uint32_t i = 0; i < createInfoCount; ++i) { |
| 2923 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 2924 | if (pCreateInfos[i].pTessellationState == nullptr) { |
| 2925 | if (pCreateInfos[i].pStages != nullptr) { |
| 2926 | // If pStages includes a tessellation control shader stage and a tessellation evaluation shader stage, |
| 2927 | // pTessellationState must not be NULL |
| 2928 | bool has_control = false; |
| 2929 | bool has_eval = false; |
| 2930 | |
| 2931 | for (uint32_t stage_index = 0; stage_index < pCreateInfos[i].stageCount; ++stage_index) { |
| 2932 | if (pCreateInfos[i].pStages[stage_index].stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) { |
| 2933 | has_control = true; |
| 2934 | } else if (pCreateInfos[i].pStages[stage_index].stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) { |
| 2935 | has_eval = true; |
| 2936 | } |
| 2937 | } |
| 2938 | |
| 2939 | if (has_control && has_eval) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2940 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 2941 | __LINE__, VALIDATION_ERROR_00536, LayerName, |
| 2942 | "vkCreateGraphicsPipelines: if pCreateInfos[%d].pStages includes a tessellation " |
| 2943 | "control shader stage and a tessellation evaluation shader stage, " |
| 2944 | "pCreateInfos[%d].pTessellationState must not be NULL. %s", |
| 2945 | i, i, validation_error_map[VALIDATION_ERROR_00536]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2946 | } |
| 2947 | } |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 2948 | } else { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2949 | skip |= validate_struct_pnext( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 2950 | report_data, "vkCreateGraphicsPipelines", |
| 2951 | ParameterName("pCreateInfos[%i].pTessellationState->pNext", ParameterName::IndexVector{i}), NULL, |
| 2952 | pCreateInfos[i].pTessellationState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 2953 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2954 | skip |= validate_reserved_flags( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 2955 | report_data, "vkCreateGraphicsPipelines", |
| 2956 | ParameterName("pCreateInfos[%i].pTessellationState->flags", ParameterName::IndexVector{i}), |
| 2957 | pCreateInfos[i].pTessellationState->flags); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 2958 | |
| 2959 | if (pCreateInfos[i].pTessellationState->sType != VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2960 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 2961 | __LINE__, VALIDATION_ERROR_00538, LayerName, |
| 2962 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pTessellationState->sType must be " |
| 2963 | "VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO. %s", |
| 2964 | i, validation_error_map[VALIDATION_ERROR_00538]); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 2965 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2966 | } |
| 2967 | |
| 2968 | if (pCreateInfos[i].pViewportState == nullptr) { |
| 2969 | // If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pViewportState must be a pointer to a |
| 2970 | // valid VkPipelineViewportStateCreateInfo structure |
| 2971 | if ((pCreateInfos[i].pRasterizationState != nullptr) && |
| 2972 | (pCreateInfos[i].pRasterizationState->rasterizerDiscardEnable == VK_FALSE)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2973 | skip |= log_msg( |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2974 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 2975 | VALIDATION_ERROR_02113, LayerName, |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2976 | "vkCreateGraphicsPipelines: if pCreateInfos[%d].pRasterizationState->rasterizerDiscardEnable is VK_FALSE, " |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 2977 | "pCreateInfos[%d].pViewportState must be a pointer to a valid VkPipelineViewportStateCreateInfo structure. " |
| 2978 | "%s", |
| 2979 | i, i, validation_error_map[VALIDATION_ERROR_02113]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2980 | } |
| 2981 | } else { |
Mark Lobodzinski | b81000e | 2016-12-16 13:08:00 -0700 | [diff] [blame] | 2982 | if (pCreateInfos[i].pViewportState->scissorCount != pCreateInfos[i].pViewportState->viewportCount) { |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 2983 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 2984 | __LINE__, VALIDATION_ERROR_01434, LayerName, |
Mark Lobodzinski | b81000e | 2016-12-16 13:08:00 -0700 | [diff] [blame] | 2985 | "Graphics Pipeline viewport count (%u) must match scissor count (%u). %s", |
| 2986 | pCreateInfos[i].pViewportState->viewportCount, pCreateInfos[i].pViewportState->scissorCount, |
| 2987 | validation_error_map[VALIDATION_ERROR_01434]); |
| 2988 | } |
| 2989 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2990 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 2991 | validate_struct_pnext(report_data, "vkCreateGraphicsPipelines", |
| 2992 | ParameterName("pCreateInfos[%i].pViewportState->pNext", ParameterName::IndexVector{i}), |
| 2993 | NULL, pCreateInfos[i].pViewportState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 2994 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2995 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 2996 | validate_reserved_flags(report_data, "vkCreateGraphicsPipelines", |
| 2997 | ParameterName("pCreateInfos[%i].pViewportState->flags", ParameterName::IndexVector{i}), |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 2998 | pCreateInfos[i].pViewportState->flags); |
| 2999 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3000 | if (pCreateInfos[i].pViewportState->sType != VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3001 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3002 | __LINE__, INVALID_STRUCT_STYPE, LayerName, |
| 3003 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pViewportState->sType must be " |
| 3004 | "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO", |
| 3005 | i); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3006 | } |
| 3007 | |
Mark Lobodzinski | d40eeb1 | 2016-12-18 09:43:01 -0700 | [diff] [blame] | 3008 | if (device_data->physical_device_features.multiViewport == false) { |
| 3009 | if (pCreateInfos[i].pViewportState->viewportCount != 1) { |
| 3010 | skip |= |
| 3011 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3012 | __LINE__, VALIDATION_ERROR_01430, LayerName, |
| 3013 | "vkCreateGraphicsPipelines: The multiViewport feature is not enabled, so " |
| 3014 | "pCreateInfos[%d].pViewportState->viewportCount must be 1 but is %d. %s", |
| 3015 | i, pCreateInfos[i].pViewportState->viewportCount, validation_error_map[VALIDATION_ERROR_01430]); |
| 3016 | } |
| 3017 | if (pCreateInfos[i].pViewportState->scissorCount != 1) { |
| 3018 | skip |= |
| 3019 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3020 | __LINE__, VALIDATION_ERROR_01431, LayerName, |
| 3021 | "vkCreateGraphicsPipelines: The multiViewport feature is not enabled, so " |
| 3022 | "pCreateInfos[%d].pViewportState->scissorCount must be 1 but is %d. %s", |
| 3023 | i, pCreateInfos[i].pViewportState->scissorCount, validation_error_map[VALIDATION_ERROR_01431]); |
| 3024 | } |
| 3025 | } else { |
| 3026 | if ((pCreateInfos[i].pViewportState->viewportCount < 1) || |
| 3027 | (pCreateInfos[i].pViewportState->viewportCount > device_data->device_limits.maxViewports)) { |
| 3028 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3029 | __LINE__, VALIDATION_ERROR_01432, LayerName, |
| 3030 | "vkCreateGraphicsPipelines: multiViewport feature is enabled; " |
| 3031 | "pCreateInfos[%d].pViewportState->viewportCount is %d but must be between 1 and " |
| 3032 | "maxViewports (%d), inclusive. %s", |
| 3033 | i, pCreateInfos[i].pViewportState->viewportCount, device_data->device_limits.maxViewports, |
| 3034 | validation_error_map[VALIDATION_ERROR_01432]); |
| 3035 | } |
| 3036 | if ((pCreateInfos[i].pViewportState->scissorCount < 1) || |
| 3037 | (pCreateInfos[i].pViewportState->scissorCount > device_data->device_limits.maxViewports)) { |
| 3038 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3039 | __LINE__, VALIDATION_ERROR_01433, LayerName, |
| 3040 | "vkCreateGraphicsPipelines: multiViewport feature is enabled; " |
| 3041 | "pCreateInfos[%d].pViewportState->scissorCount is %d but must be between 1 and " |
| 3042 | "maxViewports (%d), inclusive. %s", |
| 3043 | i, pCreateInfos[i].pViewportState->scissorCount, device_data->device_limits.maxViewports, |
| 3044 | validation_error_map[VALIDATION_ERROR_01433]); |
| 3045 | } |
| 3046 | } |
| 3047 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3048 | if (pCreateInfos[i].pDynamicState != nullptr) { |
| 3049 | bool has_dynamic_viewport = false; |
| 3050 | bool has_dynamic_scissor = false; |
| 3051 | |
| 3052 | for (uint32_t state_index = 0; state_index < pCreateInfos[i].pDynamicState->dynamicStateCount; ++state_index) { |
| 3053 | if (pCreateInfos[i].pDynamicState->pDynamicStates[state_index] == VK_DYNAMIC_STATE_VIEWPORT) { |
| 3054 | has_dynamic_viewport = true; |
| 3055 | } else if (pCreateInfos[i].pDynamicState->pDynamicStates[state_index] == VK_DYNAMIC_STATE_SCISSOR) { |
| 3056 | has_dynamic_scissor = true; |
| 3057 | } |
| 3058 | } |
| 3059 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3060 | // If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT, the pViewports |
| 3061 | // member of pViewportState must be a pointer to an array of pViewportState->viewportCount VkViewport structures |
| 3062 | if (!has_dynamic_viewport && (pCreateInfos[i].pViewportState->pViewports == nullptr)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3063 | skip |= |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3064 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3065 | __LINE__, VALIDATION_ERROR_02110, LayerName, |
Tobin Ehlis | bebd316 | 2016-08-18 10:53:58 -0600 | [diff] [blame] | 3066 | "vkCreateGraphicsPipelines: if pCreateInfos[%d].pDynamicState->pDynamicStates does not contain " |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3067 | "VK_DYNAMIC_STATE_VIEWPORT, pCreateInfos[%d].pViewportState->pViewports must not be NULL. %s", |
| 3068 | i, i, validation_error_map[VALIDATION_ERROR_02110]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3069 | } |
| 3070 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3071 | // If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SCISSOR, the pScissors member |
| 3072 | // of pViewportState must be a pointer to an array of pViewportState->scissorCount VkRect2D structures |
| 3073 | if (!has_dynamic_scissor && (pCreateInfos[i].pViewportState->pScissors == nullptr)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3074 | skip |= |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3075 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3076 | __LINE__, VALIDATION_ERROR_02111, LayerName, |
Tobin Ehlis | bebd316 | 2016-08-18 10:53:58 -0600 | [diff] [blame] | 3077 | "vkCreateGraphicsPipelines: if pCreateInfos[%d].pDynamicState->pDynamicStates does not contain " |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3078 | "VK_DYNAMIC_STATE_SCISSOR, pCreateInfos[%d].pViewportState->pScissors must not be NULL. %s", |
| 3079 | i, i, validation_error_map[VALIDATION_ERROR_02111]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3080 | } |
| 3081 | } |
| 3082 | } |
| 3083 | |
| 3084 | if (pCreateInfos[i].pMultisampleState == nullptr) { |
| 3085 | // If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pMultisampleState must be a pointer to |
| 3086 | // a valid VkPipelineMultisampleStateCreateInfo structure |
| 3087 | if ((pCreateInfos[i].pRasterizationState != nullptr) && |
| 3088 | pCreateInfos[i].pRasterizationState->rasterizerDiscardEnable == VK_FALSE) { |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3089 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3090 | __LINE__, VALIDATION_ERROR_02114, LayerName, |
| 3091 | "vkCreateGraphicsPipelines: if " |
| 3092 | "pCreateInfos[%d].pRasterizationState->rasterizerDiscardEnable is " |
| 3093 | "VK_FALSE, pCreateInfos[%d].pMultisampleState must not be NULL. %s", |
| 3094 | i, i, validation_error_map[VALIDATION_ERROR_02114]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3095 | } |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3096 | } else { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3097 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3098 | validate_struct_pnext(report_data, "vkCreateGraphicsPipelines", |
| 3099 | ParameterName("pCreateInfos[%i].pMultisampleState->pNext", ParameterName::IndexVector{i}), |
Dustin Graves | af5c029 | 2016-07-19 13:43:53 -0600 | [diff] [blame] | 3100 | NULL, pCreateInfos[i].pMultisampleState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3101 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3102 | skip |= validate_reserved_flags( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3103 | report_data, "vkCreateGraphicsPipelines", |
| 3104 | ParameterName("pCreateInfos[%i].pMultisampleState->flags", ParameterName::IndexVector{i}), |
| 3105 | pCreateInfos[i].pMultisampleState->flags); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3106 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3107 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3108 | report_data, "vkCreateGraphicsPipelines", |
| 3109 | ParameterName("pCreateInfos[%i].pMultisampleState->sampleShadingEnable", ParameterName::IndexVector{i}), |
| 3110 | pCreateInfos[i].pMultisampleState->sampleShadingEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3111 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3112 | skip |= validate_array( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3113 | report_data, "vkCreateGraphicsPipelines", |
| 3114 | ParameterName("pCreateInfos[%i].pMultisampleState->rasterizationSamples", ParameterName::IndexVector{i}), |
| 3115 | ParameterName("pCreateInfos[%i].pMultisampleState->pSampleMask", ParameterName::IndexVector{i}), |
| 3116 | pCreateInfos[i].pMultisampleState->rasterizationSamples, pCreateInfos[i].pMultisampleState->pSampleMask, true, |
| 3117 | false); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3118 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3119 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3120 | report_data, "vkCreateGraphicsPipelines", |
| 3121 | ParameterName("pCreateInfos[%i].pMultisampleState->alphaToCoverageEnable", ParameterName::IndexVector{i}), |
| 3122 | pCreateInfos[i].pMultisampleState->alphaToCoverageEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3123 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3124 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3125 | report_data, "vkCreateGraphicsPipelines", |
| 3126 | ParameterName("pCreateInfos[%i].pMultisampleState->alphaToOneEnable", ParameterName::IndexVector{i}), |
| 3127 | pCreateInfos[i].pMultisampleState->alphaToOneEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3128 | |
| 3129 | if (pCreateInfos[i].pMultisampleState->sType != VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3130 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3131 | __LINE__, INVALID_STRUCT_STYPE, LayerName, |
| 3132 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pMultisampleState->sType must be " |
| 3133 | "VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO", |
| 3134 | i); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3135 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3136 | } |
| 3137 | |
| 3138 | // TODO: Conditional NULL check based on rasterizerDiscardEnable and subpass |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3139 | if (pCreateInfos[i].pDepthStencilState != nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3140 | skip |= validate_struct_pnext( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3141 | report_data, "vkCreateGraphicsPipelines", |
| 3142 | ParameterName("pCreateInfos[%i].pDepthStencilState->pNext", ParameterName::IndexVector{i}), NULL, |
| 3143 | pCreateInfos[i].pDepthStencilState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3144 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3145 | skip |= validate_reserved_flags( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3146 | report_data, "vkCreateGraphicsPipelines", |
| 3147 | ParameterName("pCreateInfos[%i].pDepthStencilState->flags", ParameterName::IndexVector{i}), |
| 3148 | pCreateInfos[i].pDepthStencilState->flags); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3149 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3150 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3151 | report_data, "vkCreateGraphicsPipelines", |
| 3152 | ParameterName("pCreateInfos[%i].pDepthStencilState->depthTestEnable", ParameterName::IndexVector{i}), |
| 3153 | pCreateInfos[i].pDepthStencilState->depthTestEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3154 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3155 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3156 | report_data, "vkCreateGraphicsPipelines", |
| 3157 | ParameterName("pCreateInfos[%i].pDepthStencilState->depthWriteEnable", ParameterName::IndexVector{i}), |
| 3158 | pCreateInfos[i].pDepthStencilState->depthWriteEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3159 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3160 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3161 | report_data, "vkCreateGraphicsPipelines", |
| 3162 | ParameterName("pCreateInfos[%i].pDepthStencilState->depthCompareOp", ParameterName::IndexVector{i}), |
| 3163 | "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, |
| 3164 | pCreateInfos[i].pDepthStencilState->depthCompareOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3165 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3166 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3167 | report_data, "vkCreateGraphicsPipelines", |
| 3168 | ParameterName("pCreateInfos[%i].pDepthStencilState->depthBoundsTestEnable", ParameterName::IndexVector{i}), |
| 3169 | pCreateInfos[i].pDepthStencilState->depthBoundsTestEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3170 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3171 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3172 | report_data, "vkCreateGraphicsPipelines", |
| 3173 | ParameterName("pCreateInfos[%i].pDepthStencilState->stencilTestEnable", ParameterName::IndexVector{i}), |
| 3174 | pCreateInfos[i].pDepthStencilState->stencilTestEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3175 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3176 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3177 | report_data, "vkCreateGraphicsPipelines", |
| 3178 | ParameterName("pCreateInfos[%i].pDepthStencilState->front.failOp", ParameterName::IndexVector{i}), |
| 3179 | "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, |
| 3180 | pCreateInfos[i].pDepthStencilState->front.failOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3181 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3182 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3183 | report_data, "vkCreateGraphicsPipelines", |
| 3184 | ParameterName("pCreateInfos[%i].pDepthStencilState->front.passOp", ParameterName::IndexVector{i}), |
| 3185 | "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, |
| 3186 | pCreateInfos[i].pDepthStencilState->front.passOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3187 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3188 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3189 | report_data, "vkCreateGraphicsPipelines", |
| 3190 | ParameterName("pCreateInfos[%i].pDepthStencilState->front.depthFailOp", ParameterName::IndexVector{i}), |
| 3191 | "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, |
| 3192 | pCreateInfos[i].pDepthStencilState->front.depthFailOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3193 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3194 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3195 | report_data, "vkCreateGraphicsPipelines", |
| 3196 | ParameterName("pCreateInfos[%i].pDepthStencilState->front.compareOp", ParameterName::IndexVector{i}), |
| 3197 | "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, |
| 3198 | pCreateInfos[i].pDepthStencilState->front.compareOp); |
| 3199 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3200 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3201 | report_data, "vkCreateGraphicsPipelines", |
| 3202 | ParameterName("pCreateInfos[%i].pDepthStencilState->back.failOp", ParameterName::IndexVector{i}), "VkStencilOp", |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3203 | VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, pCreateInfos[i].pDepthStencilState->back.failOp); |
| 3204 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3205 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3206 | report_data, "vkCreateGraphicsPipelines", |
| 3207 | ParameterName("pCreateInfos[%i].pDepthStencilState->back.passOp", ParameterName::IndexVector{i}), "VkStencilOp", |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3208 | VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, pCreateInfos[i].pDepthStencilState->back.passOp); |
| 3209 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3210 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3211 | report_data, "vkCreateGraphicsPipelines", |
| 3212 | ParameterName("pCreateInfos[%i].pDepthStencilState->back.depthFailOp", ParameterName::IndexVector{i}), |
| 3213 | "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, |
| 3214 | pCreateInfos[i].pDepthStencilState->back.depthFailOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3215 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3216 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3217 | report_data, "vkCreateGraphicsPipelines", |
| 3218 | ParameterName("pCreateInfos[%i].pDepthStencilState->back.compareOp", ParameterName::IndexVector{i}), |
| 3219 | "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, |
| 3220 | pCreateInfos[i].pDepthStencilState->back.compareOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3221 | |
| 3222 | if (pCreateInfos[i].pDepthStencilState->sType != VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3223 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3224 | __LINE__, INVALID_STRUCT_STYPE, LayerName, |
| 3225 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pDepthStencilState->sType must be " |
| 3226 | "VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO", |
| 3227 | i); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3228 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3229 | } |
| 3230 | |
| 3231 | // TODO: Conditional NULL check based on rasterizerDiscardEnable and subpass |
| 3232 | if (pCreateInfos[i].pColorBlendState != nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3233 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3234 | validate_struct_pnext(report_data, "vkCreateGraphicsPipelines", |
| 3235 | ParameterName("pCreateInfos[%i].pColorBlendState->pNext", ParameterName::IndexVector{i}), |
| 3236 | NULL, pCreateInfos[i].pColorBlendState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3237 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3238 | skip |= validate_reserved_flags( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3239 | report_data, "vkCreateGraphicsPipelines", |
| 3240 | ParameterName("pCreateInfos[%i].pColorBlendState->flags", ParameterName::IndexVector{i}), |
| 3241 | pCreateInfos[i].pColorBlendState->flags); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3242 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3243 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3244 | report_data, "vkCreateGraphicsPipelines", |
| 3245 | ParameterName("pCreateInfos[%i].pColorBlendState->logicOpEnable", ParameterName::IndexVector{i}), |
| 3246 | pCreateInfos[i].pColorBlendState->logicOpEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3247 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3248 | skip |= validate_array( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3249 | report_data, "vkCreateGraphicsPipelines", |
| 3250 | ParameterName("pCreateInfos[%i].pColorBlendState->attachmentCount", ParameterName::IndexVector{i}), |
| 3251 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments", ParameterName::IndexVector{i}), |
| 3252 | pCreateInfos[i].pColorBlendState->attachmentCount, pCreateInfos[i].pColorBlendState->pAttachments, false, true); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3253 | |
| 3254 | if (pCreateInfos[i].pColorBlendState->pAttachments != NULL) { |
| 3255 | for (uint32_t attachmentIndex = 0; attachmentIndex < pCreateInfos[i].pColorBlendState->attachmentCount; |
| 3256 | ++attachmentIndex) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3257 | skip |= validate_bool32(report_data, "vkCreateGraphicsPipelines", |
| 3258 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].blendEnable", |
| 3259 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3260 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].blendEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3261 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3262 | skip |= validate_ranged_enum( |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3263 | report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3264 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].srcColorBlendFactor", |
| 3265 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3266 | "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3267 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].srcColorBlendFactor); |
| 3268 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3269 | skip |= validate_ranged_enum( |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3270 | report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3271 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].dstColorBlendFactor", |
| 3272 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3273 | "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3274 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].dstColorBlendFactor); |
| 3275 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3276 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3277 | validate_ranged_enum(report_data, "vkCreateGraphicsPipelines", |
| 3278 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].colorBlendOp", |
| 3279 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3280 | "VkBlendOp", VK_BLEND_OP_BEGIN_RANGE, VK_BLEND_OP_END_RANGE, |
| 3281 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].colorBlendOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3282 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3283 | skip |= validate_ranged_enum( |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3284 | report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3285 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].srcAlphaBlendFactor", |
| 3286 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3287 | "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3288 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].srcAlphaBlendFactor); |
| 3289 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3290 | skip |= validate_ranged_enum( |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3291 | report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3292 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].dstAlphaBlendFactor", |
| 3293 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3294 | "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3295 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].dstAlphaBlendFactor); |
| 3296 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3297 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3298 | validate_ranged_enum(report_data, "vkCreateGraphicsPipelines", |
| 3299 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].alphaBlendOp", |
| 3300 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3301 | "VkBlendOp", VK_BLEND_OP_BEGIN_RANGE, VK_BLEND_OP_END_RANGE, |
| 3302 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].alphaBlendOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3303 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3304 | skip |= |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3305 | validate_flags(report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3306 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].colorWriteMask", |
| 3307 | ParameterName::IndexVector{i, attachmentIndex}), |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3308 | "VkColorComponentFlagBits", AllVkColorComponentFlagBits, |
| 3309 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].colorWriteMask, false); |
| 3310 | } |
| 3311 | } |
| 3312 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3313 | if (pCreateInfos[i].pColorBlendState->sType != VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3314 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3315 | __LINE__, INVALID_STRUCT_STYPE, LayerName, |
| 3316 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pColorBlendState->sType must be " |
| 3317 | "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO", |
| 3318 | i); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3319 | } |
| 3320 | |
| 3321 | // If logicOpEnable is VK_TRUE, logicOp must be a valid VkLogicOp value |
| 3322 | if (pCreateInfos[i].pColorBlendState->logicOpEnable == VK_TRUE) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3323 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3324 | report_data, "vkCreateGraphicsPipelines", |
| 3325 | ParameterName("pCreateInfos[%i].pColorBlendState->logicOp", ParameterName::IndexVector{i}), "VkLogicOp", |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3326 | VK_LOGIC_OP_BEGIN_RANGE, VK_LOGIC_OP_END_RANGE, pCreateInfos[i].pColorBlendState->logicOp); |
| 3327 | } |
| 3328 | } |
| 3329 | } |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3330 | skip |= PreCreateGraphicsPipelines(device, pCreateInfos); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3331 | } |
| 3332 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3333 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3334 | result = device_data->dispatch_table.CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, |
| 3335 | pAllocator, pPipelines); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3336 | validate_result(report_data, "vkCreateGraphicsPipelines", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3337 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3338 | |
| 3339 | return result; |
| 3340 | } |
| 3341 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3342 | bool PreCreateComputePipelines(VkDevice device, const VkComputePipelineCreateInfo *pCreateInfos) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3343 | layer_data *data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3344 | bool skip = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3345 | if (pCreateInfos != nullptr) { |
| 3346 | // TODO: Handle count! |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3347 | uint32_t i = 0; |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3348 | skip |= validate_string(data->report_data, "vkCreateComputePipelines", |
| 3349 | ParameterName("pCreateInfos[%i].stage.pName", ParameterName::IndexVector{i}), |
| 3350 | pCreateInfos[i].stage.pName); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3351 | } |
| 3352 | |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3353 | return skip; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3354 | } |
| 3355 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3356 | VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 3357 | const VkComputePipelineCreateInfo *pCreateInfos, |
| 3358 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3359 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3360 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3361 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3362 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3363 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3364 | skip |= parameter_validation_vkCreateComputePipelines(my_data->report_data, pipelineCache, createInfoCount, pCreateInfos, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3365 | pAllocator, pPipelines); |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3366 | skip |= PreCreateComputePipelines(device, pCreateInfos); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3367 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3368 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3369 | result = my_data->dispatch_table.CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, |
| 3370 | pPipelines); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3371 | validate_result(my_data->report_data, "vkCreateComputePipelines", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3372 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3373 | |
| 3374 | return result; |
| 3375 | } |
| 3376 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3377 | VKAPI_ATTR void VKAPI_CALL DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3378 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3379 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3380 | assert(my_data != NULL); |
| 3381 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3382 | skip |= parameter_validation_vkDestroyPipeline(my_data->report_data, pipeline, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3383 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3384 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3385 | my_data->dispatch_table.DestroyPipeline(device, pipeline, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3386 | } |
| 3387 | } |
| 3388 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3389 | VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, |
| 3390 | const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3391 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3392 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3393 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3394 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3395 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3396 | skip |= parameter_validation_vkCreatePipelineLayout(my_data->report_data, pCreateInfo, pAllocator, pPipelineLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3397 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3398 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3399 | result = my_data->dispatch_table.CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3400 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3401 | validate_result(my_data->report_data, "vkCreatePipelineLayout", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3402 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3403 | |
| 3404 | return result; |
| 3405 | } |
| 3406 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3407 | VKAPI_ATTR void VKAPI_CALL DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, |
| 3408 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3409 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3410 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3411 | assert(my_data != NULL); |
| 3412 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3413 | skip |= parameter_validation_vkDestroyPipelineLayout(my_data->report_data, pipelineLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3414 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3415 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3416 | my_data->dispatch_table.DestroyPipelineLayout(device, pipelineLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3417 | } |
| 3418 | } |
| 3419 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3420 | VKAPI_ATTR VkResult VKAPI_CALL CreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, |
| 3421 | const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3422 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3423 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3424 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3425 | assert(device_data != NULL); |
| 3426 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3427 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3428 | skip |= parameter_validation_vkCreateSampler(report_data, pCreateInfo, pAllocator, pSampler); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3429 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3430 | if (pCreateInfo != nullptr) { |
Mark Lobodzinski | 262f61f | 2017-03-01 15:52:49 -0700 | [diff] [blame] | 3431 | |
| 3432 | if ((device_data->physical_device_features.samplerAnisotropy == false) && (pCreateInfo->maxAnisotropy != 1.0)) { |
| 3433 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3434 | DEVICE_FEATURE, LayerName, |
| 3435 | "vkCreateSampler(): The samplerAnisotropy feature is not enabled, so the maxAnisotropy member of the " |
| 3436 | "VkSamplerCreateInfo structure must be 1.0 but is %f.", |
| 3437 | pCreateInfo->maxAnisotropy); |
| 3438 | } |
| 3439 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3440 | // If compareEnable is VK_TRUE, compareOp must be a valid VkCompareOp value |
| 3441 | if (pCreateInfo->compareEnable == VK_TRUE) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3442 | skip |= validate_ranged_enum(report_data, "vkCreateSampler", "pCreateInfo->compareOp", "VkCompareOp", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3443 | VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, pCreateInfo->compareOp); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3444 | } |
| 3445 | |
| 3446 | // If any of addressModeU, addressModeV or addressModeW are VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, borderColor must be a |
| 3447 | // valid VkBorderColor value |
| 3448 | if ((pCreateInfo->addressModeU == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) || |
| 3449 | (pCreateInfo->addressModeV == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) || |
| 3450 | (pCreateInfo->addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3451 | skip |= validate_ranged_enum(report_data, "vkCreateSampler", "pCreateInfo->borderColor", "VkBorderColor", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3452 | VK_BORDER_COLOR_BEGIN_RANGE, VK_BORDER_COLOR_END_RANGE, pCreateInfo->borderColor); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3453 | } |
| 3454 | } |
| 3455 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3456 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3457 | result = device_data->dispatch_table.CreateSampler(device, pCreateInfo, pAllocator, pSampler); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3458 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3459 | validate_result(report_data, "vkCreateSampler", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3460 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3461 | |
| 3462 | return result; |
| 3463 | } |
| 3464 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3465 | VKAPI_ATTR void VKAPI_CALL DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3466 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3467 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3468 | assert(my_data != NULL); |
| 3469 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3470 | skip |= parameter_validation_vkDestroySampler(my_data->report_data, sampler, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3471 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3472 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3473 | my_data->dispatch_table.DestroySampler(device, sampler, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3474 | } |
| 3475 | } |
| 3476 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3477 | VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, |
| 3478 | const VkAllocationCallbacks *pAllocator, |
| 3479 | VkDescriptorSetLayout *pSetLayout) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3480 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3481 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3482 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3483 | assert(device_data != nullptr); |
| 3484 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3485 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3486 | skip |= parameter_validation_vkCreateDescriptorSetLayout(report_data, pCreateInfo, pAllocator, pSetLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3487 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3488 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 3489 | if ((pCreateInfo != nullptr) && (pCreateInfo->pBindings != nullptr)) { |
| 3490 | for (uint32_t i = 0; i < pCreateInfo->bindingCount; ++i) { |
| 3491 | if (pCreateInfo->pBindings[i].descriptorCount != 0) { |
| 3492 | // If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and descriptorCount |
| 3493 | // is not 0 and pImmutableSamplers is not NULL, pImmutableSamplers must be a pointer to an array of descriptorCount |
| 3494 | // valid VkSampler handles |
| 3495 | if (((pCreateInfo->pBindings[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER) || |
| 3496 | (pCreateInfo->pBindings[i].descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)) && |
| 3497 | (pCreateInfo->pBindings[i].pImmutableSamplers != nullptr)) { |
| 3498 | for (uint32_t descriptor_index = 0; descriptor_index < pCreateInfo->pBindings[i].descriptorCount; |
| 3499 | ++descriptor_index) { |
| 3500 | if (pCreateInfo->pBindings[i].pImmutableSamplers[descriptor_index] == VK_NULL_HANDLE) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 3501 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3502 | __LINE__, REQUIRED_PARAMETER, LayerName, |
| 3503 | "vkCreateDescriptorSetLayout: required parameter " |
| 3504 | "pCreateInfo->pBindings[%d].pImmutableSamplers[%d]" |
| 3505 | " specified as VK_NULL_HANDLE", |
| 3506 | i, descriptor_index); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3507 | } |
| 3508 | } |
| 3509 | } |
| 3510 | |
| 3511 | // If descriptorCount is not 0, stageFlags must be a valid combination of VkShaderStageFlagBits values |
| 3512 | if ((pCreateInfo->pBindings[i].stageFlags != 0) && |
| 3513 | ((pCreateInfo->pBindings[i].stageFlags & (~AllVkShaderStageFlagBits)) != 0)) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3514 | skip |= log_msg( |
| 3515 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3516 | VALIDATION_ERROR_00853, LayerName, |
| 3517 | "vkCreateDescriptorSetLayout(): if pCreateInfo->pBindings[%d].descriptorCount is not 0, " |
| 3518 | "pCreateInfo->pBindings[%d].stageFlags must be a valid combination of VkShaderStageFlagBits values. %s", |
| 3519 | i, i, validation_error_map[VALIDATION_ERROR_00853]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3520 | } |
| 3521 | } |
| 3522 | } |
| 3523 | } |
| 3524 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3525 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3526 | result = device_data->dispatch_table.CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3527 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3528 | validate_result(report_data, "vkCreateDescriptorSetLayout", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3529 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3530 | |
| 3531 | return result; |
| 3532 | } |
| 3533 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3534 | VKAPI_ATTR void VKAPI_CALL DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, |
| 3535 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3536 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3537 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3538 | assert(my_data != NULL); |
| 3539 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3540 | skip |= parameter_validation_vkDestroyDescriptorSetLayout(my_data->report_data, descriptorSetLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3541 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3542 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3543 | my_data->dispatch_table.DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3544 | } |
| 3545 | } |
| 3546 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3547 | VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, |
| 3548 | const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3549 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3550 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3551 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3552 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3553 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3554 | skip |= parameter_validation_vkCreateDescriptorPool(my_data->report_data, pCreateInfo, pAllocator, pDescriptorPool); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3555 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3556 | /* TODOVV: How do we validate maxSets? Probably belongs in the limits layer? */ |
| 3557 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3558 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3559 | result = my_data->dispatch_table.CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3560 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3561 | validate_result(my_data->report_data, "vkCreateDescriptorPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3562 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3563 | |
| 3564 | return result; |
| 3565 | } |
| 3566 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3567 | VKAPI_ATTR void VKAPI_CALL DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, |
| 3568 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3569 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3570 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3571 | assert(my_data != NULL); |
| 3572 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3573 | skip |= parameter_validation_vkDestroyDescriptorPool(my_data->report_data, descriptorPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3574 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3575 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3576 | my_data->dispatch_table.DestroyDescriptorPool(device, descriptorPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3577 | } |
| 3578 | } |
| 3579 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3580 | VKAPI_ATTR VkResult VKAPI_CALL ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, |
| 3581 | VkDescriptorPoolResetFlags flags) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3582 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3583 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3584 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3585 | assert(my_data != NULL); |
| 3586 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3587 | skip |= parameter_validation_vkResetDescriptorPool(my_data->report_data, descriptorPool, flags); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3588 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3589 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3590 | result = my_data->dispatch_table.ResetDescriptorPool(device, descriptorPool, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3591 | |
| 3592 | validate_result(my_data->report_data, "vkResetDescriptorPool", result); |
| 3593 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3594 | |
| 3595 | return result; |
| 3596 | } |
| 3597 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3598 | VKAPI_ATTR VkResult VKAPI_CALL AllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, |
| 3599 | VkDescriptorSet *pDescriptorSets) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3600 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3601 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3602 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3603 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3604 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3605 | skip |= parameter_validation_vkAllocateDescriptorSets(my_data->report_data, pAllocateInfo, pDescriptorSets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3606 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3607 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3608 | result = my_data->dispatch_table.AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3609 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3610 | validate_result(my_data->report_data, "vkAllocateDescriptorSets", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3611 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3612 | |
| 3613 | return result; |
| 3614 | } |
| 3615 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3616 | VKAPI_ATTR VkResult VKAPI_CALL FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3617 | const VkDescriptorSet *pDescriptorSets) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3618 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3619 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3620 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3621 | assert(device_data != nullptr); |
| 3622 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3623 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3624 | skip |= parameter_validation_vkFreeDescriptorSets(report_data, descriptorPool, descriptorSetCount, pDescriptorSets); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3625 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3626 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 3627 | // This is an array of handles, where the elements are allowed to be VK_NULL_HANDLE, and does not require any validation beyond |
| 3628 | // validate_array() |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3629 | skip |= validate_array(report_data, "vkFreeDescriptorSets", "descriptorSetCount", "pDescriptorSets", descriptorSetCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3630 | pDescriptorSets, true, true); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3631 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3632 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3633 | result = device_data->dispatch_table.FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3634 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3635 | validate_result(report_data, "vkFreeDescriptorSets", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3636 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3637 | |
| 3638 | return result; |
| 3639 | } |
| 3640 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3641 | VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, |
| 3642 | const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, |
| 3643 | const VkCopyDescriptorSet *pDescriptorCopies) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3644 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3645 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3646 | assert(device_data != NULL); |
| 3647 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3648 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3649 | skip |= parameter_validation_vkUpdateDescriptorSets(report_data, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, |
| 3650 | pDescriptorCopies); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3651 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3652 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 3653 | if (pDescriptorWrites != NULL) { |
| 3654 | for (uint32_t i = 0; i < descriptorWriteCount; ++i) { |
| 3655 | // descriptorCount must be greater than 0 |
| 3656 | if (pDescriptorWrites[i].descriptorCount == 0) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3657 | skip |= |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3658 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3659 | VALIDATION_ERROR_00957, LayerName, |
| 3660 | "vkUpdateDescriptorSets(): parameter pDescriptorWrites[%d].descriptorCount must be greater than 0. %s", |
| 3661 | i, validation_error_map[VALIDATION_ERROR_00957]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3662 | } |
| 3663 | |
Dustin Graves | ce68f08 | 2017-03-30 15:42:16 -0600 | [diff] [blame] | 3664 | // dstSet must be a valid VkDescriptorSet handle |
| 3665 | skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", |
| 3666 | ParameterName("pDescriptorWrites[%i].dstSet", ParameterName::IndexVector{i}), |
| 3667 | pDescriptorWrites[i].dstSet); |
| 3668 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3669 | if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER) || |
| 3670 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) || |
| 3671 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) || |
| 3672 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) || |
| 3673 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT)) { |
| 3674 | // If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, |
| 3675 | // VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, |
| 3676 | // pImageInfo must be a pointer to an array of descriptorCount valid VkDescriptorImageInfo structures |
| 3677 | if (pDescriptorWrites[i].pImageInfo == nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3678 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3679 | __LINE__, VALIDATION_ERROR_00939, LayerName, |
| 3680 | "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " |
| 3681 | "VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, " |
| 3682 | "VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or " |
| 3683 | "VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pDescriptorWrites[%d].pImageInfo must not be NULL. %s", |
| 3684 | i, i, validation_error_map[VALIDATION_ERROR_00939]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3685 | } else if (pDescriptorWrites[i].descriptorType != VK_DESCRIPTOR_TYPE_SAMPLER) { |
| 3686 | // If descriptorType is VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, |
| 3687 | // VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the imageView and imageLayout |
| 3688 | // members of any given element of pImageInfo must be a valid VkImageView and VkImageLayout, respectively |
| 3689 | for (uint32_t descriptor_index = 0; descriptor_index < pDescriptorWrites[i].descriptorCount; |
| 3690 | ++descriptor_index) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3691 | skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3692 | ParameterName("pDescriptorWrites[%i].pImageInfo[%i].imageView", |
| 3693 | ParameterName::IndexVector{i, descriptor_index}), |
| 3694 | pDescriptorWrites[i].pImageInfo[descriptor_index].imageView); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3695 | skip |= validate_ranged_enum(report_data, "vkUpdateDescriptorSets", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3696 | ParameterName("pDescriptorWrites[%i].pImageInfo[%i].imageLayout", |
| 3697 | ParameterName::IndexVector{i, descriptor_index}), |
| 3698 | "VkImageLayout", VK_IMAGE_LAYOUT_BEGIN_RANGE, VK_IMAGE_LAYOUT_END_RANGE, |
| 3699 | pDescriptorWrites[i].pImageInfo[descriptor_index].imageLayout); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3700 | } |
| 3701 | } |
| 3702 | } else if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) || |
| 3703 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) || |
| 3704 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) || |
| 3705 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) { |
| 3706 | // If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 3707 | // VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, pBufferInfo must be a |
| 3708 | // pointer to an array of descriptorCount valid VkDescriptorBufferInfo structures |
| 3709 | if (pDescriptorWrites[i].pBufferInfo == nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3710 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3711 | __LINE__, VALIDATION_ERROR_00941, LayerName, |
| 3712 | "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " |
| 3713 | "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, " |
| 3714 | "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, " |
| 3715 | "pDescriptorWrites[%d].pBufferInfo must not be NULL. %s", |
| 3716 | i, i, validation_error_map[VALIDATION_ERROR_00941]); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3717 | } else { |
| 3718 | for (uint32_t descriptorIndex = 0; descriptorIndex < pDescriptorWrites[i].descriptorCount; ++descriptorIndex) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3719 | skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3720 | ParameterName("pDescriptorWrites[%i].pBufferInfo[%i].buffer", |
| 3721 | ParameterName::IndexVector{i, descriptorIndex}), |
| 3722 | pDescriptorWrites[i].pBufferInfo[descriptorIndex].buffer); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3723 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3724 | } |
| 3725 | } else if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) || |
| 3726 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER)) { |
| 3727 | // If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, |
| 3728 | // pTexelBufferView must be a pointer to an array of descriptorCount valid VkBufferView handles |
| 3729 | if (pDescriptorWrites[i].pTexelBufferView == nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3730 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3731 | __LINE__, VALIDATION_ERROR_00940, LayerName, |
| 3732 | "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " |
| 3733 | "VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, " |
| 3734 | "pDescriptorWrites[%d].pTexelBufferView must not be NULL. %s", |
| 3735 | i, i, validation_error_map[VALIDATION_ERROR_00940]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3736 | } else { |
| 3737 | for (uint32_t descriptor_index = 0; descriptor_index < pDescriptorWrites[i].descriptorCount; |
| 3738 | ++descriptor_index) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3739 | skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3740 | ParameterName("pDescriptorWrites[%i].pTexelBufferView[%i]", |
| 3741 | ParameterName::IndexVector{i, descriptor_index}), |
| 3742 | pDescriptorWrites[i].pTexelBufferView[descriptor_index]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3743 | } |
| 3744 | } |
| 3745 | } |
Mark Lobodzinski | 1a34d7e | 2016-06-28 11:51:16 -0600 | [diff] [blame] | 3746 | |
| 3747 | if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) || |
| 3748 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC)) { |
| 3749 | VkDeviceSize uniformAlignment = device_data->device_limits.minUniformBufferOffsetAlignment; |
| 3750 | for (uint32_t j = 0; j < pDescriptorWrites[i].descriptorCount; j++) { |
| 3751 | if (pDescriptorWrites[i].pBufferInfo != NULL) { |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 3752 | if (SafeModulo(pDescriptorWrites[i].pBufferInfo[j].offset, uniformAlignment) != 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3753 | skip |= log_msg( |
| 3754 | device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, |
| 3755 | VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, VALIDATION_ERROR_00944, LayerName, |
| 3756 | "vkUpdateDescriptorSets(): pDescriptorWrites[%d].pBufferInfo[%d].offset (0x%" PRIxLEAST64 |
| 3757 | ") must be a multiple of device limit minUniformBufferOffsetAlignment 0x%" PRIxLEAST64 ". %s", |
| 3758 | i, j, pDescriptorWrites[i].pBufferInfo[j].offset, uniformAlignment, |
| 3759 | validation_error_map[VALIDATION_ERROR_00944]); |
Mark Lobodzinski | 1a34d7e | 2016-06-28 11:51:16 -0600 | [diff] [blame] | 3760 | } |
| 3761 | } |
| 3762 | } |
| 3763 | } else if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) || |
| 3764 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) { |
| 3765 | VkDeviceSize storageAlignment = device_data->device_limits.minStorageBufferOffsetAlignment; |
| 3766 | for (uint32_t j = 0; j < pDescriptorWrites[i].descriptorCount; j++) { |
| 3767 | if (pDescriptorWrites[i].pBufferInfo != NULL) { |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 3768 | if (SafeModulo(pDescriptorWrites[i].pBufferInfo[j].offset, storageAlignment) != 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3769 | skip |= log_msg( |
| 3770 | device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, |
| 3771 | VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, VALIDATION_ERROR_00945, LayerName, |
| 3772 | "vkUpdateDescriptorSets(): pDescriptorWrites[%d].pBufferInfo[%d].offset (0x%" PRIxLEAST64 |
| 3773 | ") must be a multiple of device limit minStorageBufferOffsetAlignment 0x%" PRIxLEAST64 ". %s", |
| 3774 | i, j, pDescriptorWrites[i].pBufferInfo[j].offset, storageAlignment, |
| 3775 | validation_error_map[VALIDATION_ERROR_00945]); |
Mark Lobodzinski | 1a34d7e | 2016-06-28 11:51:16 -0600 | [diff] [blame] | 3776 | } |
| 3777 | } |
| 3778 | } |
| 3779 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3780 | } |
| 3781 | } |
| 3782 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3783 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3784 | device_data->dispatch_table.UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, |
| 3785 | pDescriptorCopies); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3786 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3787 | } |
| 3788 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3789 | VKAPI_ATTR VkResult VKAPI_CALL CreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3790 | const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3791 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3792 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3793 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3794 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3795 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3796 | skip |= parameter_validation_vkCreateFramebuffer(my_data->report_data, pCreateInfo, pAllocator, pFramebuffer); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3797 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3798 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3799 | result = my_data->dispatch_table.CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3800 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3801 | validate_result(my_data->report_data, "vkCreateFramebuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3802 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3803 | |
| 3804 | return result; |
| 3805 | } |
| 3806 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3807 | VKAPI_ATTR void VKAPI_CALL DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3808 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3809 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3810 | assert(my_data != NULL); |
| 3811 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3812 | skip |= parameter_validation_vkDestroyFramebuffer(my_data->report_data, framebuffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3813 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3814 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3815 | my_data->dispatch_table.DestroyFramebuffer(device, framebuffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3816 | } |
| 3817 | } |
| 3818 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 3819 | static bool PreCreateRenderPass(layer_data *dev_data, const VkRenderPassCreateInfo *pCreateInfo) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3820 | bool skip = false; |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3821 | uint32_t max_color_attachments = dev_data->device_limits.maxColorAttachments; |
| 3822 | |
Mark Lobodzinski | e907fe4 | 2017-01-27 14:50:23 -0700 | [diff] [blame] | 3823 | for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) { |
| 3824 | if (pCreateInfo->pAttachments[i].format == VK_FORMAT_UNDEFINED) { |
| 3825 | std::stringstream ss; |
| 3826 | ss << "vkCreateRenderPass: pCreateInfo->pAttachments[" << i << "].format is VK_FORMAT_UNDEFINED. " |
| 3827 | << validation_error_map[VALIDATION_ERROR_00336]; |
Mark Lobodzinski | eb9e73f | 2017-04-13 10:06:48 -0600 | [diff] [blame] | 3828 | skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3829 | __LINE__, VALIDATION_ERROR_00336, "IMAGE", "%s", ss.str().c_str()); |
Mark Lobodzinski | e907fe4 | 2017-01-27 14:50:23 -0700 | [diff] [blame] | 3830 | } |
| 3831 | } |
| 3832 | |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3833 | for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { |
| 3834 | if (pCreateInfo->pSubpasses[i].colorAttachmentCount > max_color_attachments) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3835 | skip |= |
| 3836 | log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3837 | VALIDATION_ERROR_00348, "DL", "Cannot create a render pass with %d color attachments. Max is %d. %s", |
| 3838 | pCreateInfo->pSubpasses[i].colorAttachmentCount, max_color_attachments, |
| 3839 | validation_error_map[VALIDATION_ERROR_00348]); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3840 | } |
| 3841 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3842 | return skip; |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3843 | } |
| 3844 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3845 | VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3846 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3847 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3848 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3849 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3850 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3851 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3852 | skip |= parameter_validation_vkCreateRenderPass(my_data->report_data, pCreateInfo, pAllocator, pRenderPass); |
| 3853 | skip |= PreCreateRenderPass(my_data, pCreateInfo); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3854 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3855 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3856 | result = my_data->dispatch_table.CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3857 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3858 | validate_result(my_data->report_data, "vkCreateRenderPass", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3859 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3860 | |
| 3861 | return result; |
| 3862 | } |
| 3863 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3864 | VKAPI_ATTR void VKAPI_CALL DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3865 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3866 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3867 | assert(my_data != NULL); |
| 3868 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3869 | skip |= parameter_validation_vkDestroyRenderPass(my_data->report_data, renderPass, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3870 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3871 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3872 | my_data->dispatch_table.DestroyRenderPass(device, renderPass, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3873 | } |
| 3874 | } |
| 3875 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3876 | VKAPI_ATTR void VKAPI_CALL GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3877 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3878 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3879 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3880 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3881 | skip |= parameter_validation_vkGetRenderAreaGranularity(my_data->report_data, renderPass, pGranularity); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3882 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3883 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3884 | my_data->dispatch_table.GetRenderAreaGranularity(device, renderPass, pGranularity); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3885 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3886 | } |
| 3887 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3888 | VKAPI_ATTR VkResult VKAPI_CALL CreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3889 | const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3890 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3891 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3892 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3893 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3894 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3895 | skip |= |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 3896 | validate_queue_family_index(my_data, "vkCreateCommandPool", "pCreateInfo->queueFamilyIndex", pCreateInfo->queueFamilyIndex); |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 3897 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3898 | skip |= parameter_validation_vkCreateCommandPool(my_data->report_data, pCreateInfo, pAllocator, pCommandPool); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3899 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3900 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3901 | result = my_data->dispatch_table.CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3902 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3903 | validate_result(my_data->report_data, "vkCreateCommandPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3904 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3905 | |
| 3906 | return result; |
| 3907 | } |
| 3908 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3909 | VKAPI_ATTR void VKAPI_CALL DestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3910 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3911 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3912 | assert(my_data != NULL); |
| 3913 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3914 | skip |= parameter_validation_vkDestroyCommandPool(my_data->report_data, commandPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3915 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3916 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3917 | my_data->dispatch_table.DestroyCommandPool(device, commandPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3918 | } |
| 3919 | } |
| 3920 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3921 | VKAPI_ATTR VkResult VKAPI_CALL ResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3922 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3923 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3924 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3925 | assert(my_data != NULL); |
| 3926 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3927 | skip |= parameter_validation_vkResetCommandPool(my_data->report_data, commandPool, flags); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3928 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3929 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3930 | result = my_data->dispatch_table.ResetCommandPool(device, commandPool, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3931 | |
| 3932 | validate_result(my_data->report_data, "vkResetCommandPool", result); |
| 3933 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3934 | |
| 3935 | return result; |
| 3936 | } |
| 3937 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3938 | VKAPI_ATTR VkResult VKAPI_CALL AllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, |
| 3939 | VkCommandBuffer *pCommandBuffers) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3940 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3941 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3942 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3943 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3944 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3945 | skip |= parameter_validation_vkAllocateCommandBuffers(my_data->report_data, pAllocateInfo, pCommandBuffers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3946 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3947 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3948 | result = my_data->dispatch_table.AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3949 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3950 | validate_result(my_data->report_data, "vkAllocateCommandBuffers", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3951 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3952 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 3953 | return result; |
| 3954 | } |
| 3955 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3956 | VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3957 | const VkCommandBuffer *pCommandBuffers) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3958 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3959 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3960 | assert(device_data != nullptr); |
| 3961 | debug_report_data *report_data = device_data->report_data; |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3962 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3963 | skip |= parameter_validation_vkFreeCommandBuffers(report_data, commandPool, commandBufferCount, pCommandBuffers); |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3964 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3965 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 3966 | // This is an array of handles, where the elements are allowed to be VK_NULL_HANDLE, and does not require any validation beyond |
| 3967 | // validate_array() |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3968 | skip |= validate_array(report_data, "vkFreeCommandBuffers", "commandBufferCount", "pCommandBuffers", commandBufferCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3969 | pCommandBuffers, true, true); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3970 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3971 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3972 | device_data->dispatch_table.FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 3973 | } |
| 3974 | } |
| 3975 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 3976 | static bool PreBeginCommandBuffer(layer_data *dev_data, VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3977 | bool skip = false; |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3978 | const VkCommandBufferInheritanceInfo *pInfo = pBeginInfo->pInheritanceInfo; |
| 3979 | |
| 3980 | if (pInfo != NULL) { |
Chris Forbes | c5554a5 | 2016-11-24 14:45:16 +1300 | [diff] [blame] | 3981 | if ((dev_data->physical_device_features.inheritedQueries == VK_FALSE) && (pInfo->occlusionQueryEnable != VK_FALSE)) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3982 | skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, |
| 3983 | reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00116, LayerName, |
| 3984 | "Cannot set inherited occlusionQueryEnable in vkBeginCommandBuffer() when device does not support " |
| 3985 | "inheritedQueries. %s", |
| 3986 | validation_error_map[VALIDATION_ERROR_00116]); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3987 | } |
Mark Lobodzinski | 38df456 | 2016-12-15 13:06:55 -0700 | [diff] [blame] | 3988 | // VALIDATION_ERROR_00117 check |
| 3989 | if ((dev_data->physical_device_features.inheritedQueries != VK_FALSE) && (pInfo->occlusionQueryEnable != VK_FALSE)) { |
| 3990 | skip |= validate_flags(dev_data->report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->queryFlags", |
| 3991 | "VkQueryControlFlagBits", AllVkQueryControlFlagBits, pInfo->queryFlags, false); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3992 | } |
| 3993 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3994 | return skip; |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3995 | } |
| 3996 | |
| 3997 | VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3998 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3999 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4000 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4001 | assert(device_data != nullptr); |
| 4002 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4003 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4004 | skip |= parameter_validation_vkBeginCommandBuffer(report_data, pBeginInfo); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4005 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4006 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 4007 | // TODO: pBeginInfo->pInheritanceInfo must not be NULL if commandBuffer is a secondary command buffer |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4008 | skip |= validate_struct_type(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4009 | "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO", pBeginInfo->pInheritanceInfo, |
| 4010 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO, false); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4011 | |
| 4012 | if (pBeginInfo->pInheritanceInfo != NULL) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4013 | skip |= validate_struct_pnext(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->pNext", NULL, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4014 | pBeginInfo->pInheritanceInfo->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 4015 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4016 | skip |= validate_bool32(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->occlusionQueryEnable", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4017 | pBeginInfo->pInheritanceInfo->occlusionQueryEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 4018 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4019 | // TODO: This only needs to be validated when the inherited queries feature is enabled |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4020 | // skip |= validate_flags(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->queryFlags", |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4021 | // "VkQueryControlFlagBits", AllVkQueryControlFlagBits, pBeginInfo->pInheritanceInfo->queryFlags, false); |
| 4022 | |
| 4023 | // TODO: This must be 0 if the pipeline statistics queries feature is not enabled |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4024 | skip |= validate_flags(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->pipelineStatistics", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4025 | "VkQueryPipelineStatisticFlagBits", AllVkQueryPipelineStatisticFlagBits, |
| 4026 | pBeginInfo->pInheritanceInfo->pipelineStatistics, false); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4027 | } |
| 4028 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4029 | skip |= PreBeginCommandBuffer(device_data, commandBuffer, pBeginInfo); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 4030 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4031 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4032 | result = device_data->dispatch_table.BeginCommandBuffer(commandBuffer, pBeginInfo); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4033 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4034 | validate_result(report_data, "vkBeginCommandBuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4035 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4036 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4037 | return result; |
| 4038 | } |
| 4039 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4040 | VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer(VkCommandBuffer commandBuffer) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4041 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4042 | assert(my_data != NULL); |
| 4043 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4044 | VkResult result = my_data->dispatch_table.EndCommandBuffer(commandBuffer); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4045 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4046 | validate_result(my_data->report_data, "vkEndCommandBuffer", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4047 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4048 | return result; |
| 4049 | } |
| 4050 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4051 | VKAPI_ATTR VkResult VKAPI_CALL ResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) { |
Dustin Graves | 16d1897 | 2016-05-09 17:36:57 -0600 | [diff] [blame] | 4052 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4053 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4054 | assert(my_data != NULL); |
| 4055 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4056 | bool skip = parameter_validation_vkResetCommandBuffer(my_data->report_data, flags); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4057 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4058 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4059 | result = my_data->dispatch_table.ResetCommandBuffer(commandBuffer, flags); |
Dustin Graves | 16d1897 | 2016-05-09 17:36:57 -0600 | [diff] [blame] | 4060 | |
| 4061 | validate_result(my_data->report_data, "vkResetCommandBuffer", result); |
| 4062 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4063 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4064 | return result; |
| 4065 | } |
| 4066 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4067 | VKAPI_ATTR void VKAPI_CALL CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, |
| 4068 | VkPipeline pipeline) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4069 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4070 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4071 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4072 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4073 | skip |= parameter_validation_vkCmdBindPipeline(my_data->report_data, pipelineBindPoint, pipeline); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4074 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4075 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4076 | my_data->dispatch_table.CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4077 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4078 | } |
| 4079 | |
Mark Lobodzinski | 147e692 | 2017-03-01 15:45:52 -0700 | [diff] [blame] | 4080 | static bool preCmdSetViewport(layer_data *my_data, uint32_t first_viewport, uint32_t viewport_count, const VkViewport *viewports) { |
Mike Weiblen | 2906c9a | 2016-10-31 21:04:10 -0600 | [diff] [blame] | 4081 | debug_report_data *report_data = my_data->report_data; |
| 4082 | |
Mark Lobodzinski | 5a24296 | 2016-10-28 12:57:23 -0600 | [diff] [blame] | 4083 | bool skip = |
| 4084 | validate_array(report_data, "vkCmdSetViewport", "viewportCount", "pViewports", viewport_count, viewports, true, true); |
Mike Weiblen | 2906c9a | 2016-10-31 21:04:10 -0600 | [diff] [blame] | 4085 | |
| 4086 | if (viewport_count > 0 && viewports != nullptr) { |
| 4087 | const VkPhysicalDeviceLimits &limits = my_data->device_limits; |
| 4088 | for (uint32_t viewportIndex = 0; viewportIndex < viewport_count; ++viewportIndex) { |
| 4089 | const VkViewport &viewport = viewports[viewportIndex]; |
| 4090 | |
Mark Lobodzinski | 147e692 | 2017-03-01 15:45:52 -0700 | [diff] [blame] | 4091 | if (my_data->physical_device_features.multiViewport == false) { |
| 4092 | if (viewport_count != 1) { |
| 4093 | skip |= log_msg( |
| 4094 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4095 | DEVICE_FEATURE, LayerName, |
| 4096 | "vkCmdSetViewport(): The multiViewport feature is not enabled, so viewportCount must be 1 but is %d.", |
| 4097 | viewport_count); |
| 4098 | } |
| 4099 | if (first_viewport != 0) { |
| 4100 | skip |= log_msg( |
| 4101 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4102 | DEVICE_FEATURE, LayerName, |
| 4103 | "vkCmdSetViewport(): The multiViewport feature is not enabled, so firstViewport must be 0 but is %d.", |
| 4104 | first_viewport); |
| 4105 | } |
| 4106 | } |
| 4107 | |
Mike Weiblen | 2906c9a | 2016-10-31 21:04:10 -0600 | [diff] [blame] | 4108 | if (viewport.width <= 0 || viewport.width > limits.maxViewportDimensions[0]) { |
| 4109 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4110 | VALIDATION_ERROR_01448, LayerName, |
| 4111 | "vkCmdSetViewport %d: width (%f) exceeds permitted bounds (0,%u). %s", viewportIndex, |
| 4112 | viewport.width, limits.maxViewportDimensions[0], validation_error_map[VALIDATION_ERROR_01448]); |
| 4113 | } |
| 4114 | |
| 4115 | bool invalid_height = (viewport.height <= 0 || viewport.height > limits.maxViewportDimensions[1]); |
Mark Lobodzinski | 885790e | 2017-03-09 11:54:48 -0700 | [diff] [blame] | 4116 | if ((my_data->enables.amd_negative_viewport_height || my_data->enables.khr_maintenance1) && (viewport.height < 0)) { |
Mike Weiblen | 2906c9a | 2016-10-31 21:04:10 -0600 | [diff] [blame] | 4117 | // VALIDATION_ERROR_01790 |
| 4118 | invalid_height = false; |
| 4119 | } |
| 4120 | if (invalid_height) { |
| 4121 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4122 | VALIDATION_ERROR_01449, LayerName, |
| 4123 | "vkCmdSetViewport %d: height (%f) exceeds permitted bounds (0,%u). %s", viewportIndex, |
| 4124 | viewport.height, limits.maxViewportDimensions[1], validation_error_map[VALIDATION_ERROR_01449]); |
| 4125 | } |
| 4126 | |
| 4127 | if (viewport.x < limits.viewportBoundsRange[0] || viewport.x > limits.viewportBoundsRange[1]) { |
| 4128 | skip |= |
| 4129 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4130 | VALIDATION_ERROR_01450, LayerName, "vkCmdSetViewport %d: x (%f) exceeds permitted bounds (%f,%f). %s", |
| 4131 | viewportIndex, viewport.x, limits.viewportBoundsRange[0], limits.viewportBoundsRange[1], |
| 4132 | validation_error_map[VALIDATION_ERROR_01450]); |
| 4133 | } |
| 4134 | |
| 4135 | if (viewport.y < limits.viewportBoundsRange[0] || viewport.y > limits.viewportBoundsRange[1]) { |
| 4136 | skip |= |
| 4137 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4138 | VALIDATION_ERROR_01450, LayerName, "vkCmdSetViewport %d: y (%f) exceeds permitted bounds (%f,%f). %s", |
| 4139 | viewportIndex, viewport.y, limits.viewportBoundsRange[0], limits.viewportBoundsRange[1], |
| 4140 | validation_error_map[VALIDATION_ERROR_01450]); |
| 4141 | } |
| 4142 | |
| 4143 | if (viewport.x + viewport.width > limits.viewportBoundsRange[1]) { |
| 4144 | skip |= |
| 4145 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4146 | VALIDATION_ERROR_01451, LayerName, |
| 4147 | "vkCmdSetViewport %d: x (%f) + width (%f) exceeds permitted bound (%f). %s", viewportIndex, viewport.x, |
| 4148 | viewport.width, limits.viewportBoundsRange[1], validation_error_map[VALIDATION_ERROR_01451]); |
| 4149 | } |
| 4150 | |
| 4151 | if (viewport.y + viewport.height > limits.viewportBoundsRange[1]) { |
| 4152 | skip |= |
| 4153 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4154 | VALIDATION_ERROR_01452, LayerName, |
| 4155 | "vkCmdSetViewport %d: y (%f) + height (%f) exceeds permitted bound (%f). %s", viewportIndex, viewport.y, |
| 4156 | viewport.height, limits.viewportBoundsRange[1], validation_error_map[VALIDATION_ERROR_01452]); |
| 4157 | } |
| 4158 | } |
| 4159 | } |
| 4160 | |
Mark Lobodzinski | 5a24296 | 2016-10-28 12:57:23 -0600 | [diff] [blame] | 4161 | return skip; |
| 4162 | } |
| 4163 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4164 | VKAPI_ATTR void VKAPI_CALL CmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, |
| 4165 | const VkViewport *pViewports) { |
Mark Lobodzinski | b79b773 | 2016-10-28 12:59:47 -0600 | [diff] [blame] | 4166 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4167 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4168 | assert(my_data != NULL); |
| 4169 | |
Mark Lobodzinski | 147e692 | 2017-03-01 15:45:52 -0700 | [diff] [blame] | 4170 | skip |= preCmdSetViewport(my_data, firstViewport, viewportCount, pViewports); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4171 | |
Mark Lobodzinski | b79b773 | 2016-10-28 12:59:47 -0600 | [diff] [blame] | 4172 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4173 | my_data->dispatch_table.CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4174 | } |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 4175 | } |
| 4176 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4177 | VKAPI_ATTR void VKAPI_CALL CmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, |
| 4178 | const VkRect2D *pScissors) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4179 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4180 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4181 | assert(my_data != NULL); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4182 | debug_report_data *report_data = my_data->report_data; |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4183 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4184 | skip |= parameter_validation_vkCmdSetScissor(my_data->report_data, firstScissor, scissorCount, pScissors); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4185 | |
Mark Lobodzinski | 147e692 | 2017-03-01 15:45:52 -0700 | [diff] [blame] | 4186 | if (my_data->physical_device_features.multiViewport == false) { |
| 4187 | if (scissorCount != 1) { |
| 4188 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4189 | DEVICE_FEATURE, LayerName, |
| 4190 | "vkCmdSetScissor(): The multiViewport feature is not enabled, so scissorCount must be 1 but is %d.", |
| 4191 | scissorCount); |
| 4192 | } |
| 4193 | if (firstScissor != 0) { |
| 4194 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4195 | DEVICE_FEATURE, LayerName, |
| 4196 | "vkCmdSetScissor(): The multiViewport feature is not enabled, so firstScissor must be 0 but is %d.", |
| 4197 | firstScissor); |
| 4198 | } |
| 4199 | } |
| 4200 | |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4201 | for (uint32_t scissorIndex = 0; scissorIndex < scissorCount; ++scissorIndex) { |
| 4202 | const VkRect2D &pScissor = pScissors[scissorIndex]; |
| 4203 | |
| 4204 | if (pScissor.offset.x < 0) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4205 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4206 | VALIDATION_ERROR_01489, LayerName, "vkCmdSetScissor %d: offset.x (%d) must not be negative. %s", |
| 4207 | scissorIndex, pScissor.offset.x, validation_error_map[VALIDATION_ERROR_01489]); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4208 | } else if (static_cast<int32_t>(pScissor.extent.width) > (INT_MAX - pScissor.offset.x)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4209 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4210 | VALIDATION_ERROR_01490, LayerName, |
| 4211 | "vkCmdSetScissor %d: adding offset.x (%d) and extent.width (%u) will overflow. %s", scissorIndex, |
| 4212 | pScissor.offset.x, pScissor.extent.width, validation_error_map[VALIDATION_ERROR_01490]); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4213 | } |
| 4214 | |
| 4215 | if (pScissor.offset.y < 0) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4216 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4217 | VALIDATION_ERROR_01489, LayerName, "vkCmdSetScissor %d: offset.y (%d) must not be negative. %s", |
| 4218 | scissorIndex, pScissor.offset.y, validation_error_map[VALIDATION_ERROR_01489]); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4219 | } else if (static_cast<int32_t>(pScissor.extent.height) > (INT_MAX - pScissor.offset.y)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4220 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4221 | VALIDATION_ERROR_01491, LayerName, |
| 4222 | "vkCmdSetScissor %d: adding offset.y (%d) and extent.height (%u) will overflow. %s", scissorIndex, |
| 4223 | pScissor.offset.y, pScissor.extent.height, validation_error_map[VALIDATION_ERROR_01491]); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4224 | } |
| 4225 | } |
| 4226 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4227 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4228 | my_data->dispatch_table.CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4229 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4230 | } |
| 4231 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4232 | VKAPI_ATTR void VKAPI_CALL CmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4233 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4234 | my_data->dispatch_table.CmdSetLineWidth(commandBuffer, lineWidth); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4235 | } |
| 4236 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4237 | VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, |
| 4238 | float depthBiasSlopeFactor) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4239 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4240 | my_data->dispatch_table.CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4241 | } |
| 4242 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4243 | VKAPI_ATTR void VKAPI_CALL CmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4244 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4245 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4246 | assert(my_data != NULL); |
| 4247 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4248 | skip |= parameter_validation_vkCmdSetBlendConstants(my_data->report_data, blendConstants); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4249 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4250 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4251 | my_data->dispatch_table.CmdSetBlendConstants(commandBuffer, blendConstants); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4252 | } |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 4253 | } |
| 4254 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4255 | VKAPI_ATTR void VKAPI_CALL CmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4256 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4257 | my_data->dispatch_table.CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 4258 | } |
| 4259 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4260 | VKAPI_ATTR void VKAPI_CALL CmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, |
| 4261 | uint32_t compareMask) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4262 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4263 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4264 | assert(my_data != NULL); |
| 4265 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4266 | skip |= parameter_validation_vkCmdSetStencilCompareMask(my_data->report_data, faceMask, compareMask); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4267 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4268 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4269 | my_data->dispatch_table.CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4270 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4271 | } |
| 4272 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4273 | VKAPI_ATTR void VKAPI_CALL CmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4274 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4275 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4276 | assert(my_data != NULL); |
| 4277 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4278 | skip |= parameter_validation_vkCmdSetStencilWriteMask(my_data->report_data, faceMask, writeMask); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4279 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4280 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4281 | my_data->dispatch_table.CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4282 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4283 | } |
| 4284 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4285 | VKAPI_ATTR void VKAPI_CALL CmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4286 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4287 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4288 | assert(my_data != NULL); |
| 4289 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4290 | skip |= parameter_validation_vkCmdSetStencilReference(my_data->report_data, faceMask, reference); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4291 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4292 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4293 | my_data->dispatch_table.CmdSetStencilReference(commandBuffer, faceMask, reference); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4294 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4295 | } |
| 4296 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4297 | VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, |
| 4298 | VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, |
| 4299 | const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, |
| 4300 | const uint32_t *pDynamicOffsets) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4301 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4302 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4303 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4304 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4305 | skip |= parameter_validation_vkCmdBindDescriptorSets(my_data->report_data, pipelineBindPoint, layout, firstSet, |
| 4306 | descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4307 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4308 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4309 | my_data->dispatch_table.CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, |
| 4310 | pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4311 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4312 | } |
| 4313 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4314 | VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 4315 | VkIndexType indexType) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4316 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4317 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4318 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4319 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4320 | skip |= parameter_validation_vkCmdBindIndexBuffer(my_data->report_data, buffer, offset, indexType); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4321 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4322 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4323 | my_data->dispatch_table.CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4324 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4325 | } |
| 4326 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4327 | VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, |
| 4328 | const VkBuffer *pBuffers, const VkDeviceSize *pOffsets) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4329 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4330 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4331 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4332 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4333 | skip |= parameter_validation_vkCmdBindVertexBuffers(my_data->report_data, firstBinding, bindingCount, pBuffers, pOffsets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4334 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4335 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4336 | my_data->dispatch_table.CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4337 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4338 | } |
| 4339 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4340 | static bool PreCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4341 | uint32_t firstInstance) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4342 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 4343 | if (vertexCount == 0) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4344 | // 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] | 4345 | // this an error or leave as is. |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4346 | log_msg(my_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 4347 | REQUIRED_PARAMETER, LayerName, "vkCmdDraw parameter, uint32_t vertexCount, is 0"); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 4348 | return false; |
| 4349 | } |
| 4350 | |
| 4351 | if (instanceCount == 0) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4352 | // 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] | 4353 | // this an error or leave as is. |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4354 | log_msg(my_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 4355 | REQUIRED_PARAMETER, LayerName, "vkCmdDraw parameter, uint32_t instanceCount, is 0"); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 4356 | return false; |
| 4357 | } |
| 4358 | |
| 4359 | return true; |
| 4360 | } |
| 4361 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4362 | VKAPI_ATTR void VKAPI_CALL CmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, |
| 4363 | uint32_t firstVertex, uint32_t firstInstance) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4364 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4365 | PreCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 4366 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4367 | my_data->dispatch_table.CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4368 | } |
| 4369 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4370 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, |
| 4371 | uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4372 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4373 | my_data->dispatch_table.CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4374 | } |
| 4375 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4376 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, |
| 4377 | uint32_t stride) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4378 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4379 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4380 | assert(my_data != NULL); |
| 4381 | |
Mark Lobodzinski | 33d8c9b | 2017-02-28 14:18:04 -0700 | [diff] [blame] | 4382 | if (!my_data->physical_device_features.multiDrawIndirect && ((count > 1))) { |
| 4383 | skip = log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4384 | DEVICE_FEATURE, LayerName, |
| 4385 | "CmdDrawIndirect(): Device feature multiDrawIndirect disabled: count must be 0 or 1 but is %d", count); |
| 4386 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4387 | skip |= parameter_validation_vkCmdDrawIndirect(my_data->report_data, buffer, offset, count, stride); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4388 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4389 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4390 | my_data->dispatch_table.CmdDrawIndirect(commandBuffer, buffer, offset, count, stride); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4391 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4392 | } |
| 4393 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4394 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 4395 | uint32_t count, uint32_t stride) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4396 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4397 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4398 | assert(my_data != NULL); |
Mark Lobodzinski | 33d8c9b | 2017-02-28 14:18:04 -0700 | [diff] [blame] | 4399 | if (!my_data->physical_device_features.multiDrawIndirect && ((count > 1))) { |
| 4400 | skip = |
| 4401 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4402 | DEVICE_FEATURE, LayerName, |
| 4403 | "CmdDrawIndexedIndirect(): Device feature multiDrawIndirect disabled: count must be 0 or 1 but is %d", count); |
| 4404 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4405 | skip |= parameter_validation_vkCmdDrawIndexedIndirect(my_data->report_data, buffer, offset, count, stride); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4406 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4407 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4408 | my_data->dispatch_table.CmdDrawIndexedIndirect(commandBuffer, buffer, offset, count, stride); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4409 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4410 | } |
| 4411 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4412 | VKAPI_ATTR void VKAPI_CALL CmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4413 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4414 | my_data->dispatch_table.CmdDispatch(commandBuffer, x, y, z); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4415 | } |
| 4416 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4417 | VKAPI_ATTR void VKAPI_CALL CmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4418 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4419 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4420 | assert(my_data != NULL); |
| 4421 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4422 | skip |= parameter_validation_vkCmdDispatchIndirect(my_data->report_data, buffer, offset); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4423 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4424 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4425 | my_data->dispatch_table.CmdDispatchIndirect(commandBuffer, buffer, offset); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4426 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4427 | } |
| 4428 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4429 | VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, |
| 4430 | uint32_t regionCount, const VkBufferCopy *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4431 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4432 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4433 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4434 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4435 | skip |= parameter_validation_vkCmdCopyBuffer(my_data->report_data, srcBuffer, dstBuffer, regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4436 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4437 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4438 | my_data->dispatch_table.CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4439 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4440 | } |
| 4441 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4442 | static bool PreCmdCopyImage(VkCommandBuffer commandBuffer, const VkImageCopy *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4443 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4444 | if (pRegions != nullptr) { |
| 4445 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4446 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4447 | log_msg( |
| 4448 | my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4449 | VALIDATION_ERROR_01225, LayerName, |
| 4450 | "vkCmdCopyImage() parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator. %s", |
| 4451 | validation_error_map[VALIDATION_ERROR_01225]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4452 | return false; |
| 4453 | } |
| 4454 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4455 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4456 | log_msg( |
| 4457 | my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4458 | VALIDATION_ERROR_01225, LayerName, |
| 4459 | "vkCmdCopyImage() parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator. %s", |
| 4460 | validation_error_map[VALIDATION_ERROR_01225]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4461 | return false; |
| 4462 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4463 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4464 | |
| 4465 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4466 | } |
| 4467 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4468 | VKAPI_ATTR void VKAPI_CALL CmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 4469 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
| 4470 | const VkImageCopy *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4471 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4472 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4473 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4474 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4475 | skip |= parameter_validation_vkCmdCopyImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4476 | regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4477 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4478 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4479 | PreCmdCopyImage(commandBuffer, pRegions); |
| 4480 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4481 | my_data->dispatch_table.CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
| 4482 | pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4483 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4484 | } |
| 4485 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4486 | static bool PreCmdBlitImage(VkCommandBuffer commandBuffer, const VkImageBlit *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4487 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4488 | if (pRegions != nullptr) { |
| 4489 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4490 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4491 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 4492 | UNRECOGNIZED_VALUE, LayerName, |
Mike Weiblen | fa0fd07 | 2017-01-06 16:20:51 -0700 | [diff] [blame] | 4493 | "vkCmdBlitImage() parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4494 | return false; |
| 4495 | } |
| 4496 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4497 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4498 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 4499 | UNRECOGNIZED_VALUE, LayerName, |
Mike Weiblen | fa0fd07 | 2017-01-06 16:20:51 -0700 | [diff] [blame] | 4500 | "vkCmdBlitImage() parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4501 | return false; |
| 4502 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4503 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4504 | |
| 4505 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4506 | } |
| 4507 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4508 | VKAPI_ATTR void VKAPI_CALL CmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 4509 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
| 4510 | const VkImageBlit *pRegions, VkFilter filter) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4511 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4512 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4513 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4514 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4515 | skip |= parameter_validation_vkCmdBlitImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4516 | regionCount, pRegions, filter); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4517 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4518 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4519 | PreCmdBlitImage(commandBuffer, pRegions); |
| 4520 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4521 | my_data->dispatch_table.CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
| 4522 | pRegions, filter); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4523 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4524 | } |
| 4525 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4526 | static bool PreCmdCopyBufferToImage(VkCommandBuffer commandBuffer, const VkBufferImageCopy *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4527 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4528 | if (pRegions != nullptr) { |
| 4529 | if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4530 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4531 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 4532 | UNRECOGNIZED_VALUE, LayerName, |
Mike Weiblen | fa0fd07 | 2017-01-06 16:20:51 -0700 | [diff] [blame] | 4533 | "vkCmdCopyBufferToImage() parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4534 | "enumerator"); |
| 4535 | return false; |
| 4536 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4537 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4538 | |
| 4539 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4540 | } |
| 4541 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4542 | VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, |
| 4543 | VkImageLayout dstImageLayout, uint32_t regionCount, |
| 4544 | const VkBufferImageCopy *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4545 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4546 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4547 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4548 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4549 | skip |= parameter_validation_vkCmdCopyBufferToImage(my_data->report_data, srcBuffer, dstImage, dstImageLayout, regionCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4550 | pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4551 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4552 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4553 | PreCmdCopyBufferToImage(commandBuffer, pRegions); |
| 4554 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4555 | my_data->dispatch_table.CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4556 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4557 | } |
| 4558 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4559 | static bool PreCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, const VkBufferImageCopy *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4560 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4561 | if (pRegions != nullptr) { |
| 4562 | if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4563 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4564 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 4565 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4566 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " |
| 4567 | "enumerator"); |
| 4568 | return false; |
| 4569 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4570 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4571 | |
| 4572 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4573 | } |
| 4574 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4575 | VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 4576 | VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4577 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4578 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4579 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4580 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4581 | skip |= parameter_validation_vkCmdCopyImageToBuffer(my_data->report_data, srcImage, srcImageLayout, dstBuffer, regionCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4582 | pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4583 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4584 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4585 | PreCmdCopyImageToBuffer(commandBuffer, pRegions); |
| 4586 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4587 | my_data->dispatch_table.CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4588 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4589 | } |
| 4590 | |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4591 | VKAPI_ATTR void VKAPI_CALL CmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
Mark Lobodzinski | a2d9384 | 2017-02-08 16:28:18 -0700 | [diff] [blame] | 4592 | VkDeviceSize dataSize, const void *pData) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4593 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4594 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4595 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4596 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4597 | skip |= parameter_validation_vkCmdUpdateBuffer(my_data->report_data, dstBuffer, dstOffset, dataSize, pData); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4598 | |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4599 | if (dstOffset & 3) { |
Mark Lobodzinski | 2d9de65 | 2017-04-24 08:58:52 -0600 | [diff] [blame] | 4600 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4601 | VALIDATION_ERROR_01147, LayerName, |
| 4602 | "vkCmdUpdateBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", |
| 4603 | dstOffset, validation_error_map[VALIDATION_ERROR_01147]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4604 | } |
| 4605 | |
| 4606 | if ((dataSize <= 0) || (dataSize > 65536)) { |
Mark Lobodzinski | 2d9de65 | 2017-04-24 08:58:52 -0600 | [diff] [blame] | 4607 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4608 | VALIDATION_ERROR_01148, LayerName, "vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64 |
| 4609 | "), must be greater than zero and less than or equal to 65536. %s", |
| 4610 | dataSize, validation_error_map[VALIDATION_ERROR_01148]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4611 | } else if (dataSize & 3) { |
Mark Lobodzinski | 2d9de65 | 2017-04-24 08:58:52 -0600 | [diff] [blame] | 4612 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4613 | VALIDATION_ERROR_01149, LayerName, |
| 4614 | "vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", |
| 4615 | dataSize, validation_error_map[VALIDATION_ERROR_01149]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4616 | } |
| 4617 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4618 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4619 | my_data->dispatch_table.CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4620 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4621 | } |
| 4622 | |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4623 | VKAPI_ATTR void VKAPI_CALL CmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
| 4624 | VkDeviceSize size, uint32_t data) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4625 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4626 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4627 | assert(my_data != NULL); |
| 4628 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4629 | skip |= parameter_validation_vkCmdFillBuffer(my_data->report_data, dstBuffer, dstOffset, size, data); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4630 | |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4631 | if (dstOffset & 3) { |
Mark Lobodzinski | 2d9de65 | 2017-04-24 08:58:52 -0600 | [diff] [blame] | 4632 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4633 | VALIDATION_ERROR_01133, LayerName, |
| 4634 | "vkCmdFillBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", |
| 4635 | dstOffset, validation_error_map[VALIDATION_ERROR_01133]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4636 | } |
| 4637 | |
| 4638 | if (size != VK_WHOLE_SIZE) { |
| 4639 | if (size <= 0) { |
Mark Lobodzinski | 2d9de65 | 2017-04-24 08:58:52 -0600 | [diff] [blame] | 4640 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 4641 | __LINE__, VALIDATION_ERROR_01134, LayerName, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4642 | "vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), must be greater than zero. %s", |
| 4643 | size, validation_error_map[VALIDATION_ERROR_01134]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4644 | } else if (size & 3) { |
Mark Lobodzinski | 2d9de65 | 2017-04-24 08:58:52 -0600 | [diff] [blame] | 4645 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 4646 | __LINE__, VALIDATION_ERROR_01136, LayerName, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4647 | "vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", size, |
| 4648 | validation_error_map[VALIDATION_ERROR_01136]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4649 | } |
| 4650 | } |
| 4651 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4652 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4653 | my_data->dispatch_table.CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4654 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4655 | } |
| 4656 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4657 | VKAPI_ATTR void VKAPI_CALL CmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 4658 | const VkClearColorValue *pColor, uint32_t rangeCount, |
| 4659 | const VkImageSubresourceRange *pRanges) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4660 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4661 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4662 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4663 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4664 | skip |= parameter_validation_vkCmdClearColorImage(my_data->report_data, image, imageLayout, pColor, rangeCount, pRanges); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4665 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4666 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4667 | my_data->dispatch_table.CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4668 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4669 | } |
| 4670 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4671 | VKAPI_ATTR void VKAPI_CALL CmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 4672 | const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, |
| 4673 | const VkImageSubresourceRange *pRanges) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4674 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4675 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4676 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4677 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4678 | skip |= parameter_validation_vkCmdClearDepthStencilImage(my_data->report_data, image, imageLayout, pDepthStencil, rangeCount, |
| 4679 | pRanges); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4680 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4681 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4682 | my_data->dispatch_table.CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4683 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4684 | } |
| 4685 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4686 | VKAPI_ATTR void VKAPI_CALL CmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, |
| 4687 | const VkClearAttachment *pAttachments, uint32_t rectCount, |
| 4688 | const VkClearRect *pRects) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4689 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4690 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4691 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4692 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4693 | skip |= parameter_validation_vkCmdClearAttachments(my_data->report_data, attachmentCount, pAttachments, rectCount, pRects); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4694 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4695 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4696 | my_data->dispatch_table.CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4697 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4698 | } |
| 4699 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4700 | static bool PreCmdResolveImage(VkCommandBuffer commandBuffer, const VkImageResolve *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4701 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4702 | if (pRegions != nullptr) { |
| 4703 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4704 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 4705 | log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4706 | my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 4707 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4708 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
| 4709 | return false; |
| 4710 | } |
| 4711 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4712 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 4713 | log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4714 | my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
Mark Lobodzinski | bbe3d97 | 2016-06-29 10:53:51 -0600 | [diff] [blame] | 4715 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4716 | "vkCmdResolveImage parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
| 4717 | return false; |
| 4718 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4719 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4720 | |
| 4721 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4722 | } |
| 4723 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4724 | VKAPI_ATTR void VKAPI_CALL CmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 4725 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
| 4726 | const VkImageResolve *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4727 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4728 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4729 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4730 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4731 | skip |= parameter_validation_vkCmdResolveImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4732 | regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4733 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4734 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4735 | PreCmdResolveImage(commandBuffer, pRegions); |
| 4736 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4737 | my_data->dispatch_table.CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
| 4738 | pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4739 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4740 | } |
| 4741 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4742 | VKAPI_ATTR void VKAPI_CALL CmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4743 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4744 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4745 | assert(my_data != NULL); |
| 4746 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4747 | skip |= parameter_validation_vkCmdSetEvent(my_data->report_data, event, stageMask); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4748 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4749 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4750 | my_data->dispatch_table.CmdSetEvent(commandBuffer, event, stageMask); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4751 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4752 | } |
| 4753 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4754 | VKAPI_ATTR void VKAPI_CALL CmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4755 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4756 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4757 | assert(my_data != NULL); |
| 4758 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4759 | skip |= parameter_validation_vkCmdResetEvent(my_data->report_data, event, stageMask); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4760 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4761 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4762 | my_data->dispatch_table.CmdResetEvent(commandBuffer, event, stageMask); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4763 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4764 | } |
| 4765 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4766 | VKAPI_ATTR void VKAPI_CALL CmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, |
| 4767 | VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, |
| 4768 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 4769 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 4770 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4771 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4772 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4773 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4774 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4775 | skip |= parameter_validation_vkCmdWaitEvents(my_data->report_data, eventCount, pEvents, srcStageMask, dstStageMask, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4776 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, |
| 4777 | pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4778 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4779 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4780 | my_data->dispatch_table.CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, |
| 4781 | pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, |
| 4782 | imageMemoryBarrierCount, pImageMemoryBarriers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4783 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4784 | } |
| 4785 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4786 | VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, |
| 4787 | VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, |
| 4788 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 4789 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 4790 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4791 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4792 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4793 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4794 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4795 | skip |= parameter_validation_vkCmdPipelineBarrier(my_data->report_data, srcStageMask, dstStageMask, dependencyFlags, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4796 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, |
| 4797 | pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4798 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4799 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4800 | my_data->dispatch_table.CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, |
| 4801 | pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, |
| 4802 | imageMemoryBarrierCount, pImageMemoryBarriers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4803 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4804 | } |
| 4805 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4806 | VKAPI_ATTR void VKAPI_CALL CmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, |
| 4807 | VkQueryControlFlags flags) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4808 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4809 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4810 | assert(my_data != NULL); |
| 4811 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4812 | skip |= parameter_validation_vkCmdBeginQuery(my_data->report_data, queryPool, slot, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4813 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4814 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4815 | my_data->dispatch_table.CmdBeginQuery(commandBuffer, queryPool, slot, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4816 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4817 | } |
| 4818 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4819 | VKAPI_ATTR void VKAPI_CALL CmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4820 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4821 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4822 | assert(my_data != NULL); |
| 4823 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4824 | skip |= parameter_validation_vkCmdEndQuery(my_data->report_data, queryPool, slot); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4825 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4826 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4827 | my_data->dispatch_table.CmdEndQuery(commandBuffer, queryPool, slot); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4828 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4829 | } |
| 4830 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4831 | VKAPI_ATTR void VKAPI_CALL CmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, |
| 4832 | uint32_t queryCount) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4833 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4834 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4835 | assert(my_data != NULL); |
| 4836 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4837 | skip |= parameter_validation_vkCmdResetQueryPool(my_data->report_data, queryPool, firstQuery, queryCount); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4838 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4839 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4840 | my_data->dispatch_table.CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4841 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4842 | } |
| 4843 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4844 | bool PostCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, |
| 4845 | uint32_t slot) { |
Chia-I Wu | 51ce5ea | 2015-10-26 19:40:27 +0800 | [diff] [blame] | 4846 | ValidateEnumerator(pipelineStage); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4847 | |
| 4848 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4849 | } |
| 4850 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4851 | VKAPI_ATTR void VKAPI_CALL CmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, |
| 4852 | VkQueryPool queryPool, uint32_t query) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4853 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4854 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4855 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4856 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4857 | skip |= parameter_validation_vkCmdWriteTimestamp(my_data->report_data, pipelineStage, queryPool, query); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4858 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4859 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4860 | my_data->dispatch_table.CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4861 | |
| 4862 | PostCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query); |
| 4863 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4864 | } |
| 4865 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4866 | VKAPI_ATTR void VKAPI_CALL CmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, |
| 4867 | uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
| 4868 | VkDeviceSize stride, VkQueryResultFlags flags) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4869 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4870 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4871 | assert(my_data != NULL); |
| 4872 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4873 | skip |= parameter_validation_vkCmdCopyQueryPoolResults(my_data->report_data, queryPool, firstQuery, queryCount, dstBuffer, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4874 | dstOffset, stride, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4875 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4876 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4877 | my_data->dispatch_table.CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, |
| 4878 | stride, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4879 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4880 | } |
| 4881 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4882 | VKAPI_ATTR void VKAPI_CALL CmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, |
| 4883 | uint32_t offset, uint32_t size, const void *pValues) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4884 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4885 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4886 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4887 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4888 | skip |= parameter_validation_vkCmdPushConstants(my_data->report_data, layout, stageFlags, offset, size, pValues); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4889 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4890 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4891 | my_data->dispatch_table.CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4892 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4893 | } |
| 4894 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4895 | VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
| 4896 | VkSubpassContents contents) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4897 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4898 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4899 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4900 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4901 | skip |= parameter_validation_vkCmdBeginRenderPass(my_data->report_data, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4902 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4903 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4904 | my_data->dispatch_table.CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4905 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4906 | } |
| 4907 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4908 | VKAPI_ATTR void VKAPI_CALL CmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4909 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4910 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4911 | assert(my_data != NULL); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 4912 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4913 | skip |= parameter_validation_vkCmdNextSubpass(my_data->report_data, contents); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4914 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4915 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4916 | my_data->dispatch_table.CmdNextSubpass(commandBuffer, contents); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4917 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4918 | } |
| 4919 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4920 | VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass(VkCommandBuffer commandBuffer) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4921 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4922 | my_data->dispatch_table.CmdEndRenderPass(commandBuffer); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4923 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4924 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4925 | VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, |
| 4926 | const VkCommandBuffer *pCommandBuffers) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4927 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4928 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4929 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4930 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4931 | skip |= parameter_validation_vkCmdExecuteCommands(my_data->report_data, commandBufferCount, pCommandBuffers); |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 4932 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4933 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4934 | my_data->dispatch_table.CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4935 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 4936 | } |
| 4937 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4938 | VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 4939 | return util_GetLayerProperties(1, &global_layer, pCount, pProperties); |
| 4940 | } |
| 4941 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4942 | VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, |
| 4943 | VkLayerProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 4944 | return util_GetLayerProperties(1, &global_layer, pCount, pProperties); |
| 4945 | } |
| 4946 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4947 | VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, |
| 4948 | VkExtensionProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 4949 | if (pLayerName && !strcmp(pLayerName, global_layer.layerName)) |
| 4950 | return util_GetExtensionProperties(1, instance_extensions, pCount, pProperties); |
| 4951 | |
| 4952 | return VK_ERROR_LAYER_NOT_PRESENT; |
| 4953 | } |
| 4954 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4955 | VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, |
| 4956 | uint32_t *pCount, VkExtensionProperties *pProperties) { |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 4957 | /* parameter_validation does not have any physical device extensions */ |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 4958 | if (pLayerName && !strcmp(pLayerName, global_layer.layerName)) return util_GetExtensionProperties(0, NULL, pCount, pProperties); |
Chia-I Wu | 76a3466 | 2016-05-16 07:34:09 +0800 | [diff] [blame] | 4959 | |
| 4960 | assert(physicalDevice); |
| 4961 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4962 | return GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map) |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 4963 | ->dispatch_table.EnumerateDeviceExtensionProperties(physicalDevice, NULL, pCount, pProperties); |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 4964 | } |
| 4965 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4966 | static bool require_device_extension(layer_data *my_data, bool flag, char const *function_name, char const *extension_name) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 4967 | if (!flag) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4968 | return log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4969 | EXTENSION_NOT_ENABLED, LayerName, |
| 4970 | "%s() called even though the %s extension was not enabled for this VkDevice.", function_name, |
| 4971 | extension_name); |
Chris Forbes | 448ebcb | 2016-11-03 09:29:52 +1300 | [diff] [blame] | 4972 | } |
| 4973 | |
| 4974 | return false; |
| 4975 | } |
| 4976 | |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 4977 | // WSI Extension Functions |
| 4978 | |
| 4979 | VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4980 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 4981 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4982 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4983 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 4984 | assert(my_data != NULL); |
| 4985 | |
Chris Forbes | 481df4f | 2017-05-02 14:18:07 -0700 | [diff] [blame] | 4986 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain, "vkCreateSwapchainKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4987 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 4988 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4989 | skip |= parameter_validation_vkCreateSwapchainKHR(my_data->report_data, pCreateInfo, pAllocator, pSwapchain); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 4990 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4991 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4992 | result = my_data->dispatch_table.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 4993 | |
| 4994 | validate_result(my_data->report_data, "vkCreateSwapchainKHR", result); |
| 4995 | } |
| 4996 | |
| 4997 | return result; |
| 4998 | } |
| 4999 | |
| 5000 | VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5001 | VkImage *pSwapchainImages) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5002 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5003 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5004 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5005 | assert(my_data != NULL); |
| 5006 | |
Chris Forbes | 481df4f | 2017-05-02 14:18:07 -0700 | [diff] [blame] | 5007 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain, "vkGetSwapchainImagesKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5008 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5009 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5010 | skip |= parameter_validation_vkGetSwapchainImagesKHR(my_data->report_data, swapchain, pSwapchainImageCount, pSwapchainImages); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5011 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5012 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5013 | result = my_data->dispatch_table.GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5014 | |
| 5015 | validate_result(my_data->report_data, "vkGetSwapchainImagesKHR", result); |
| 5016 | } |
| 5017 | |
| 5018 | return result; |
| 5019 | } |
| 5020 | |
| 5021 | VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5022 | VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5023 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5024 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5025 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5026 | assert(my_data != NULL); |
| 5027 | |
Chris Forbes | 481df4f | 2017-05-02 14:18:07 -0700 | [diff] [blame] | 5028 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain, "vkAcquireNextImageKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5029 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5030 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5031 | skip |= parameter_validation_vkAcquireNextImageKHR(my_data->report_data, swapchain, timeout, semaphore, fence, pImageIndex); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5032 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5033 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5034 | result = my_data->dispatch_table.AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5035 | |
| 5036 | validate_result(my_data->report_data, "vkAcquireNextImageKHR", result); |
| 5037 | } |
| 5038 | |
| 5039 | return result; |
| 5040 | } |
| 5041 | |
| 5042 | VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) { |
| 5043 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5044 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5045 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5046 | assert(my_data != NULL); |
| 5047 | |
Chris Forbes | 481df4f | 2017-05-02 14:18:07 -0700 | [diff] [blame] | 5048 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain, "vkQueuePresentKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5049 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5050 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5051 | skip |= parameter_validation_vkQueuePresentKHR(my_data->report_data, pPresentInfo); |
Tobin Ehlis | 13e9c14 | 2017-01-13 12:13:57 -0700 | [diff] [blame] | 5052 | |
| 5053 | if (pPresentInfo && pPresentInfo->pNext) { |
| 5054 | // Verify ext struct |
| 5055 | struct std_header { |
| 5056 | VkStructureType sType; |
| 5057 | const void *pNext; |
| 5058 | }; |
| 5059 | std_header *pnext = (std_header *)pPresentInfo->pNext; |
| 5060 | while (pnext) { |
| 5061 | if (VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR == pnext->sType) { |
Chris Forbes | 481df4f | 2017-05-02 14:18:07 -0700 | [diff] [blame] | 5062 | skip |= require_device_extension(my_data, my_data->enables.khr_incremental_present, "vkQueuePresentKHR", |
Tobin Ehlis | 13e9c14 | 2017-01-13 12:13:57 -0700 | [diff] [blame] | 5063 | VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME); |
| 5064 | VkPresentRegionsKHR *present_regions = (VkPresentRegionsKHR *)pnext; |
| 5065 | if (present_regions->swapchainCount != pPresentInfo->swapchainCount) { |
| 5066 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 5067 | __LINE__, INVALID_USAGE, LayerName, |
| 5068 | "QueuePresentKHR(): pPresentInfo->swapchainCount has a value of %i" |
| 5069 | " but VkPresentRegionsKHR extension swapchainCount is %i. These values must be equal.", |
| 5070 | pPresentInfo->swapchainCount, present_regions->swapchainCount); |
| 5071 | } |
| 5072 | skip |= validate_struct_pnext(my_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->pNext", NULL, |
| 5073 | present_regions->pNext, 0, NULL, GeneratedHeaderVersion); |
| 5074 | skip |= validate_array(my_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->swapchainCount", |
| 5075 | "pCreateInfo->pNext->pRegions", present_regions->swapchainCount, present_regions->pRegions, |
| 5076 | true, false); |
| 5077 | for (uint32_t i = 0; i < present_regions->swapchainCount; ++i) { |
| 5078 | skip |= |
| 5079 | validate_array(my_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->pRegions[].rectangleCount", |
| 5080 | "pCreateInfo->pNext->pRegions[].pRectangles", present_regions->pRegions[i].rectangleCount, |
| 5081 | present_regions->pRegions[i].pRectangles, true, false); |
| 5082 | } |
| 5083 | } |
| 5084 | pnext = (std_header *)pnext->pNext; |
| 5085 | } |
| 5086 | } |
| 5087 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5088 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5089 | result = my_data->dispatch_table.QueuePresentKHR(queue, pPresentInfo); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5090 | |
| 5091 | validate_result(my_data->report_data, "vkQueuePresentKHR", result); |
| 5092 | } |
| 5093 | |
| 5094 | return result; |
| 5095 | } |
| 5096 | |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5097 | VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5098 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5099 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5100 | assert(my_data != NULL); |
| 5101 | |
Chris Forbes | 481df4f | 2017-05-02 14:18:07 -0700 | [diff] [blame] | 5102 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain, "vkDestroySwapchainKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5103 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5104 | |
| 5105 | /* No generated validation function for this call */ |
| 5106 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5107 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5108 | my_data->dispatch_table.DestroySwapchainKHR(device, swapchain, pAllocator); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5109 | } |
| 5110 | } |
| 5111 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5112 | static bool require_instance_extension(void *instance, bool InstanceExtensions::*flag, char const *function_name, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5113 | char const *extension_name) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5114 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 5115 | if (!(my_data->extensions.*flag)) { |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5116 | return log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, |
| 5117 | reinterpret_cast<uint64_t>(instance), __LINE__, EXTENSION_NOT_ENABLED, LayerName, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5118 | "%s() called even though the %s extension was not enabled for this VkInstance.", function_name, |
| 5119 | extension_name); |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5120 | } |
| 5121 | |
| 5122 | return false; |
| 5123 | } |
| 5124 | |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5125 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, |
| 5126 | VkSurfaceKHR surface, VkBool32 *pSupported) { |
| 5127 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5128 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5129 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5130 | assert(my_data != NULL); |
| 5131 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5132 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5133 | "vkGetPhysicalDeviceSurfaceSupportKHR", VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 8a13e27 | 2016-11-02 17:43:34 +1300 | [diff] [blame] | 5134 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5135 | skip |= parameter_validation_vkGetPhysicalDeviceSurfaceSupportKHR(my_data->report_data, queueFamilyIndex, surface, pSupported); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5136 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5137 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5138 | result = my_data->dispatch_table.GetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5139 | |
| 5140 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfaceSupportKHR", result); |
| 5141 | } |
| 5142 | |
| 5143 | return result; |
| 5144 | } |
| 5145 | |
| 5146 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 5147 | VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) { |
| 5148 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5149 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5150 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5151 | assert(my_data != NULL); |
| 5152 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5153 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5154 | "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 8a13e27 | 2016-11-02 17:43:34 +1300 | [diff] [blame] | 5155 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5156 | skip |= parameter_validation_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(my_data->report_data, surface, pSurfaceCapabilities); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5157 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5158 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5159 | result = my_data->dispatch_table.GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5160 | |
| 5161 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", result); |
| 5162 | } |
| 5163 | |
| 5164 | return result; |
| 5165 | } |
| 5166 | |
| 5167 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 5168 | uint32_t *pSurfaceFormatCount, |
| 5169 | VkSurfaceFormatKHR *pSurfaceFormats) { |
| 5170 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5171 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5172 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5173 | assert(my_data != NULL); |
| 5174 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5175 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5176 | "vkGetPhysicalDeviceSurfaceFormatsKHR", VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 8a13e27 | 2016-11-02 17:43:34 +1300 | [diff] [blame] | 5177 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5178 | skip |= parameter_validation_vkGetPhysicalDeviceSurfaceFormatsKHR(my_data->report_data, surface, pSurfaceFormatCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5179 | pSurfaceFormats); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5180 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5181 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5182 | result = my_data->dispatch_table.GetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, |
| 5183 | pSurfaceFormats); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5184 | |
| 5185 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfaceFormatsKHR", result); |
| 5186 | } |
| 5187 | |
| 5188 | return result; |
| 5189 | } |
| 5190 | |
| 5191 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 5192 | uint32_t *pPresentModeCount, |
| 5193 | VkPresentModeKHR *pPresentModes) { |
| 5194 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5195 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5196 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5197 | assert(my_data != NULL); |
| 5198 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5199 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5200 | "vkGetPhysicalDeviceSurfacePresentModesKHR", VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 8a13e27 | 2016-11-02 17:43:34 +1300 | [diff] [blame] | 5201 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5202 | skip |= parameter_validation_vkGetPhysicalDeviceSurfacePresentModesKHR(my_data->report_data, surface, pPresentModeCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5203 | pPresentModes); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5204 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5205 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5206 | result = my_data->dispatch_table.GetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, |
| 5207 | pPresentModes); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5208 | |
| 5209 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfacePresentModesKHR", result); |
| 5210 | } |
| 5211 | |
| 5212 | return result; |
| 5213 | } |
| 5214 | |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5215 | VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5216 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5217 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5218 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5219 | skip |= require_instance_extension(instance, &InstanceExtensions::khr_surface, "vkDestroySurfaceKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5220 | VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5221 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5222 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5223 | my_data->dispatch_table.DestroySurfaceKHR(instance, surface, pAllocator); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5224 | } |
| 5225 | } |
| 5226 | |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5227 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 5228 | VKAPI_ATTR VkResult VKAPI_CALL CreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, |
| 5229 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
| 5230 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5231 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5232 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5233 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5234 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5235 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5236 | skip |= require_instance_extension(instance, &InstanceExtensions::khr_win32_surface, "vkCreateWin32SurfaceKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5237 | VK_KHR_WIN32_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5238 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5239 | skip |= parameter_validation_vkCreateWin32SurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5240 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5241 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5242 | result = my_data->dispatch_table.CreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5243 | } |
| 5244 | |
| 5245 | validate_result(my_data->report_data, "vkCreateWin32SurfaceKHR", result); |
| 5246 | |
| 5247 | return result; |
| 5248 | } |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5249 | |
| 5250 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5251 | uint32_t queueFamilyIndex) { |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5252 | VkBool32 result = false; |
| 5253 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5254 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5255 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5256 | bool skip = false; |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5257 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5258 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_win32_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5259 | "vkGetPhysicalDeviceWin32PresentationSupportKHR", VK_KHR_WIN32_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5260 | |
Chris Forbes | 7281a50 | 2016-11-08 08:45:03 +1300 | [diff] [blame] | 5261 | // TODO: codegen doesn't produce this function? |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5262 | // skip |= parameter_validation_vkGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5263 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5264 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5265 | result = my_data->dispatch_table.GetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5266 | } |
| 5267 | |
| 5268 | return result; |
| 5269 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5270 | #endif // VK_USE_PLATFORM_WIN32_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5271 | |
| 5272 | #ifdef VK_USE_PLATFORM_XCB_KHR |
| 5273 | VKAPI_ATTR VkResult VKAPI_CALL CreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, |
| 5274 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
| 5275 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5276 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5277 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5278 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5279 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5280 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5281 | skip |= require_instance_extension(instance, &InstanceExtensions::khr_xcb_surface, "vkCreateXcbSurfaceKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5282 | VK_KHR_XCB_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5283 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5284 | skip |= parameter_validation_vkCreateXcbSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5285 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5286 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5287 | result = my_data->dispatch_table.CreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5288 | } |
| 5289 | |
| 5290 | validate_result(my_data->report_data, "vkCreateXcbSurfaceKHR", result); |
| 5291 | |
| 5292 | return result; |
| 5293 | } |
| 5294 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5295 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 5296 | uint32_t queueFamilyIndex, xcb_connection_t *connection, |
| 5297 | xcb_visualid_t visual_id) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5298 | VkBool32 result = false; |
| 5299 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5300 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5301 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5302 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5303 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5304 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_xcb_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5305 | "vkGetPhysicalDeviceXcbPresentationSupportKHR", VK_KHR_XCB_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5306 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5307 | skip |= parameter_validation_vkGetPhysicalDeviceXcbPresentationSupportKHR(my_data->report_data, queueFamilyIndex, connection, |
| 5308 | visual_id); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5309 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5310 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5311 | result = my_data->dispatch_table.GetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, |
| 5312 | visual_id); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5313 | } |
| 5314 | |
| 5315 | return result; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5316 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5317 | #endif // VK_USE_PLATFORM_XCB_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5318 | |
| 5319 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 5320 | VKAPI_ATTR VkResult VKAPI_CALL CreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5321 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5322 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5323 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5324 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5325 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5326 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5327 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5328 | skip |= require_instance_extension(instance, &InstanceExtensions::khr_xlib_surface, "vkCreateXlibSurfaceKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5329 | VK_KHR_XLIB_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5330 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5331 | skip |= parameter_validation_vkCreateXlibSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5332 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5333 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5334 | result = my_data->dispatch_table.CreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5335 | } |
| 5336 | |
| 5337 | validate_result(my_data->report_data, "vkCreateXlibSurfaceKHR", result); |
| 5338 | |
| 5339 | return result; |
| 5340 | } |
| 5341 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5342 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 5343 | uint32_t queueFamilyIndex, Display *dpy, |
| 5344 | VisualID visualID) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5345 | VkBool32 result = false; |
| 5346 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5347 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5348 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5349 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5350 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5351 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_xlib_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5352 | "vkGetPhysicalDeviceXlibPresentationSupportKHR", VK_KHR_XLIB_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5353 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5354 | skip |= |
| 5355 | parameter_validation_vkGetPhysicalDeviceXlibPresentationSupportKHR(my_data->report_data, queueFamilyIndex, dpy, visualID); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5356 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5357 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5358 | result = |
| 5359 | my_data->dispatch_table.GetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5360 | } |
Karl Schultz | 3a41cae | 2016-09-02 10:17:05 -0600 | [diff] [blame] | 5361 | return result; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5362 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5363 | #endif // VK_USE_PLATFORM_XLIB_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5364 | |
| 5365 | #ifdef VK_USE_PLATFORM_MIR_KHR |
| 5366 | VKAPI_ATTR VkResult VKAPI_CALL CreateMirSurfaceKHR(VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5367 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5368 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5369 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5370 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5371 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5372 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5373 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5374 | skip |= require_instance_extension(instance, &InstanceExtensions::khr_mir_surface, "vkCreateMirSurfaceKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5375 | VK_KHR_MIR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5376 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5377 | skip |= parameter_validation_vkCreateMirSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5378 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5379 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5380 | result = my_data->dispatch_table.CreateMirSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5381 | } |
| 5382 | |
| 5383 | validate_result(my_data->report_data, "vkCreateMirSurfaceKHR", result); |
| 5384 | |
| 5385 | return result; |
| 5386 | } |
| 5387 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5388 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 5389 | uint32_t queueFamilyIndex, MirConnection *connection) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5390 | VkBool32 result = false; |
| 5391 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5392 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5393 | assert(my_data != NULL); |
| 5394 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5395 | bool skip = false; |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5396 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5397 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_mir_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5398 | "vkGetPhysicalDeviceMirPresentationSupportKHR", VK_KHR_MIR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5399 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5400 | skip |= parameter_validation_vkGetPhysicalDeviceMirPresentationSupportKHR(my_data->report_data, queueFamilyIndex, connection); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5401 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5402 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5403 | result = my_data->dispatch_table.GetPhysicalDeviceMirPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5404 | } |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5405 | return result; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5406 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5407 | #endif // VK_USE_PLATFORM_MIR_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5408 | |
| 5409 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
| 5410 | VKAPI_ATTR VkResult VKAPI_CALL CreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5411 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5412 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5413 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5414 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5415 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5416 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5417 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5418 | skip |= require_instance_extension(instance, &InstanceExtensions::khr_wayland_surface, "vkCreateWaylandSurfaceKHR", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5419 | VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5420 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5421 | skip |= parameter_validation_vkCreateWaylandSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5422 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5423 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5424 | result = my_data->dispatch_table.CreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5425 | } |
| 5426 | |
| 5427 | validate_result(my_data->report_data, "vkCreateWaylandSurfaceKHR", result); |
| 5428 | |
| 5429 | return result; |
| 5430 | } |
| 5431 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5432 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 5433 | uint32_t queueFamilyIndex, |
| 5434 | struct wl_display *display) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5435 | VkBool32 result = false; |
| 5436 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5437 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5438 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5439 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5440 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5441 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_wayland_surface, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5442 | "vkGetPhysicalDeviceWaylandPresentationSupportKHR", VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5443 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5444 | skip |= parameter_validation_vkGetPhysicalDeviceWaylandPresentationSupportKHR(my_data->report_data, queueFamilyIndex, display); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5445 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5446 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5447 | result = my_data->dispatch_table.GetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5448 | } |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5449 | |
| 5450 | return result; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5451 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5452 | #endif // VK_USE_PLATFORM_WAYLAND_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5453 | |
| 5454 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 5455 | VKAPI_ATTR VkResult VKAPI_CALL CreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5456 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5457 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5458 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5459 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5460 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5461 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5462 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5463 | skip |= require_instance_extension(instance, &InstanceExtensions::khr_android_surface, "vkCreateAndroidSurfaceKHR", |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5464 | VK_KHR_ANDROID_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5465 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5466 | skip |= parameter_validation_vkCreateAndroidSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5467 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5468 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5469 | result = my_data->dispatch_table.CreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5470 | } |
| 5471 | |
| 5472 | validate_result(my_data->report_data, "vkCreateAndroidSurfaceKHR", result); |
| 5473 | |
| 5474 | return result; |
| 5475 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5476 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5477 | |
Mark Young | ead9b93 | 2016-09-08 12:28:38 -0600 | [diff] [blame] | 5478 | VKAPI_ATTR VkResult VKAPI_CALL CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, |
| 5479 | const VkSwapchainCreateInfoKHR *pCreateInfos, |
| 5480 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains) { |
| 5481 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5482 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5483 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | ead9b93 | 2016-09-08 12:28:38 -0600 | [diff] [blame] | 5484 | assert(my_data != NULL); |
| 5485 | |
Chris Forbes | 481df4f | 2017-05-02 14:18:07 -0700 | [diff] [blame] | 5486 | skip |= require_device_extension(my_data, my_data->enables.khr_display_swapchain, "vkCreateSharedSwapchainsKHR", |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5487 | VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5488 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5489 | skip |= parameter_validation_vkCreateSharedSwapchainsKHR(my_data->report_data, swapchainCount, pCreateInfos, pAllocator, |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5490 | pSwapchains); |
Mark Young | ead9b93 | 2016-09-08 12:28:38 -0600 | [diff] [blame] | 5491 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5492 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5493 | result = my_data->dispatch_table.CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); |
Mark Young | ead9b93 | 2016-09-08 12:28:38 -0600 | [diff] [blame] | 5494 | |
| 5495 | validate_result(my_data->report_data, "vkCreateSharedSwapchainsKHR", result); |
| 5496 | } |
| 5497 | |
| 5498 | return result; |
| 5499 | } |
| 5500 | |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5501 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 5502 | VkDisplayPropertiesKHR *pProperties) { |
| 5503 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5504 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5505 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5506 | assert(my_data != NULL); |
| 5507 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5508 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_display, |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5509 | "vkGetPhysicalDeviceDisplayPropertiesKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5510 | |
| 5511 | // No parameter validation function for this call? |
| 5512 | |
| 5513 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5514 | result = my_data->dispatch_table.GetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5515 | |
| 5516 | validate_result(my_data->report_data, "vkGetPhysicalDeviceDisplayPropertiesKHR", result); |
| 5517 | } |
| 5518 | |
| 5519 | return result; |
| 5520 | } |
| 5521 | |
| 5522 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 5523 | VkDisplayPlanePropertiesKHR *pProperties) { |
| 5524 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5525 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5526 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5527 | assert(my_data != NULL); |
| 5528 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5529 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_display, |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5530 | "vkGetPhysicalDeviceDisplayPlanePropertiesKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5531 | |
| 5532 | // No parameter validation function for this call? |
| 5533 | |
| 5534 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5535 | result = my_data->dispatch_table.GetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount, pProperties); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5536 | |
| 5537 | validate_result(my_data->report_data, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR", result); |
| 5538 | } |
| 5539 | |
| 5540 | return result; |
| 5541 | } |
| 5542 | |
| 5543 | VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, |
| 5544 | uint32_t *pDisplayCount, VkDisplayKHR *pDisplays) { |
| 5545 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5546 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5547 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5548 | assert(my_data != NULL); |
| 5549 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5550 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_display, |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5551 | "vkGetDisplayPlaneSupportedDisplaysKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5552 | |
| 5553 | // No parameter validation function for this call? |
| 5554 | |
| 5555 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5556 | result = my_data->dispatch_table.GetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount, pDisplays); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5557 | |
| 5558 | validate_result(my_data->report_data, "vkGetDisplayPlaneSupportedDisplaysKHR", result); |
| 5559 | } |
| 5560 | |
| 5561 | return result; |
| 5562 | } |
| 5563 | |
| 5564 | VKAPI_ATTR VkResult VKAPI_CALL GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, |
| 5565 | uint32_t *pPropertyCount, VkDisplayModePropertiesKHR *pProperties) { |
| 5566 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5567 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5568 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5569 | assert(my_data != NULL); |
| 5570 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5571 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_display, |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5572 | "vkGetDisplayModePropertiesKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5573 | |
| 5574 | // No parameter validation function for this call? |
| 5575 | |
| 5576 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5577 | result = my_data->dispatch_table.GetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5578 | |
| 5579 | validate_result(my_data->report_data, "vkGetDisplayModePropertiesKHR", result); |
| 5580 | } |
| 5581 | |
| 5582 | return result; |
| 5583 | } |
| 5584 | |
| 5585 | VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, |
| 5586 | const VkDisplayModeCreateInfoKHR *pCreateInfo, |
| 5587 | const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode) { |
| 5588 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5589 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5590 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5591 | assert(my_data != NULL); |
| 5592 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5593 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_display, "vkCreateDisplayModeKHR", |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5594 | VK_KHR_DISPLAY_EXTENSION_NAME); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5595 | |
| 5596 | // No parameter validation function for this call? |
| 5597 | |
| 5598 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5599 | result = my_data->dispatch_table.CreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5600 | |
| 5601 | validate_result(my_data->report_data, "vkCreateDisplayModeKHR", result); |
| 5602 | } |
| 5603 | |
| 5604 | return result; |
| 5605 | } |
| 5606 | |
| 5607 | VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, |
| 5608 | uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR *pCapabilities) { |
| 5609 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5610 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5611 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5612 | assert(my_data != NULL); |
| 5613 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5614 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_display, |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5615 | "vkGetDisplayPlaneCapabilitiesKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5616 | |
| 5617 | // No parameter validation function for this call? |
| 5618 | |
| 5619 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5620 | result = my_data->dispatch_table.GetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5621 | |
| 5622 | validate_result(my_data->report_data, "vkGetDisplayPlaneCapabilitiesKHR", result); |
| 5623 | } |
| 5624 | |
| 5625 | return result; |
| 5626 | } |
| 5627 | |
| 5628 | VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayPlaneSurfaceKHR(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, |
| 5629 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
| 5630 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5631 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5632 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5633 | assert(my_data != NULL); |
| 5634 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5635 | skip |= require_instance_extension(instance, &InstanceExtensions::khr_display, "vkCreateDisplayPlaneSurfaceKHR", |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5636 | VK_KHR_DISPLAY_EXTENSION_NAME); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5637 | |
| 5638 | // No parameter validation function for this call? |
| 5639 | |
| 5640 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5641 | result = my_data->dispatch_table.CreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5642 | |
| 5643 | validate_result(my_data->report_data, "vkCreateDisplayPlaneSurfaceKHR", result); |
| 5644 | } |
| 5645 | |
| 5646 | return result; |
| 5647 | } |
| 5648 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5649 | // Definitions for the VK_KHR_get_physical_device_properties2 extension |
| 5650 | |
| 5651 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5652 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5653 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5654 | assert(my_data != NULL); |
| 5655 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5656 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_get_physical_device_properties2, |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5657 | "vkGetPhysicalDeviceFeatures2KHR", VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5658 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5659 | skip |= parameter_validation_vkGetPhysicalDeviceFeatures2KHR(my_data->report_data, pFeatures); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5660 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5661 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5662 | my_data->dispatch_table.GetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures); |
| 5663 | } |
| 5664 | } |
| 5665 | |
| 5666 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, |
| 5667 | VkPhysicalDeviceProperties2KHR *pProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5668 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5669 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5670 | assert(my_data != NULL); |
| 5671 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5672 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_get_physical_device_properties2, |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5673 | "vkGetPhysicalDeviceProperties2KHR", VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5674 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5675 | skip |= parameter_validation_vkGetPhysicalDeviceProperties2KHR(my_data->report_data, pProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5676 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5677 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5678 | my_data->dispatch_table.GetPhysicalDeviceProperties2KHR(physicalDevice, pProperties); |
| 5679 | } |
| 5680 | } |
| 5681 | |
| 5682 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, |
| 5683 | VkFormatProperties2KHR *pFormatProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5684 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5685 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5686 | assert(my_data != NULL); |
| 5687 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5688 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_get_physical_device_properties2, |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5689 | "vkGetPhysicalDeviceFormatProperties2KHR", |
| 5690 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5691 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5692 | skip |= parameter_validation_vkGetPhysicalDeviceFormatProperties2KHR(my_data->report_data, format, pFormatProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5693 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5694 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5695 | my_data->dispatch_table.GetPhysicalDeviceFormatProperties2KHR(physicalDevice, format, pFormatProperties); |
| 5696 | } |
| 5697 | } |
| 5698 | |
| 5699 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR( |
| 5700 | VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, |
| 5701 | VkImageFormatProperties2KHR *pImageFormatProperties) { |
| 5702 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5703 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5704 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5705 | assert(my_data != NULL); |
| 5706 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5707 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_get_physical_device_properties2, |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5708 | "vkGetPhysicalDeviceImageFormatProperties2KHR", |
| 5709 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5710 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5711 | skip |= parameter_validation_vkGetPhysicalDeviceImageFormatProperties2KHR(my_data->report_data, pImageFormatInfo, |
| 5712 | pImageFormatProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5713 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5714 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5715 | result = my_data->dispatch_table.GetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, pImageFormatInfo, |
| 5716 | pImageFormatProperties); |
| 5717 | validate_result(my_data->report_data, "vkGetPhysicalDeviceImageFormatProperties2KHR", result); |
| 5718 | } |
| 5719 | |
| 5720 | return result; |
| 5721 | } |
| 5722 | |
| 5723 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, |
| 5724 | uint32_t *pQueueFamilyPropertyCount, |
| 5725 | VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5726 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5727 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5728 | assert(my_data != NULL); |
| 5729 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5730 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_get_physical_device_properties2, |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5731 | "vkGetPhysicalDeviceQueueFamilyProperties2KHR", |
| 5732 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5733 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5734 | skip |= parameter_validation_vkGetPhysicalDeviceQueueFamilyProperties2KHR(my_data->report_data, pQueueFamilyPropertyCount, |
| 5735 | pQueueFamilyProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5736 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5737 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5738 | my_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount, |
| 5739 | pQueueFamilyProperties); |
| 5740 | } |
| 5741 | } |
| 5742 | |
| 5743 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, |
| 5744 | VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5745 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5746 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5747 | assert(my_data != NULL); |
| 5748 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5749 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_get_physical_device_properties2, |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5750 | "vkGetPhysicalDeviceMemoryProperties2KHR", |
| 5751 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5752 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5753 | skip |= parameter_validation_vkGetPhysicalDeviceMemoryProperties2KHR(my_data->report_data, pMemoryProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5754 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5755 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5756 | my_data->dispatch_table.GetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties); |
| 5757 | } |
| 5758 | } |
| 5759 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5760 | static bool PostGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, |
| 5761 | const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, |
| 5762 | uint32_t *pPropertyCount, |
| 5763 | VkSparseImageFormatProperties2KHR *pProperties) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5764 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5765 | if (pProperties != nullptr) { |
| 5766 | for (uint32_t i = 0; i < *pPropertyCount; ++i) { |
| 5767 | if ((pProperties[i].properties.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 5768 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 5769 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 5770 | 1, LayerName, |
| 5771 | "vkGetPhysicalDeviceSparseImageFormatProperties2KHR parameter, VkImageAspect " |
| 5772 | "pProperties[%i].properties.aspectMask, is an " |
| 5773 | "unrecognized enumerator", |
| 5774 | i); |
| 5775 | return false; |
| 5776 | } |
| 5777 | } |
| 5778 | } |
| 5779 | return true; |
| 5780 | } |
| 5781 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5782 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 5783 | VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, |
| 5784 | VkSparseImageFormatProperties2KHR *pProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5785 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5786 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5787 | assert(my_data != NULL); |
| 5788 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5789 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khr_get_physical_device_properties2, |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5790 | "vkGetPhysicalDeviceSparseImageFormatProperties2KHR", |
| 5791 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5792 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5793 | skip |= parameter_validation_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(my_data->report_data, pFormatInfo, |
| 5794 | pPropertyCount, pProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5795 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5796 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5797 | my_data->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, |
| 5798 | pProperties); |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5799 | PostGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, pProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5800 | } |
| 5801 | } |
| 5802 | |
| 5803 | // Definitions for the VK_KHR_maintenance1 extension |
| 5804 | |
| 5805 | VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags) { |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5806 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5807 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5808 | assert(my_data != NULL); |
| 5809 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5810 | skip |= require_device_extension(my_data, my_data->enables.khr_maintenance1, "vkTrimCommandPoolKHR", |
| 5811 | VK_KHR_MAINTENANCE1_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5812 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5813 | skip |= parameter_validation_vkTrimCommandPoolKHR(my_data->report_data, commandPool, flags); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5814 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5815 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5816 | my_data->dispatch_table.TrimCommandPoolKHR(device, commandPool, flags); |
| 5817 | } |
| 5818 | } |
| 5819 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5820 | // Definitions for the VK_KHR_push_descriptor extension |
| 5821 | |
| 5822 | VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, |
| 5823 | VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, |
| 5824 | const VkWriteDescriptorSet *pDescriptorWrites) { |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5825 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5826 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5827 | assert(my_data != NULL); |
| 5828 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5829 | skip |= require_device_extension(my_data, my_data->enables.khr_push_descriptor, "vkCmdPushDescriptorSetKHR", |
| 5830 | VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5831 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5832 | skip |= parameter_validation_vkCmdPushDescriptorSetKHR(my_data->report_data, pipelineBindPoint, layout, set, |
| 5833 | descriptorWriteCount, pDescriptorWrites); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5834 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5835 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5836 | my_data->dispatch_table.CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, |
| 5837 | pDescriptorWrites); |
| 5838 | } |
| 5839 | } |
| 5840 | |
| 5841 | // Definitions for the VK_KHR_descriptor_update_template extension |
| 5842 | |
| 5843 | VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR(VkDevice device, |
| 5844 | const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, |
| 5845 | const VkAllocationCallbacks *pAllocator, |
| 5846 | VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { |
| 5847 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5848 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5849 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5850 | assert(my_data != NULL); |
| 5851 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5852 | skip |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, |
| 5853 | "vkCreateDescriptorUpdateTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5854 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5855 | skip |= parameter_validation_vkCreateDescriptorUpdateTemplateKHR(my_data->report_data, pCreateInfo, pAllocator, |
| 5856 | pDescriptorUpdateTemplate); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5857 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5858 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5859 | result = |
| 5860 | my_data->dispatch_table.CreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| 5861 | validate_result(my_data->report_data, "vkCreateDescriptorUpdateTemplateKHR", result); |
| 5862 | } |
| 5863 | |
| 5864 | return result; |
| 5865 | } |
| 5866 | |
| 5867 | VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR(VkDevice device, |
| 5868 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, |
| 5869 | const VkAllocationCallbacks *pAllocator) { |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5870 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5871 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5872 | assert(my_data != NULL); |
| 5873 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5874 | skip |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, |
| 5875 | "vkDestroyDescriptorUpdateTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5876 | |
| 5877 | #if 0 // Validation not automatically generated |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5878 | skip |= parameter_validation_vkDestroyDescriptorUpdateTemplateKHR(my_data->report_data, descriptorUpdateTemplate, |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5879 | pAllocator); |
| 5880 | #endif |
| 5881 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5882 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5883 | my_data->dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); |
| 5884 | } |
| 5885 | } |
| 5886 | |
| 5887 | VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, |
| 5888 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, |
| 5889 | const void *pData) { |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5890 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5891 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5892 | assert(my_data != NULL); |
| 5893 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5894 | skip |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, |
| 5895 | "vkUpdateDescriptorSetWithTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5896 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5897 | skip |= parameter_validation_vkUpdateDescriptorSetWithTemplateKHR(my_data->report_data, descriptorSet, descriptorUpdateTemplate, |
| 5898 | pData); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5899 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5900 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5901 | my_data->dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData); |
| 5902 | } |
| 5903 | } |
| 5904 | |
| 5905 | VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, |
| 5906 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, |
| 5907 | VkPipelineLayout layout, uint32_t set, const void *pData) { |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5908 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5909 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5910 | assert(my_data != NULL); |
| 5911 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5912 | skip |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, |
| 5913 | "vkCmdPushDescriptorSetWithTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5914 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5915 | skip |= parameter_validation_vkCmdPushDescriptorSetWithTemplateKHR(my_data->report_data, descriptorUpdateTemplate, layout, set, |
| 5916 | pData); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5917 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5918 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5919 | my_data->dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData); |
| 5920 | } |
| 5921 | } |
| 5922 | |
| 5923 | // Definitions for the VK_KHX_device_group_creation extension |
| 5924 | |
| 5925 | VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( |
| 5926 | VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { |
| 5927 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5928 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5929 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
| 5930 | assert(my_data != NULL); |
| 5931 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 5932 | skip |= require_instance_extension(instance, &InstanceExtensions::khx_device_group_creation, |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5933 | "vkEnumeratePhysicalDeviceGroupsKHX", VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5934 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5935 | skip |= parameter_validation_vkEnumeratePhysicalDeviceGroupsKHX(my_data->report_data, pPhysicalDeviceGroupCount, |
| 5936 | pPhysicalDeviceGroupProperties); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5937 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5938 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5939 | result = my_data->dispatch_table.EnumeratePhysicalDeviceGroupsKHX(instance, pPhysicalDeviceGroupCount, |
| 5940 | pPhysicalDeviceGroupProperties); |
| 5941 | validate_result(my_data->report_data, "vkEnumeratePhysicalDeviceGroupsKHX", result); |
| 5942 | } |
| 5943 | return result; |
| 5944 | } |
| 5945 | |
| 5946 | // Definitions for the VK_KHX_device_group extension |
| 5947 | |
| 5948 | VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeaturesKHX(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, |
| 5949 | uint32_t remoteDeviceIndex, |
| 5950 | VkPeerMemoryFeatureFlagsKHX *pPeerMemoryFeatures) { |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5951 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5952 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5953 | assert(my_data != NULL); |
| 5954 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5955 | skip |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupPeerMemoryFeaturesKHX", |
| 5956 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5957 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5958 | skip |= parameter_validation_vkGetDeviceGroupPeerMemoryFeaturesKHX(my_data->report_data, heapIndex, localDeviceIndex, |
| 5959 | remoteDeviceIndex, pPeerMemoryFeatures); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5960 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5961 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5962 | my_data->dispatch_table.GetDeviceGroupPeerMemoryFeaturesKHX(device, heapIndex, localDeviceIndex, remoteDeviceIndex, |
| 5963 | pPeerMemoryFeatures); |
| 5964 | } |
| 5965 | } |
| 5966 | |
| 5967 | VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHX(VkDevice device, uint32_t bindInfoCount, |
| 5968 | const VkBindBufferMemoryInfoKHX *pBindInfos) { |
| 5969 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5970 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5971 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5972 | assert(my_data != NULL); |
| 5973 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5974 | skip |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkBindBufferMemory2KHX", |
| 5975 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5976 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5977 | skip |= parameter_validation_vkBindBufferMemory2KHX(my_data->report_data, bindInfoCount, pBindInfos); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5978 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5979 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5980 | result = my_data->dispatch_table.BindBufferMemory2KHX(device, bindInfoCount, pBindInfos); |
| 5981 | validate_result(my_data->report_data, "vkBindBufferMemory2KHX", result); |
| 5982 | } |
| 5983 | |
| 5984 | return result; |
| 5985 | } |
| 5986 | |
| 5987 | VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHX(VkDevice device, uint32_t bindInfoCount, |
| 5988 | const VkBindImageMemoryInfoKHX *pBindInfos) { |
| 5989 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5990 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5991 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5992 | assert(my_data != NULL); |
| 5993 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5994 | skip |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkBindImageMemory2KHX", |
| 5995 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5996 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5997 | skip |= parameter_validation_vkBindImageMemory2KHX(my_data->report_data, bindInfoCount, pBindInfos); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5998 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 5999 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6000 | result = my_data->dispatch_table.BindImageMemory2KHX(device, bindInfoCount, pBindInfos); |
| 6001 | validate_result(my_data->report_data, "vkBindImageMemory2KHX", result); |
| 6002 | } |
| 6003 | |
| 6004 | return result; |
| 6005 | } |
| 6006 | |
| 6007 | VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMaskKHX(VkCommandBuffer commandBuffer, uint32_t deviceMask) { |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6008 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6009 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6010 | assert(my_data != NULL); |
| 6011 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6012 | skip |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkCmdSetDeviceMaskKHX", |
| 6013 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6014 | |
| 6015 | #if 0 // Validation not automatically generated |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6016 | skip |= parameter_validation_vkCmdSetDeviceMaskKHX(my_data->report_data, deviceMask); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6017 | #endif |
| 6018 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6019 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6020 | my_data->dispatch_table.CmdSetDeviceMaskKHX(commandBuffer, deviceMask); |
| 6021 | } |
| 6022 | } |
| 6023 | |
| 6024 | VKAPI_ATTR VkResult VKAPI_CALL |
| 6025 | GetDeviceGroupPresentCapabilitiesKHX(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX *pDeviceGroupPresentCapabilities) { |
| 6026 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6027 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6028 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6029 | assert(my_data != NULL); |
| 6030 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6031 | skip |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupPresentCapabilitiesKHX", |
| 6032 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6033 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6034 | skip |= parameter_validation_vkGetDeviceGroupPresentCapabilitiesKHX(my_data->report_data, pDeviceGroupPresentCapabilities); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6035 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6036 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6037 | result = my_data->dispatch_table.GetDeviceGroupPresentCapabilitiesKHX(device, pDeviceGroupPresentCapabilities); |
| 6038 | validate_result(my_data->report_data, "vkGetDeviceGroupPresentCapabilitiesKHX", result); |
| 6039 | } |
| 6040 | |
| 6041 | return result; |
| 6042 | } |
| 6043 | |
| 6044 | VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModesKHX(VkDevice device, VkSurfaceKHR surface, |
| 6045 | VkDeviceGroupPresentModeFlagsKHX *pModes) { |
| 6046 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6047 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6048 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6049 | assert(my_data != NULL); |
| 6050 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6051 | skip |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupSurfacePresentModesKHX", |
| 6052 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6053 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6054 | skip |= parameter_validation_vkGetDeviceGroupSurfacePresentModesKHX(my_data->report_data, surface, pModes); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6055 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6056 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6057 | result = my_data->dispatch_table.GetDeviceGroupSurfacePresentModesKHX(device, surface, pModes); |
| 6058 | validate_result(my_data->report_data, "vkGetDeviceGroupSurfacePresentModesKHX", result); |
| 6059 | } |
| 6060 | return result; |
| 6061 | } |
| 6062 | |
| 6063 | VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImage2KHX(VkDevice device, const VkAcquireNextImageInfoKHX *pAcquireInfo, |
| 6064 | uint32_t *pImageIndex) { |
| 6065 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6066 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6067 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6068 | assert(my_data != NULL); |
| 6069 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6070 | skip |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkAcquireNextImage2KHX", |
| 6071 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6072 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6073 | skip |= parameter_validation_vkAcquireNextImage2KHX(my_data->report_data, pAcquireInfo, pImageIndex); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6074 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6075 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6076 | result = my_data->dispatch_table.AcquireNextImage2KHX(device, pAcquireInfo, pImageIndex); |
| 6077 | validate_result(my_data->report_data, "vkAcquireNextImage2KHX", result); |
| 6078 | } |
| 6079 | return result; |
| 6080 | } |
| 6081 | |
| 6082 | VKAPI_ATTR void VKAPI_CALL CmdDispatchBaseKHX(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, |
| 6083 | uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, |
| 6084 | uint32_t groupCountZ) { |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6085 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6086 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6087 | assert(my_data != NULL); |
| 6088 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6089 | skip |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkCmdDispatchBaseKHX", |
| 6090 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6091 | |
| 6092 | #if 0 // Validation not automatically generated |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6093 | skip |= parameter_validation_vkCmdDispatchBaseKHX(my_data->report_data, baseGroupX, baseGroupY, baseGroupZ, |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6094 | groupCountX, groupCountY, groupCountZ); |
| 6095 | #endif |
| 6096 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6097 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6098 | my_data->dispatch_table.CmdDispatchBaseKHX(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, |
| 6099 | groupCountZ); |
| 6100 | } |
| 6101 | } |
| 6102 | |
| 6103 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDevicePresentRectanglesKHX(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 6104 | uint32_t *pRectCount, VkRect2D *pRects) { |
| 6105 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6106 | bool skip = false; |
| 6107 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
| 6108 | assert(my_data != NULL); |
| 6109 | |
| 6110 | skip |= parameter_validation_vkGetPhysicalDevicePresentRectanglesKHX(my_data->report_data, surface, pRectCount, pRects); |
| 6111 | |
| 6112 | if (!skip) { |
| 6113 | result = my_data->dispatch_table.GetPhysicalDevicePresentRectanglesKHX(physicalDevice, surface, pRectCount, pRects); |
| 6114 | |
| 6115 | validate_result(my_data->report_data, "vkGetPhysicalDevicePresentRectanglesKHX", result); |
| 6116 | } |
| 6117 | |
| 6118 | return result; |
| 6119 | } |
| 6120 | |
| 6121 | // Definitions for the VK_KHX_external_memory_capabilities extension |
| 6122 | |
| 6123 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHX( |
| 6124 | VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHX *pExternalBufferInfo, |
| 6125 | VkExternalBufferPropertiesKHX *pExternalBufferProperties) { |
| 6126 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
| 6127 | assert(my_data != NULL); |
| 6128 | bool skip = false; |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 6129 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khx_external_memory_capabilities, |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6130 | "vkGetPhysicalDeviceExternalBufferPropertiesKHX", |
| 6131 | VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); |
| 6132 | skip |= parameter_validation_vkGetPhysicalDeviceExternalBufferPropertiesKHX(my_data->report_data, pExternalBufferInfo, |
| 6133 | pExternalBufferProperties); |
| 6134 | if (!skip) { |
| 6135 | my_data->dispatch_table.GetPhysicalDeviceExternalBufferPropertiesKHX(physicalDevice, pExternalBufferInfo, |
| 6136 | pExternalBufferProperties); |
| 6137 | } |
| 6138 | } |
| 6139 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6140 | // Definitions for the VK_KHX_external_memory_fd extension |
| 6141 | |
| 6142 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdKHX(VkDevice device, VkDeviceMemory memory, |
| 6143 | VkExternalMemoryHandleTypeFlagBitsKHX handleType, int *pFd) { |
| 6144 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6145 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6146 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6147 | assert(my_data != NULL); |
| 6148 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6149 | skip |= require_device_extension(my_data, my_data->enables.khx_external_memory_fd, "vkGetMemoryFdKHX", |
| 6150 | VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6151 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6152 | skip |= parameter_validation_vkGetMemoryFdKHX(my_data->report_data, memory, handleType, pFd); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6153 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6154 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6155 | result = my_data->dispatch_table.GetMemoryFdKHX(device, memory, handleType, pFd); |
| 6156 | validate_result(my_data->report_data, "vkGetMemoryFdKHX", result); |
| 6157 | } |
| 6158 | |
| 6159 | return result; |
| 6160 | } |
| 6161 | |
| 6162 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdPropertiesKHX(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, |
| 6163 | VkMemoryFdPropertiesKHX *pMemoryFdProperties) { |
| 6164 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6165 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6166 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6167 | assert(my_data != NULL); |
| 6168 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6169 | skip |= require_device_extension(my_data, my_data->enables.khx_external_memory_fd, "vkGetMemoryFdPropertiesKHX", |
| 6170 | VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6171 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6172 | skip |= parameter_validation_vkGetMemoryFdPropertiesKHX(my_data->report_data, handleType, fd, pMemoryFdProperties); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6173 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6174 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6175 | result = my_data->dispatch_table.GetMemoryFdPropertiesKHX(device, handleType, fd, pMemoryFdProperties); |
| 6176 | validate_result(my_data->report_data, "vkGetMemoryFdPropertiesKHX", result); |
| 6177 | } |
| 6178 | |
| 6179 | return result; |
| 6180 | } |
| 6181 | |
| 6182 | // Definitions for the VK_KHX_external_memory_win32 extension |
| 6183 | |
| 6184 | #ifdef VK_USE_PLATFORM_WIN32_KHX |
| 6185 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleKHX(VkDevice device, VkDeviceMemory memory, |
| 6186 | VkExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE *pHandle) { |
| 6187 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6188 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6189 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6190 | assert(my_data != NULL); |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6191 | skip |= require_device_extension(my_data, my_data->enables.khx_external_memory_win32, "vkGetMemoryWin32HandleKHX", |
| 6192 | VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6193 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6194 | skip |= parameter_validation_vkGetMemoryWin32HandleKHX(my_data->report_data, memory, handleType, pHandle); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6195 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6196 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6197 | result = my_data->dispatch_table.GetMemoryWin32HandleKHX(device, memory, handleType, pHandle); |
| 6198 | validate_result(my_data->report_data, "vkGetMemoryWin32HandleKHX", result); |
| 6199 | } |
| 6200 | return result; |
| 6201 | } |
| 6202 | |
| 6203 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHX(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, |
| 6204 | HANDLE handle, |
| 6205 | VkMemoryWin32HandlePropertiesKHX *pMemoryWin32HandleProperties) { |
| 6206 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6207 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6208 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6209 | assert(my_data != NULL); |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6210 | skip |= require_device_extension(my_data, my_data->enables.khx_external_memory_win32, "vkGetMemoryWin32HandlePropertiesKHX", |
| 6211 | VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6212 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6213 | skip |= parameter_validation_vkGetMemoryWin32HandlePropertiesKHX(my_data->report_data, handleType, handle, |
| 6214 | pMemoryWin32HandleProperties); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6215 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6216 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6217 | result = |
| 6218 | my_data->dispatch_table.GetMemoryWin32HandlePropertiesKHX(device, handleType, handle, pMemoryWin32HandleProperties); |
| 6219 | validate_result(my_data->report_data, "vkGetMemoryWin32HandlePropertiesKHX", result); |
| 6220 | } |
| 6221 | return result; |
| 6222 | } |
| 6223 | #endif // VK_USE_PLATFORM_WIN32_KHX |
| 6224 | |
| 6225 | // Definitions for the VK_KHX_external_semaphore_capabilities extension |
| 6226 | |
| 6227 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHX( |
| 6228 | VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHX *pExternalSemaphoreInfo, |
| 6229 | VkExternalSemaphorePropertiesKHX *pExternalSemaphoreProperties) { |
| 6230 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
| 6231 | assert(my_data != NULL); |
| 6232 | bool skip = false; |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 6233 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::khx_external_memory_capabilities, |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6234 | "vkGetPhysicalDeviceExternalSemaphorePropertiesKHX", |
| 6235 | VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME); |
| 6236 | skip |= parameter_validation_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX(my_data->report_data, pExternalSemaphoreInfo, |
| 6237 | pExternalSemaphoreProperties); |
| 6238 | if (!skip) { |
| 6239 | my_data->dispatch_table.GetPhysicalDeviceExternalSemaphorePropertiesKHX(physicalDevice, pExternalSemaphoreInfo, |
| 6240 | pExternalSemaphoreProperties); |
| 6241 | } |
| 6242 | } |
| 6243 | |
| 6244 | // Definitions for the VK_KHX_external_semaphore_fd extension |
| 6245 | |
| 6246 | VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreFdKHX(VkDevice device, const VkImportSemaphoreFdInfoKHX *pImportSemaphoreFdInfo) { |
| 6247 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6248 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6249 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6250 | assert(my_data != NULL); |
| 6251 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6252 | skip |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_fd, "vkImportSemaphoreFdKHX", |
| 6253 | VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6254 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6255 | skip |= parameter_validation_vkImportSemaphoreFdKHX(my_data->report_data, pImportSemaphoreFdInfo); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6256 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6257 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6258 | result = my_data->dispatch_table.ImportSemaphoreFdKHX(device, pImportSemaphoreFdInfo); |
| 6259 | validate_result(my_data->report_data, "vkImportSemaphoreFdKHX", result); |
| 6260 | } |
| 6261 | |
| 6262 | return result; |
| 6263 | } |
| 6264 | |
| 6265 | VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreFdKHX(VkDevice device, VkSemaphore semaphore, |
| 6266 | VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, int *pFd) { |
| 6267 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6268 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6269 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6270 | assert(my_data != NULL); |
| 6271 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6272 | skip |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_fd, "vkGetSemaphoreFdKHX", |
| 6273 | VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6274 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6275 | skip |= parameter_validation_vkGetSemaphoreFdKHX(my_data->report_data, semaphore, handleType, pFd); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6276 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6277 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6278 | result = my_data->dispatch_table.GetSemaphoreFdKHX(device, semaphore, handleType, pFd); |
| 6279 | validate_result(my_data->report_data, "vkGetSemaphoreFdKHX", result); |
| 6280 | } |
| 6281 | |
| 6282 | return result; |
| 6283 | } |
| 6284 | |
| 6285 | // Definitions for the VK_KHX_external_semaphore_win32 extension |
| 6286 | |
| 6287 | #ifdef VK_USE_PLATFORM_WIN32_KHX |
| 6288 | VKAPI_ATTR VkResult VKAPI_CALL |
| 6289 | ImportSemaphoreWin32HandleKHX(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHX *pImportSemaphoreWin32HandleInfo) { |
| 6290 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6291 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6292 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6293 | assert(my_data != NULL); |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6294 | skip |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_win32, "vkImportSemaphoreWin32HandleKHX", |
| 6295 | VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6296 | |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6297 | skip |= parameter_validation_vkImportSemaphoreWin32HandleKHX(my_data->report_data, pImportSemaphoreWin32HandleInfo); |
| 6298 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6299 | result = my_data->dispatch_table.ImportSemaphoreWin32HandleKHX(device, pImportSemaphoreWin32HandleInfo); |
| 6300 | validate_result(my_data->report_data, "vkImportSemaphoreWin32HandleKHX", result); |
| 6301 | } |
| 6302 | return result; |
| 6303 | } |
| 6304 | |
| 6305 | VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreWin32HandleKHX(VkDevice device, VkSemaphore semaphore, |
| 6306 | VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE *pHandle) { |
| 6307 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6308 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6309 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6310 | assert(my_data != NULL); |
Mark Lobodzinski | bdc3b02 | 2017-04-24 09:11:35 -0600 | [diff] [blame] | 6311 | skip |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_win32, "vkGetSemaphoreWin32HandleKHX", |
| 6312 | VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); |
| 6313 | skip |= parameter_validation_vkGetSemaphoreWin32HandleKHX(my_data->report_data, semaphore, handleType, pHandle); |
| 6314 | if (!skip) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6315 | result = my_data->dispatch_table.GetSemaphoreWin32HandleKHX(device, semaphore, handleType, pHandle); |
| 6316 | validate_result(my_data->report_data, "vkGetSemaphoreWin32HandleKHX", result); |
| 6317 | } |
| 6318 | return result; |
| 6319 | } |
| 6320 | #endif // VK_USE_PLATFORM_WIN32_KHX |
| 6321 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6322 | // Definitions for the VK_EXT_acquire_xlib_display extension |
| 6323 | |
| 6324 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT |
| 6325 | VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, VkDisplayKHR display) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6326 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6327 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6328 | assert(my_data != NULL); |
| 6329 | bool skip = false; |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 6330 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::ext_acquire_xlib_display, |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6331 | "vkAcquireXlibDisplayEXT", VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME); |
| 6332 | skip |= parameter_validation_vkAcquireXlibDisplayEXT(my_data->report_data, dpy, display); |
| 6333 | if (!skip) { |
| 6334 | result = my_data->dispatch_table.AcquireXlibDisplayEXT(physicalDevice, dpy, display); |
| 6335 | validate_result(my_data->report_data, "vkAcquireXlibDisplayEXT", result); |
| 6336 | } |
| 6337 | return result; |
| 6338 | } |
| 6339 | |
| 6340 | VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, RROutput rrOutput, |
| 6341 | VkDisplayKHR *pDisplay) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6342 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6343 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6344 | assert(my_data != NULL); |
| 6345 | bool skip = false; |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 6346 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::ext_acquire_xlib_display, |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6347 | "vkGetRandROutputDisplayEXT", VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME); |
| 6348 | skip |= parameter_validation_vkGetRandROutputDisplayEXT(my_data->report_data, dpy, rrOutput, pDisplay); |
| 6349 | if (!skip) { |
| 6350 | result = my_data->dispatch_table.GetRandROutputDisplayEXT(physicalDevice, dpy, rrOutput, pDisplay); |
| 6351 | validate_result(my_data->report_data, "vkGetRandROutputDisplayEXT", result); |
| 6352 | } |
| 6353 | return result; |
| 6354 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6355 | #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6356 | |
| 6357 | // Definitions for the VK_EXT_debug_marker Extension |
| 6358 | |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6359 | VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { |
| 6360 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6361 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6362 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6363 | assert(my_data != NULL); |
| 6364 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6365 | skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkDebugMarkerSetObjectTagEXT", |
| 6366 | VK_EXT_DEBUG_MARKER_EXTENSION_NAME); |
| 6367 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6368 | skip |= parameter_validation_vkDebugMarkerSetObjectTagEXT(my_data->report_data, pTagInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6369 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6370 | if (!skip) { |
Tobin Ehlis | 8ad4193 | 2016-12-01 09:37:56 -0700 | [diff] [blame] | 6371 | if (my_data->dispatch_table.DebugMarkerSetObjectTagEXT) { |
| 6372 | result = my_data->dispatch_table.DebugMarkerSetObjectTagEXT(device, pTagInfo); |
| 6373 | validate_result(my_data->report_data, "vkDebugMarkerSetObjectTagEXT", result); |
| 6374 | } else { |
| 6375 | result = VK_SUCCESS; |
| 6376 | } |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6377 | } |
| 6378 | |
| 6379 | return result; |
| 6380 | } |
| 6381 | |
| 6382 | VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { |
| 6383 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6384 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6385 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6386 | assert(my_data != NULL); |
| 6387 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6388 | skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkDebugMarkerSetObjectNameEXT", |
| 6389 | VK_EXT_DEBUG_MARKER_EXTENSION_NAME); |
| 6390 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6391 | skip |= parameter_validation_vkDebugMarkerSetObjectNameEXT(my_data->report_data, pNameInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6392 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6393 | if (!skip) { |
Tobin Ehlis | 8ad4193 | 2016-12-01 09:37:56 -0700 | [diff] [blame] | 6394 | if (my_data->dispatch_table.DebugMarkerSetObjectNameEXT) { |
| 6395 | result = my_data->dispatch_table.DebugMarkerSetObjectNameEXT(device, pNameInfo); |
| 6396 | validate_result(my_data->report_data, "vkDebugMarkerSetObjectNameEXT", result); |
| 6397 | } else { |
| 6398 | result = VK_SUCCESS; |
| 6399 | } |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6400 | } |
| 6401 | |
| 6402 | return result; |
| 6403 | } |
| 6404 | |
| 6405 | VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6406 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6407 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6408 | assert(my_data != NULL); |
| 6409 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6410 | skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkCmdDebugMarkerBeginEXT", |
| 6411 | VK_EXT_DEBUG_MARKER_EXTENSION_NAME); |
| 6412 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6413 | skip |= parameter_validation_vkCmdDebugMarkerBeginEXT(my_data->report_data, pMarkerInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6414 | |
Tobin Ehlis | 8ad4193 | 2016-12-01 09:37:56 -0700 | [diff] [blame] | 6415 | if (!skip && my_data->dispatch_table.CmdDebugMarkerBeginEXT) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 6416 | my_data->dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6417 | } |
| 6418 | } |
| 6419 | |
| 6420 | VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6421 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6422 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6423 | assert(my_data != NULL); |
| 6424 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6425 | skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkCmdDebugMarkerInsertEXT", |
| 6426 | VK_EXT_DEBUG_MARKER_EXTENSION_NAME); |
| 6427 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6428 | skip |= parameter_validation_vkCmdDebugMarkerInsertEXT(my_data->report_data, pMarkerInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6429 | |
Tobin Ehlis | 8ad4193 | 2016-12-01 09:37:56 -0700 | [diff] [blame] | 6430 | if (!skip && my_data->dispatch_table.CmdDebugMarkerInsertEXT) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 6431 | my_data->dispatch_table.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6432 | } |
| 6433 | } |
| 6434 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6435 | // Definitions for the VK_EXT_direct_mode_display extension |
| 6436 | |
| 6437 | VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6438 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6439 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6440 | assert(my_data != NULL); |
| 6441 | bool skip = false; |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 6442 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::ext_direct_mode_display, |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6443 | "vkReleaseDisplayEXT", VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME); |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6444 | #if 0 // Validation not automatically generated |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6445 | skip |= parameter_validation_vkReleaseDisplayEXT(my_data->report_data, display); |
| 6446 | #endif |
| 6447 | if (!skip) { |
| 6448 | result = my_data->dispatch_table.ReleaseDisplayEXT(physicalDevice, display); |
| 6449 | validate_result(my_data->report_data, "vkGetRandROutputDisplayEXT", result); |
| 6450 | } |
| 6451 | return result; |
| 6452 | } |
| 6453 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6454 | // Definitions for the VK_EXT_discard_rectangles extension |
| 6455 | |
| 6456 | VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, |
| 6457 | uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) { |
| 6458 | bool skip = false; |
| 6459 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6460 | assert(my_data != NULL); |
| 6461 | |
| 6462 | skip |= require_device_extension(my_data, my_data->enables.ext_discard_rectangles, "vkCmdSetDiscardRectangleEXT", |
| 6463 | VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME); |
| 6464 | |
| 6465 | skip |= parameter_validation_vkCmdSetDiscardRectangleEXT(my_data->report_data, firstDiscardRectangle, |
| 6466 | discardRectangleCount, pDiscardRectangles); |
| 6467 | |
| 6468 | if (!skip && my_data->dispatch_table.CmdSetDiscardRectangleEXT) { |
| 6469 | my_data->dispatch_table.CmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, |
| 6470 | pDiscardRectangles); |
| 6471 | } |
| 6472 | } |
| 6473 | |
| 6474 | // Definitions for the VK_EXT_display_control extension |
| 6475 | |
| 6476 | VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, |
| 6477 | const VkDisplayPowerInfoEXT *pDisplayPowerInfo) { |
| 6478 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6479 | bool skip = false; |
| 6480 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6481 | assert(my_data != NULL); |
| 6482 | |
| 6483 | skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkDisplayPowerControlEXT", |
| 6484 | VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); |
| 6485 | |
| 6486 | skip |= parameter_validation_vkDisplayPowerControlEXT(my_data->report_data, display, pDisplayPowerInfo); |
| 6487 | |
| 6488 | if (!skip) { |
| 6489 | if (my_data->dispatch_table.DisplayPowerControlEXT) { |
| 6490 | result = my_data->dispatch_table.DisplayPowerControlEXT(device, display, pDisplayPowerInfo); |
| 6491 | validate_result(my_data->report_data, "vkDisplayPowerControlEXT", result); |
| 6492 | } else { |
| 6493 | result = VK_SUCCESS; |
| 6494 | } |
| 6495 | } |
| 6496 | |
| 6497 | return result; |
| 6498 | } |
| 6499 | |
| 6500 | VKAPI_ATTR VkResult VKAPI_CALL RegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT *pDeviceEventInfo, |
| 6501 | const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
| 6502 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6503 | bool skip = false; |
| 6504 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6505 | assert(my_data != NULL); |
| 6506 | |
| 6507 | skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkRegisterDeviceEventEXT", |
| 6508 | VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); |
| 6509 | |
| 6510 | skip |= parameter_validation_vkRegisterDeviceEventEXT(my_data->report_data, pDeviceEventInfo, pAllocator, pFence); |
| 6511 | |
| 6512 | if (!skip) { |
| 6513 | if (my_data->dispatch_table.RegisterDeviceEventEXT) { |
| 6514 | result = my_data->dispatch_table.RegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence); |
| 6515 | validate_result(my_data->report_data, "vkRegisterDeviceEventEXT", result); |
| 6516 | } else { |
| 6517 | result = VK_SUCCESS; |
| 6518 | } |
| 6519 | } |
| 6520 | |
| 6521 | return result; |
| 6522 | } |
| 6523 | |
| 6524 | VKAPI_ATTR VkResult VKAPI_CALL RegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display, |
| 6525 | const VkDisplayEventInfoEXT *pDisplayEventInfo, |
| 6526 | const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
| 6527 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6528 | bool skip = false; |
| 6529 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6530 | assert(my_data != NULL); |
| 6531 | |
| 6532 | skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkRegisterDisplayEventEXT", |
| 6533 | VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); |
| 6534 | |
| 6535 | skip |= parameter_validation_vkRegisterDisplayEventEXT(my_data->report_data, display, pDisplayEventInfo, pAllocator, pFence); |
| 6536 | |
| 6537 | if (!skip) { |
| 6538 | if (my_data->dispatch_table.RegisterDisplayEventEXT) { |
| 6539 | result = my_data->dispatch_table.RegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence); |
| 6540 | validate_result(my_data->report_data, "vkRegisterDisplayEventEXT", result); |
| 6541 | } else { |
| 6542 | result = VK_SUCCESS; |
| 6543 | } |
| 6544 | } |
| 6545 | |
| 6546 | return result; |
| 6547 | } |
| 6548 | |
| 6549 | VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain, |
| 6550 | VkSurfaceCounterFlagBitsEXT counter, uint64_t *pCounterValue) { |
| 6551 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6552 | bool skip = false; |
| 6553 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6554 | assert(my_data != NULL); |
| 6555 | |
| 6556 | skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkGetSwapchainCounterEXT", |
| 6557 | VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); |
| 6558 | |
| 6559 | skip |= parameter_validation_vkGetSwapchainCounterEXT(my_data->report_data, swapchain, counter, pCounterValue); |
| 6560 | |
| 6561 | if (!skip) { |
| 6562 | if (my_data->dispatch_table.GetSwapchainCounterEXT) { |
| 6563 | result = my_data->dispatch_table.GetSwapchainCounterEXT(device, swapchain, counter, pCounterValue); |
| 6564 | validate_result(my_data->report_data, "vkGetSwapchainCounterEXT", result); |
| 6565 | } else { |
| 6566 | result = VK_SUCCESS; |
| 6567 | } |
| 6568 | } |
| 6569 | |
| 6570 | return result; |
| 6571 | } |
| 6572 | |
| 6573 | // Definitions for the VK_AMD_draw_indirect_count extension |
| 6574 | |
| 6575 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 6576 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 6577 | uint32_t stride) { |
| 6578 | bool skip = false; |
| 6579 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6580 | assert(my_data != NULL); |
| 6581 | skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdDrawIndirectCountAMD", |
| 6582 | VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME); |
| 6583 | skip |= parameter_validation_vkCmdDrawIndirectCountAMD(my_data->report_data, buffer, offset, countBuffer, countBufferOffset, |
| 6584 | maxDrawCount, stride); |
| 6585 | if (!skip) { |
| 6586 | my_data->dispatch_table.CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, |
| 6587 | stride); |
| 6588 | } |
| 6589 | } |
| 6590 | |
| 6591 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 6592 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
| 6593 | uint32_t maxDrawCount, uint32_t stride) { |
| 6594 | bool skip = false; |
| 6595 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6596 | assert(my_data != NULL); |
| 6597 | skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdDrawIndexedIndirectCountAMD", |
| 6598 | VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME); |
| 6599 | skip |= parameter_validation_vkCmdDrawIndexedIndirectCountAMD(my_data->report_data, buffer, offset, countBuffer, |
| 6600 | countBufferOffset, maxDrawCount, stride); |
| 6601 | if (!skip) { |
| 6602 | my_data->dispatch_table.CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, |
| 6603 | maxDrawCount, stride); |
| 6604 | } |
| 6605 | } |
| 6606 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6607 | // Definitions for the VK_EXT_display_surface_counter extension |
| 6608 | |
| 6609 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 6610 | VkSurfaceCapabilities2EXT *pSurfaceCapabilities) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6611 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6612 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6613 | assert(my_data != NULL); |
| 6614 | bool skip = false; |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 6615 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::ext_display_surface_counter, |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6616 | "vkGetPhysicalDeviceSurfaceCapabilities2EXT", VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 6617 | skip |= parameter_validation_vkGetPhysicalDeviceSurfaceCapabilities2EXT(my_data->report_data, surface, pSurfaceCapabilities); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6618 | if (!skip) { |
| 6619 | result = my_data->dispatch_table.GetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities); |
| 6620 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfaceCapabilities2EXT", result); |
| 6621 | } |
| 6622 | return result; |
| 6623 | } |
| 6624 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6625 | // Definitions for the VK_NV_clip_space_w_scaling Extension |
| 6626 | |
| 6627 | VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, |
| 6628 | const VkViewportWScalingNV *pViewportWScalings) { |
| 6629 | bool skip = false; |
| 6630 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6631 | assert(my_data != NULL); |
| 6632 | skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdSetViewportWScalingNV", |
| 6633 | VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME); |
| 6634 | #if 0 // Validation not automatically generated |
| 6635 | skip |= parameter_validation_vkCmdSetViewportWScalingNV(my_data->report_data, firstViewport, viewportCount, pViewportWScalings); |
| 6636 | #endif |
| 6637 | if (!skip) { |
| 6638 | my_data->dispatch_table.CmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings); |
| 6639 | } |
| 6640 | } |
| 6641 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6642 | // Definitions for the VK_NV_external_memory_capabilities Extension |
| 6643 | |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6644 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 6645 | VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, |
| 6646 | VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 6647 | VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6648 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6649 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6650 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6651 | assert(my_data != NULL); |
| 6652 | |
Chris Forbes | 8130cc5 | 2017-05-02 15:47:16 -0700 | [diff] [blame] | 6653 | skip |= require_instance_extension(physicalDevice, &InstanceExtensions::nv_external_memory_capabilities, |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6654 | "vkGetPhysicalDeviceExternalImageFormatPropertiesNV", |
| 6655 | VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); |
| 6656 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6657 | skip |= parameter_validation_vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6658 | my_data->report_data, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties); |
| 6659 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6660 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 6661 | result = my_data->dispatch_table.GetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 6662 | physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties); |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6663 | |
| 6664 | validate_result(my_data->report_data, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV", result); |
| 6665 | } |
| 6666 | |
| 6667 | return result; |
| 6668 | } |
| 6669 | |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6670 | // VK_NV_external_memory_win32 Extension |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6671 | |
| 6672 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6673 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, |
| 6674 | VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE *pHandle) { |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6675 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6676 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6677 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6678 | assert(my_data != NULL); |
| 6679 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6680 | skip |= require_device_extension(my_data, my_data->enables.nv_external_memory_win32, "vkGetMemoryWin32HandleNV", |
| 6681 | VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); |
| 6682 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6683 | skip |= parameter_validation_vkGetMemoryWin32HandleNV(my_data->report_data, memory, handleType, pHandle); |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6684 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6685 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 6686 | result = my_data->dispatch_table.GetMemoryWin32HandleNV(device, memory, handleType, pHandle); |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6687 | } |
| 6688 | |
| 6689 | return result; |
| 6690 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6691 | #endif // VK_USE_PLATFORM_WIN32_KHR |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6692 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6693 | // VK_NVX_device_generated_commands Extension |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6694 | |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6695 | VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX(VkCommandBuffer commandBuffer, |
| 6696 | const VkCmdProcessCommandsInfoNVX *pProcessCommandsInfo) { |
| 6697 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6698 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6699 | assert(my_data != NULL); |
| 6700 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCmdProcessCommandsNVX", |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6701 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6702 | skip |= parameter_validation_vkCmdProcessCommandsNVX(my_data->report_data, pProcessCommandsInfo); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6703 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6704 | my_data->dispatch_table.CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6705 | } |
| 6706 | } |
| 6707 | |
| 6708 | VKAPI_ATTR void VKAPI_CALL CmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer, |
| 6709 | const VkCmdReserveSpaceForCommandsInfoNVX *pReserveSpaceInfo) { |
| 6710 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6711 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6712 | assert(my_data != NULL); |
| 6713 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCmdReserveSpaceForCommandsNVX", |
| 6714 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
| 6715 | skip |= parameter_validation_vkCmdReserveSpaceForCommandsNVX(my_data->report_data, pReserveSpaceInfo); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6716 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6717 | my_data->dispatch_table.CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6718 | } |
| 6719 | } |
| 6720 | |
| 6721 | VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX(VkDevice device, |
| 6722 | const VkIndirectCommandsLayoutCreateInfoNVX *pCreateInfo, |
| 6723 | const VkAllocationCallbacks *pAllocator, |
| 6724 | VkIndirectCommandsLayoutNVX *pIndirectCommandsLayout) { |
| 6725 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6726 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6727 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6728 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6729 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCreateIndirectCommandsLayoutNVX", |
| 6730 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6731 | skip |= parameter_validation_vkCreateIndirectCommandsLayoutNVX(my_data->report_data, pCreateInfo, pAllocator, |
| 6732 | pIndirectCommandsLayout); |
| 6733 | if (!skip) { |
| 6734 | result = my_data->dispatch_table.CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6735 | validate_result(my_data->report_data, "vkCreateIndirectCommandsLayoutNVX", result); |
| 6736 | } |
| 6737 | return result; |
| 6738 | } |
| 6739 | |
| 6740 | VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 6741 | const VkAllocationCallbacks *pAllocator) { |
| 6742 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6743 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6744 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6745 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkDestroyIndirectCommandsLayoutNVX", |
| 6746 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6747 | #if 0 // Validation not automatically generated |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6748 | skip |= parameter_validation_vkDestroyIndirectCommandsLayoutNVX(my_data->report_data, indirectCommandsLayout, pAllocator); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6749 | #endif |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6750 | if (!skip) { |
| 6751 | my_data->dispatch_table.DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); |
| 6752 | } |
| 6753 | } |
| 6754 | |
| 6755 | VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX(VkDevice device, const VkObjectTableCreateInfoNVX *pCreateInfo, |
| 6756 | const VkAllocationCallbacks *pAllocator, VkObjectTableNVX *pObjectTable) { |
| 6757 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6758 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6759 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6760 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6761 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCreateObjectTableNVX", |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6762 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
| 6763 | skip |= parameter_validation_vkCreateObjectTableNVX(my_data->report_data, pCreateInfo, pAllocator, pObjectTable); |
| 6764 | if (!skip) { |
| 6765 | result = my_data->dispatch_table.CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6766 | validate_result(my_data->report_data, "vkCreateObjectTableNVX", result); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6767 | } |
| 6768 | return result; |
| 6769 | } |
| 6770 | |
| 6771 | VKAPI_ATTR void VKAPI_CALL DestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, |
| 6772 | const VkAllocationCallbacks *pAllocator) { |
| 6773 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6774 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6775 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6776 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkDestroyObjectTableNVX", |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6777 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6778 | #if 0 // Validation not automatically generated |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6779 | skip |= parameter_validation_vkDestroyObjectTableNVX(my_data->report_data, objectTable, pAllocator); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6780 | #endif |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6781 | if (!skip) { |
| 6782 | my_data->dispatch_table.DestroyObjectTableNVX(device, objectTable, pAllocator); |
| 6783 | } |
| 6784 | } |
| 6785 | |
| 6786 | VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, |
| 6787 | const VkObjectTableEntryNVX *const *ppObjectTableEntries, |
| 6788 | const uint32_t *pObjectIndices) { |
| 6789 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6790 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6791 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6792 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6793 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkRegisterObjectsNVX", |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6794 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
| 6795 | skip |= parameter_validation_vkRegisterObjectsNVX(my_data->report_data, objectTable, objectCount, ppObjectTableEntries, |
| 6796 | pObjectIndices); |
| 6797 | if (!skip) { |
| 6798 | result = my_data->dispatch_table.RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6799 | validate_result(my_data->report_data, "vkRegisterObjectsNVX", result); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6800 | } |
| 6801 | return result; |
| 6802 | } |
| 6803 | |
| 6804 | VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, |
| 6805 | const VkObjectEntryTypeNVX *pObjectEntryTypes, const uint32_t *pObjectIndices) { |
| 6806 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6807 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6808 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6809 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6810 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkUnregisterObjectsNVX", |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6811 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
| 6812 | skip |= parameter_validation_vkUnregisterObjectsNVX(my_data->report_data, objectTable, objectCount, pObjectEntryTypes, |
| 6813 | pObjectIndices); |
| 6814 | if (!skip) { |
| 6815 | result = my_data->dispatch_table.UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6816 | validate_result(my_data->report_data, "vkUnregisterObjectsNVX", result); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6817 | } |
| 6818 | return result; |
| 6819 | } |
| 6820 | |
| 6821 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX(VkPhysicalDevice physicalDevice, |
| 6822 | VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, |
| 6823 | VkDeviceGeneratedCommandsLimitsNVX *pLimits) { |
| 6824 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6825 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6826 | assert(my_data != NULL); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6827 | skip |= parameter_validation_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(my_data->report_data, pFeatures, pLimits); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6828 | if (!skip) { |
| 6829 | my_data->dispatch_table.GetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits); |
| 6830 | } |
| 6831 | } |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6832 | |
Mark Lobodzinski | 1d218cc | 2017-03-14 10:12:43 -0600 | [diff] [blame] | 6833 | VKAPI_ATTR VkResult VKAPI_CALL GetPastPresentationTimingGOOGLE(VkDevice device, VkSwapchainKHR swapchain, |
| 6834 | uint32_t *pPresentationTimingCount, |
| 6835 | VkPastPresentationTimingGOOGLE *pPresentationTimings) { |
| 6836 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6837 | bool skip = false; |
| 6838 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6839 | assert(my_data != NULL); |
| 6840 | skip |= parameter_validation_vkGetPastPresentationTimingGOOGLE(my_data->report_data, swapchain, pPresentationTimingCount, |
| 6841 | pPresentationTimings); |
| 6842 | if (!skip) { |
| 6843 | result = my_data->dispatch_table.GetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, |
| 6844 | pPresentationTimings); |
| 6845 | } |
| 6846 | return result; |
| 6847 | } |
| 6848 | |
| 6849 | VKAPI_ATTR VkResult VKAPI_CALL GetRefreshCycleDurationGOOGLE(VkDevice device, VkSwapchainKHR swapchain, |
| 6850 | VkRefreshCycleDurationGOOGLE *pDisplayTimingProperties) { |
| 6851 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6852 | bool skip = false; |
| 6853 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6854 | assert(my_data != NULL); |
| 6855 | skip |= parameter_validation_vkGetRefreshCycleDurationGOOGLE(my_data->report_data, swapchain, pDisplayTimingProperties); |
| 6856 | if (!skip) { |
| 6857 | result = my_data->dispatch_table.GetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties); |
| 6858 | } |
| 6859 | return result; |
| 6860 | } |
| 6861 | |
| 6862 | VKAPI_ATTR void VKAPI_CALL SetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, |
| 6863 | const VkHdrMetadataEXT *pMetadata) { |
| 6864 | bool skip = false; |
| 6865 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6866 | assert(my_data != NULL); |
| 6867 | skip |= parameter_validation_vkSetHdrMetadataEXT(my_data->report_data, swapchainCount, pSwapchains, pMetadata); |
| 6868 | if (!skip) { |
| 6869 | my_data->dispatch_table.SetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata); |
| 6870 | } |
| 6871 | } |
| 6872 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6873 | static inline PFN_vkVoidFunction layer_intercept_proc(const char *name) { |
| 6874 | for (unsigned int i = 0; i < sizeof(procmap) / sizeof(procmap[0]); i++) { |
| 6875 | if (!strcmp(name, procmap[i].name)) return procmap[i].pFunc; |
| 6876 | } |
| 6877 | return NULL; |
| 6878 | } |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6879 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 6880 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, const char *funcName) { |
Chia-I Wu | f9b0138 | 2016-05-16 07:37:41 +0800 | [diff] [blame] | 6881 | assert(device); |
| 6882 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6883 | PFN_vkVoidFunction addr = layer_intercept_proc(funcName); |
| 6884 | if (addr) return addr; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 6885 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6886 | layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 6887 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6888 | if (!dev_data->dispatch_table.GetDeviceProcAddr) return nullptr; |
| 6889 | return dev_data->dispatch_table.GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 6890 | } |
| 6891 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 6892 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr(VkInstance instance, const char *funcName) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 6893 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6894 | PFN_vkVoidFunction addr = layer_intercept_proc(funcName); |
| 6895 | if (addr) return addr; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 6896 | |
Chia-I Wu | 617f2a4 | 2016-05-16 07:41:17 +0800 | [diff] [blame] | 6897 | assert(instance); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 6898 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6899 | auto instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 6900 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6901 | if (!instance_data->dispatch_table.GetInstanceProcAddr) return nullptr; |
| 6902 | return instance_data->dispatch_table.GetInstanceProcAddr(instance, funcName); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 6903 | } |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 6904 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6905 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetPhysicalDeviceProcAddr(VkInstance instance, const char *funcName) { |
| 6906 | assert(instance); |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6907 | auto pdev_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6908 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 6909 | if (!pdev_data->dispatch_table.GetPhysicalDeviceProcAddr) return nullptr; |
| 6910 | return pdev_data->dispatch_table.GetPhysicalDeviceProcAddr(instance, funcName); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6911 | } |
| 6912 | |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6913 | } // namespace parameter_validation |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 6914 | |
| 6915 | // vk_layer_logging.h expects these to be defined |
| 6916 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 6917 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT(VkInstance instance, |
| 6918 | const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 6919 | const VkAllocationCallbacks *pAllocator, |
| 6920 | VkDebugReportCallbackEXT *pMsgCallback) { |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 6921 | return parameter_validation::CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 6922 | } |
| 6923 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 6924 | VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT msgCallback, |
| 6925 | const VkAllocationCallbacks *pAllocator) { |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 6926 | parameter_validation::DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 6927 | } |
| 6928 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 6929 | VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, |
| 6930 | VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, |
| 6931 | int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 6932 | parameter_validation::DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 6933 | } |
| 6934 | |
| 6935 | // loader-layer interface v0 |
| 6936 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 6937 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, |
| 6938 | VkExtensionProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 6939 | return parameter_validation::EnumerateInstanceExtensionProperties(pLayerName, pCount, pProperties); |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 6940 | } |
| 6941 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 6942 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pCount, |
| 6943 | VkLayerProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 6944 | return parameter_validation::EnumerateInstanceLayerProperties(pCount, pProperties); |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 6945 | } |
| 6946 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 6947 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, |
| 6948 | VkLayerProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 6949 | // the layer command handles VK_NULL_HANDLE just fine internally |
| 6950 | assert(physicalDevice == VK_NULL_HANDLE); |
| 6951 | return parameter_validation::EnumerateDeviceLayerProperties(VK_NULL_HANDLE, pCount, pProperties); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 6952 | } |
| 6953 | |
| 6954 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, |
| 6955 | const char *pLayerName, uint32_t *pCount, |
| 6956 | VkExtensionProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 6957 | // the layer command handles VK_NULL_HANDLE just fine internally |
| 6958 | assert(physicalDevice == VK_NULL_HANDLE); |
Chia-I Wu | 76a3466 | 2016-05-16 07:34:09 +0800 | [diff] [blame] | 6959 | return parameter_validation::EnumerateDeviceExtensionProperties(VK_NULL_HANDLE, pLayerName, pCount, pProperties); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 6960 | } |
| 6961 | |
| 6962 | VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice dev, const char *funcName) { |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 6963 | return parameter_validation::GetDeviceProcAddr(dev, funcName); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 6964 | } |
| 6965 | |
| 6966 | VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *funcName) { |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 6967 | return parameter_validation::GetInstanceProcAddr(instance, funcName); |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 6968 | } |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6969 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 6970 | VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_layerGetPhysicalDeviceProcAddr(VkInstance instance, |
| 6971 | const char *funcName) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6972 | return parameter_validation::GetPhysicalDeviceProcAddr(instance, funcName); |
| 6973 | } |
| 6974 | |
| 6975 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct) { |
| 6976 | assert(pVersionStruct != NULL); |
| 6977 | assert(pVersionStruct->sType == LAYER_NEGOTIATE_INTERFACE_STRUCT); |
| 6978 | |
| 6979 | // Fill in the function pointers if our version is at least capable of having the structure contain them. |
| 6980 | if (pVersionStruct->loaderLayerInterfaceVersion >= 2) { |
| 6981 | pVersionStruct->pfnGetInstanceProcAddr = vkGetInstanceProcAddr; |
| 6982 | pVersionStruct->pfnGetDeviceProcAddr = vkGetDeviceProcAddr; |
| 6983 | pVersionStruct->pfnGetPhysicalDeviceProcAddr = vk_layerGetPhysicalDeviceProcAddr; |
| 6984 | } |
| 6985 | |
| 6986 | if (pVersionStruct->loaderLayerInterfaceVersion < CURRENT_LOADER_LAYER_INTERFACE_VERSION) { |
| 6987 | parameter_validation::loader_layer_if_version = pVersionStruct->loaderLayerInterfaceVersion; |
| 6988 | } else if (pVersionStruct->loaderLayerInterfaceVersion > CURRENT_LOADER_LAYER_INTERFACE_VERSION) { |
| 6989 | pVersionStruct->loaderLayerInterfaceVersion = CURRENT_LOADER_LAYER_INTERFACE_VERSION; |
| 6990 | } |
| 6991 | |
| 6992 | return VK_SUCCESS; |
| 6993 | } |