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" |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 53 | |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 54 | namespace parameter_validation { |
Dustin Graves | b83fc2d | 2016-05-04 12:56:08 -0600 | [diff] [blame] | 55 | |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 56 | struct instance_layer_data { |
Chris Forbes | 7b57a39 | 2016-11-02 17:56:50 +1300 | [diff] [blame] | 57 | VkInstance instance = VK_NULL_HANDLE; |
Chia-I Wu | a570b7c | 2016-05-16 07:48:14 +0800 | [diff] [blame] | 58 | |
Chris Forbes | 7b57a39 | 2016-11-02 17:56:50 +1300 | [diff] [blame] | 59 | debug_report_data *report_data = nullptr; |
Courtney Goeltzenleuchter | 7415d5a | 2015-12-09 15:48:16 -0700 | [diff] [blame] | 60 | std::vector<VkDebugReportCallbackEXT> logging_callback; |
Cody Northrop | 55443ef | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 61 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 62 | // The following are for keeping track of the temporary callbacks that can |
| 63 | // be used in vkCreateInstance and vkDestroyInstance: |
Chris Forbes | 7b57a39 | 2016-11-02 17:56:50 +1300 | [diff] [blame] | 64 | uint32_t num_tmp_callbacks = 0; |
| 65 | VkDebugReportCallbackCreateInfoEXT *tmp_dbg_create_infos = nullptr; |
| 66 | VkDebugReportCallbackEXT *tmp_callbacks = nullptr; |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 67 | instance_extension_enables extensions = {}; |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 68 | |
| 69 | VkLayerInstanceDispatchTable dispatch_table = {}; |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 70 | }; |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 71 | |
Mark Lobodzinski | 02007fb | 2017-04-12 13:57:42 -0600 | [diff] [blame] | 72 | struct device_extension_enables { |
| 73 | bool khr_swapchain_enabled; |
| 74 | bool khr_display_swapchain_enabled; |
| 75 | bool khr_maintenance1; |
| 76 | bool khr_push_descriptor; |
| 77 | bool khr_descriptor_update_template; |
| 78 | bool khx_device_group; |
| 79 | bool khx_external_memory_fd; |
| 80 | bool khx_external_memory_win32; |
| 81 | bool khx_external_semaphore_fd; |
| 82 | bool khx_external_semaphore_win32; |
| 83 | bool ext_debug_marker; |
| 84 | bool ext_discard_rectangles; |
| 85 | bool ext_display_control; |
| 86 | bool amd_draw_indirect_count; |
| 87 | bool amd_negative_viewport_height; |
| 88 | bool nv_clip_space_w_scaling; |
| 89 | bool nv_external_memory; |
| 90 | bool nv_external_memory_win32; |
| 91 | bool nvx_device_generated_commands; |
| 92 | bool incremental_present; |
| 93 | }; |
| 94 | |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 95 | struct layer_data { |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 96 | debug_report_data *report_data = nullptr; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 97 | // Map for queue family index to queue count |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 98 | std::unordered_map<uint32_t, uint32_t> queueFamilyIndexMap; |
Chris Forbes | 7b57a39 | 2016-11-02 17:56:50 +1300 | [diff] [blame] | 99 | VkPhysicalDeviceLimits device_limits = {}; |
| 100 | VkPhysicalDeviceFeatures physical_device_features = {}; |
| 101 | VkPhysicalDevice physical_device = VK_NULL_HANDLE; |
Mark Lobodzinski | 02007fb | 2017-04-12 13:57:42 -0600 | [diff] [blame] | 102 | device_extension_enables enables; |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 103 | |
Mark Lobodzinski | 02007fb | 2017-04-12 13:57:42 -0600 | [diff] [blame] | 104 | layer_data() { memset(&enables, 0, sizeof(device_extension_enables)); } |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 105 | |
| 106 | VkLayerDispatchTable dispatch_table = {}; |
Cody Northrop | 55443ef | 2015-09-28 15:09:32 -0600 | [diff] [blame] | 107 | }; |
Mark Lobodzinski | 2eed1eb | 2015-05-26 10:58:40 -0500 | [diff] [blame] | 108 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 109 | static uint32_t loader_layer_if_version = CURRENT_LOADER_LAYER_INTERFACE_VERSION; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 110 | static std::unordered_map<void *, layer_data *> layer_data_map; |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 111 | static std::unordered_map<void *, instance_layer_data *> instance_layer_data_map; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 112 | |
Chris Forbes | 7b58a71 | 2016-11-24 11:35:31 +1300 | [diff] [blame] | 113 | 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] | 114 | 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] | 115 | } |
| 116 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 117 | VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT(VkInstance instance, |
| 118 | const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 119 | const VkAllocationCallbacks *pAllocator, |
| 120 | VkDebugReportCallbackEXT *pMsgCallback) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 121 | auto data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 122 | VkResult result = data->dispatch_table.CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 123 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 124 | if (result == VK_SUCCESS) { |
Mark Lobodzinski | 97c4d51 | 2016-05-19 15:27:18 -0600 | [diff] [blame] | 125 | result = layer_create_msg_callback(data->report_data, false, pCreateInfo, pAllocator, pMsgCallback); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | return result; |
| 129 | } |
| 130 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 131 | VKAPI_ATTR void VKAPI_CALL DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT msgCallback, |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 132 | const VkAllocationCallbacks *pAllocator) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 133 | auto data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 134 | data->dispatch_table.DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); |
| 135 | |
Courtney Goeltzenleuchter | 05854bf | 2015-11-30 12:13:14 -0700 | [diff] [blame] | 136 | layer_destroy_msg_callback(data->report_data, msgCallback, pAllocator); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 137 | } |
| 138 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 139 | VKAPI_ATTR void VKAPI_CALL DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, |
| 140 | VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, |
| 141 | int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 142 | auto data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 143 | data->dispatch_table.DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); |
Courtney Goeltzenleuchter | f0de724 | 2015-12-01 14:10:55 -0700 | [diff] [blame] | 144 | } |
| 145 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 146 | 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] | 147 | |
Chia-I Wu | 3384db8 | 2016-05-16 07:30:58 +0800 | [diff] [blame] | 148 | static const VkLayerProperties global_layer = { |
Jon Ashburn | dc9111c | 2016-03-22 12:57:13 -0600 | [diff] [blame] | 149 | "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] | 150 | }; |
Courtney Goeltzenleuchter | 5285766 | 2015-12-01 14:08:28 -0700 | [diff] [blame] | 151 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 152 | static bool ValidateEnumerator(VkFormatFeatureFlagBits const &enumerator) { |
Courtney Goeltzenleuchter | f1ece60 | 2015-09-10 16:25:49 -0600 | [diff] [blame] | 153 | VkFormatFeatureFlagBits allFlags = (VkFormatFeatureFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 154 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT | |
| 155 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT | |
| 156 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT | |
| 157 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | |
| 158 | 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] | 159 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 160 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 161 | return false; |
| 162 | } |
| 163 | |
| 164 | return true; |
| 165 | } |
| 166 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 167 | static std::string EnumeratorString(VkFormatFeatureFlagBits const &enumerator) { |
| 168 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 169 | return "unrecognized enumerator"; |
| 170 | } |
| 171 | |
| 172 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 173 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 174 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"); |
| 175 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 176 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 177 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"); |
| 178 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 179 | if (enumerator & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 180 | strings.push_back("VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 181 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 182 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 183 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"); |
| 184 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 185 | if (enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 186 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"); |
| 187 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 188 | if (enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 189 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"); |
| 190 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 191 | if (enumerator & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 192 | strings.push_back("VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"); |
| 193 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 194 | if (enumerator & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 195 | strings.push_back("VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"); |
| 196 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 197 | if (enumerator & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 198 | strings.push_back("VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"); |
| 199 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 200 | if (enumerator & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 201 | strings.push_back("VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
| 202 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 203 | if (enumerator & VK_FORMAT_FEATURE_BLIT_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 204 | strings.push_back("VK_FORMAT_FEATURE_BLIT_SRC_BIT"); |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 205 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 206 | if (enumerator & VK_FORMAT_FEATURE_BLIT_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 207 | strings.push_back("VK_FORMAT_FEATURE_BLIT_DST_BIT"); |
Cody Northrop | 61d6dd6 | 2015-08-18 14:58:29 -0600 | [diff] [blame] | 208 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 209 | if (enumerator & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) { |
Jon Ashburn | 766866a | 2016-01-22 15:39:20 -0700 | [diff] [blame] | 210 | strings.push_back("VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT"); |
| 211 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 212 | |
| 213 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 214 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 215 | enumeratorString += string; |
| 216 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 217 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 218 | enumeratorString += '|'; |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | return enumeratorString; |
| 223 | } |
| 224 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 225 | static bool ValidateEnumerator(VkImageUsageFlagBits const &enumerator) { |
| 226 | VkImageUsageFlagBits allFlags = (VkImageUsageFlagBits)( |
| 227 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | |
| 228 | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | |
| 229 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT); |
| 230 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 231 | return false; |
| 232 | } |
| 233 | |
| 234 | return true; |
| 235 | } |
| 236 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 237 | static std::string EnumeratorString(VkImageUsageFlagBits const &enumerator) { |
| 238 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 239 | return "unrecognized enumerator"; |
| 240 | } |
| 241 | |
| 242 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 243 | if (enumerator & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 244 | strings.push_back("VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT"); |
| 245 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 246 | if (enumerator & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { |
Courtney Goeltzenleuchter | 660f0ca | 2015-09-10 14:14:11 -0600 | [diff] [blame] | 247 | strings.push_back("VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 248 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 249 | if (enumerator & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 250 | strings.push_back("VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT"); |
| 251 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 252 | if (enumerator & VK_IMAGE_USAGE_STORAGE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 253 | strings.push_back("VK_IMAGE_USAGE_STORAGE_BIT"); |
| 254 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 255 | if (enumerator & VK_IMAGE_USAGE_SAMPLED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 256 | strings.push_back("VK_IMAGE_USAGE_SAMPLED_BIT"); |
| 257 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 258 | if (enumerator & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 259 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_DST_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 260 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 261 | if (enumerator & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 262 | strings.push_back("VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT"); |
| 263 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 264 | if (enumerator & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 265 | strings.push_back("VK_IMAGE_USAGE_TRANSFER_SRC_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 266 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 267 | |
| 268 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 269 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 270 | enumeratorString += string; |
| 271 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 272 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 273 | enumeratorString += '|'; |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | return enumeratorString; |
| 278 | } |
| 279 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 280 | static bool ValidateEnumerator(VkQueueFlagBits const &enumerator) { |
| 281 | VkQueueFlagBits allFlags = |
| 282 | (VkQueueFlagBits)(VK_QUEUE_TRANSFER_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_SPARSE_BINDING_BIT | VK_QUEUE_GRAPHICS_BIT); |
| 283 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 284 | return false; |
| 285 | } |
| 286 | |
| 287 | return true; |
| 288 | } |
| 289 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 290 | static std::string EnumeratorString(VkQueueFlagBits const &enumerator) { |
| 291 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 292 | return "unrecognized enumerator"; |
| 293 | } |
| 294 | |
| 295 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 296 | if (enumerator & VK_QUEUE_TRANSFER_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 297 | strings.push_back("VK_QUEUE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 298 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 299 | if (enumerator & VK_QUEUE_COMPUTE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 300 | strings.push_back("VK_QUEUE_COMPUTE_BIT"); |
| 301 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 302 | if (enumerator & VK_QUEUE_SPARSE_BINDING_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 303 | strings.push_back("VK_QUEUE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 304 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 305 | if (enumerator & VK_QUEUE_GRAPHICS_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 306 | strings.push_back("VK_QUEUE_GRAPHICS_BIT"); |
| 307 | } |
| 308 | |
| 309 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 310 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 311 | enumeratorString += string; |
| 312 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 313 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 314 | enumeratorString += '|'; |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | return enumeratorString; |
| 319 | } |
| 320 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 321 | static bool ValidateEnumerator(VkMemoryPropertyFlagBits const &enumerator) { |
| 322 | VkMemoryPropertyFlagBits allFlags = (VkMemoryPropertyFlagBits)( |
| 323 | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | |
| 324 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); |
| 325 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 326 | return false; |
| 327 | } |
| 328 | |
| 329 | return true; |
| 330 | } |
| 331 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 332 | static std::string EnumeratorString(VkMemoryPropertyFlagBits const &enumerator) { |
| 333 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 334 | return "unrecognized enumerator"; |
| 335 | } |
| 336 | |
| 337 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 338 | if (enumerator & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 339 | strings.push_back("VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT"); |
| 340 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 341 | if (enumerator & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 342 | strings.push_back("VK_MEMORY_PROPERTY_HOST_COHERENT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 343 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 344 | if (enumerator & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 345 | strings.push_back("VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT"); |
| 346 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 347 | if (enumerator & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 348 | strings.push_back("VK_MEMORY_PROPERTY_HOST_CACHED_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 349 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 350 | if (enumerator & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 351 | strings.push_back("VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 355 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 356 | enumeratorString += string; |
| 357 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 358 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 359 | enumeratorString += '|'; |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | return enumeratorString; |
| 364 | } |
| 365 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 366 | static bool ValidateEnumerator(VkMemoryHeapFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 367 | VkMemoryHeapFlagBits allFlags = (VkMemoryHeapFlagBits)(VK_MEMORY_HEAP_DEVICE_LOCAL_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 368 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 369 | return false; |
| 370 | } |
| 371 | |
| 372 | return true; |
| 373 | } |
| 374 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 375 | static std::string EnumeratorString(VkMemoryHeapFlagBits const &enumerator) { |
| 376 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 377 | return "unrecognized enumerator"; |
| 378 | } |
| 379 | |
| 380 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 381 | if (enumerator & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) { |
Chia-I Wu | c8ea02f | 2015-10-27 18:53:22 +0800 | [diff] [blame] | 382 | strings.push_back("VK_MEMORY_HEAP_DEVICE_LOCAL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 383 | } |
| 384 | |
| 385 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 386 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 387 | enumeratorString += string; |
| 388 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 389 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 390 | enumeratorString += '|'; |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | return enumeratorString; |
| 395 | } |
| 396 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 397 | static bool ValidateEnumerator(VkSparseImageFormatFlagBits const &enumerator) { |
| 398 | VkSparseImageFormatFlagBits allFlags = |
| 399 | (VkSparseImageFormatFlagBits)(VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT | |
| 400 | VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT | VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT); |
| 401 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 402 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 403 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 404 | |
| 405 | return true; |
| 406 | } |
| 407 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 408 | static std::string EnumeratorString(VkSparseImageFormatFlagBits const &enumerator) { |
| 409 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 410 | return "unrecognized enumerator"; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 411 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 412 | |
| 413 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 414 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 415 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 416 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 417 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 418 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 419 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 420 | if (enumerator & VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT) { |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 421 | strings.push_back("VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 422 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 423 | |
| 424 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 425 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 426 | enumeratorString += string; |
| 427 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 428 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 429 | enumeratorString += '|'; |
| 430 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 431 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 432 | |
| 433 | return enumeratorString; |
| 434 | } |
| 435 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 436 | static bool ValidateEnumerator(VkFenceCreateFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 437 | VkFenceCreateFlagBits allFlags = (VkFenceCreateFlagBits)(VK_FENCE_CREATE_SIGNALED_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 438 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 439 | return false; |
| 440 | } |
| 441 | |
| 442 | return true; |
| 443 | } |
| 444 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 445 | static std::string EnumeratorString(VkFenceCreateFlagBits const &enumerator) { |
| 446 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 447 | return "unrecognized enumerator"; |
| 448 | } |
| 449 | |
| 450 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 451 | if (enumerator & VK_FENCE_CREATE_SIGNALED_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 452 | strings.push_back("VK_FENCE_CREATE_SIGNALED_BIT"); |
| 453 | } |
| 454 | |
| 455 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 456 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 457 | enumeratorString += string; |
| 458 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 459 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 460 | enumeratorString += '|'; |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | return enumeratorString; |
| 465 | } |
| 466 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 467 | static bool ValidateEnumerator(VkQueryPipelineStatisticFlagBits const &enumerator) { |
| 468 | VkQueryPipelineStatisticFlagBits allFlags = (VkQueryPipelineStatisticFlagBits)( |
| 469 | VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT | |
| 470 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT | |
| 471 | VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT | |
| 472 | 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] | 473 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT | |
| 474 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT | |
| 475 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 476 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 477 | return false; |
| 478 | } |
| 479 | |
| 480 | return true; |
| 481 | } |
| 482 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 483 | static std::string EnumeratorString(VkQueryPipelineStatisticFlagBits const &enumerator) { |
| 484 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 485 | return "unrecognized enumerator"; |
| 486 | } |
| 487 | |
| 488 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 489 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 490 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_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_INPUT_ASSEMBLY_VERTICES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 493 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_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_INPUT_ASSEMBLY_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 496 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 497 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 498 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 499 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 500 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 501 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 502 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 503 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 504 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 505 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 506 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 507 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 508 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 509 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 510 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 511 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 512 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 513 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 514 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 515 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 516 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 517 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 518 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 519 | if (enumerator & VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 520 | strings.push_back("VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 521 | } |
| 522 | |
| 523 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 524 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 525 | enumeratorString += string; |
| 526 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 527 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 528 | enumeratorString += '|'; |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | return enumeratorString; |
| 533 | } |
| 534 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 535 | static bool ValidateEnumerator(VkQueryResultFlagBits const &enumerator) { |
| 536 | VkQueryResultFlagBits allFlags = (VkQueryResultFlagBits)(VK_QUERY_RESULT_PARTIAL_BIT | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | |
| 537 | VK_QUERY_RESULT_WAIT_BIT | VK_QUERY_RESULT_64_BIT); |
| 538 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 539 | return false; |
| 540 | } |
| 541 | |
| 542 | return true; |
| 543 | } |
| 544 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 545 | static std::string EnumeratorString(VkQueryResultFlagBits const &enumerator) { |
| 546 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 547 | return "unrecognized enumerator"; |
| 548 | } |
| 549 | |
| 550 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 551 | if (enumerator & VK_QUERY_RESULT_PARTIAL_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 552 | strings.push_back("VK_QUERY_RESULT_PARTIAL_BIT"); |
| 553 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 554 | if (enumerator & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 555 | strings.push_back("VK_QUERY_RESULT_WITH_AVAILABILITY_BIT"); |
| 556 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 557 | if (enumerator & VK_QUERY_RESULT_WAIT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 558 | strings.push_back("VK_QUERY_RESULT_WAIT_BIT"); |
| 559 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 560 | if (enumerator & VK_QUERY_RESULT_64_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 561 | strings.push_back("VK_QUERY_RESULT_64_BIT"); |
| 562 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 563 | |
| 564 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 565 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 566 | enumeratorString += string; |
| 567 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 568 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 569 | enumeratorString += '|'; |
| 570 | } |
| 571 | } |
| 572 | |
| 573 | return enumeratorString; |
| 574 | } |
| 575 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 576 | static bool ValidateEnumerator(VkBufferUsageFlagBits const &enumerator) { |
| 577 | VkBufferUsageFlagBits allFlags = (VkBufferUsageFlagBits)( |
| 578 | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | |
| 579 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | |
| 580 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT); |
| 581 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 582 | return false; |
| 583 | } |
| 584 | |
| 585 | return true; |
| 586 | } |
| 587 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 588 | static std::string EnumeratorString(VkBufferUsageFlagBits const &enumerator) { |
| 589 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 590 | return "unrecognized enumerator"; |
| 591 | } |
| 592 | |
| 593 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 594 | if (enumerator & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 595 | strings.push_back("VK_BUFFER_USAGE_VERTEX_BUFFER_BIT"); |
| 596 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 597 | if (enumerator & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 598 | strings.push_back("VK_BUFFER_USAGE_INDEX_BUFFER_BIT"); |
| 599 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 600 | if (enumerator & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 601 | strings.push_back("VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
| 602 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 603 | if (enumerator & VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 604 | strings.push_back("VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT"); |
| 605 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 606 | if (enumerator & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 607 | strings.push_back("VK_BUFFER_USAGE_STORAGE_BUFFER_BIT"); |
| 608 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 609 | if (enumerator & VK_BUFFER_USAGE_TRANSFER_DST_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 610 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_DST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 611 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 612 | if (enumerator & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 613 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT"); |
| 614 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 615 | if (enumerator & VK_BUFFER_USAGE_TRANSFER_SRC_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 616 | strings.push_back("VK_BUFFER_USAGE_TRANSFER_SRC_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 617 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 618 | if (enumerator & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 619 | strings.push_back("VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT"); |
| 620 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 621 | |
| 622 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 623 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 624 | enumeratorString += string; |
| 625 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 626 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 627 | enumeratorString += '|'; |
| 628 | } |
| 629 | } |
| 630 | |
| 631 | return enumeratorString; |
| 632 | } |
| 633 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 634 | static bool ValidateEnumerator(VkBufferCreateFlagBits const &enumerator) { |
| 635 | VkBufferCreateFlagBits allFlags = (VkBufferCreateFlagBits)( |
| 636 | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_BINDING_BIT); |
| 637 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 638 | return false; |
| 639 | } |
| 640 | |
| 641 | return true; |
| 642 | } |
| 643 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 644 | static std::string EnumeratorString(VkBufferCreateFlagBits const &enumerator) { |
| 645 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 646 | return "unrecognized enumerator"; |
| 647 | } |
| 648 | |
| 649 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 650 | if (enumerator & VK_BUFFER_CREATE_SPARSE_ALIASED_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 651 | strings.push_back("VK_BUFFER_CREATE_SPARSE_ALIASED_BIT"); |
| 652 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 653 | if (enumerator & VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 654 | strings.push_back("VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT"); |
| 655 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 656 | if (enumerator & VK_BUFFER_CREATE_SPARSE_BINDING_BIT) { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 657 | strings.push_back("VK_BUFFER_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 658 | } |
| 659 | |
| 660 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 661 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 662 | enumeratorString += string; |
| 663 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 664 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 665 | enumeratorString += '|'; |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | return enumeratorString; |
| 670 | } |
| 671 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 672 | static bool ValidateEnumerator(VkImageCreateFlagBits const &enumerator) { |
| 673 | VkImageCreateFlagBits allFlags = (VkImageCreateFlagBits)( |
| 674 | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | |
| 675 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_SPARSE_BINDING_BIT); |
| 676 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 677 | return false; |
| 678 | } |
| 679 | |
| 680 | return true; |
| 681 | } |
| 682 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 683 | static std::string EnumeratorString(VkImageCreateFlagBits const &enumerator) { |
| 684 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 685 | return "unrecognized enumerator"; |
| 686 | } |
| 687 | |
| 688 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 689 | if (enumerator & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 690 | strings.push_back("VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT"); |
| 691 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 692 | if (enumerator & VK_IMAGE_CREATE_SPARSE_ALIASED_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 693 | strings.push_back("VK_IMAGE_CREATE_SPARSE_ALIASED_BIT"); |
| 694 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 695 | if (enumerator & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 696 | strings.push_back("VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT"); |
| 697 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 698 | if (enumerator & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 699 | strings.push_back("VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT"); |
| 700 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 701 | if (enumerator & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) { |
Courtney Goeltzenleuchter | 8134da0 | 2015-09-10 17:00:22 -0600 | [diff] [blame] | 702 | strings.push_back("VK_IMAGE_CREATE_SPARSE_BINDING_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 703 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 704 | |
| 705 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 706 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 707 | enumeratorString += string; |
| 708 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 709 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 710 | enumeratorString += '|'; |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | return enumeratorString; |
| 715 | } |
| 716 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 717 | static bool ValidateEnumerator(VkColorComponentFlagBits const &enumerator) { |
| 718 | VkColorComponentFlagBits allFlags = (VkColorComponentFlagBits)(VK_COLOR_COMPONENT_A_BIT | VK_COLOR_COMPONENT_B_BIT | |
| 719 | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_R_BIT); |
| 720 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 721 | return false; |
| 722 | } |
| 723 | |
| 724 | return true; |
| 725 | } |
| 726 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 727 | static std::string EnumeratorString(VkColorComponentFlagBits const &enumerator) { |
| 728 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 729 | return "unrecognized enumerator"; |
| 730 | } |
| 731 | |
| 732 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 733 | if (enumerator & VK_COLOR_COMPONENT_A_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 734 | strings.push_back("VK_COLOR_COMPONENT_A_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 735 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 736 | if (enumerator & VK_COLOR_COMPONENT_B_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 737 | strings.push_back("VK_COLOR_COMPONENT_B_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 738 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 739 | if (enumerator & VK_COLOR_COMPONENT_G_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 740 | strings.push_back("VK_COLOR_COMPONENT_G_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 741 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 742 | if (enumerator & VK_COLOR_COMPONENT_R_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 743 | strings.push_back("VK_COLOR_COMPONENT_R_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 744 | } |
| 745 | |
| 746 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 747 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 748 | enumeratorString += string; |
| 749 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 750 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 751 | enumeratorString += '|'; |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | return enumeratorString; |
| 756 | } |
| 757 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 758 | static bool ValidateEnumerator(VkPipelineCreateFlagBits const &enumerator) { |
| 759 | VkPipelineCreateFlagBits allFlags = (VkPipelineCreateFlagBits)( |
| 760 | VK_PIPELINE_CREATE_DERIVATIVE_BIT | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT); |
| 761 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 762 | return false; |
| 763 | } |
| 764 | |
| 765 | return true; |
| 766 | } |
| 767 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 768 | static std::string EnumeratorString(VkPipelineCreateFlagBits const &enumerator) { |
| 769 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 770 | return "unrecognized enumerator"; |
| 771 | } |
| 772 | |
| 773 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 774 | if (enumerator & VK_PIPELINE_CREATE_DERIVATIVE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 775 | strings.push_back("VK_PIPELINE_CREATE_DERIVATIVE_BIT"); |
| 776 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 777 | if (enumerator & VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 778 | strings.push_back("VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT"); |
| 779 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 780 | if (enumerator & VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 781 | strings.push_back("VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 782 | } |
| 783 | |
| 784 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 785 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 786 | enumeratorString += string; |
| 787 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 788 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 789 | enumeratorString += '|'; |
| 790 | } |
| 791 | } |
| 792 | |
| 793 | return enumeratorString; |
| 794 | } |
| 795 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 796 | static bool ValidateEnumerator(VkShaderStageFlagBits const &enumerator) { |
| 797 | VkShaderStageFlagBits allFlags = (VkShaderStageFlagBits)( |
| 798 | VK_SHADER_STAGE_ALL | VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_GEOMETRY_BIT | VK_SHADER_STAGE_COMPUTE_BIT | |
| 799 | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_VERTEX_BIT); |
| 800 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 801 | return false; |
| 802 | } |
| 803 | |
| 804 | return true; |
| 805 | } |
| 806 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 807 | static std::string EnumeratorString(VkShaderStageFlagBits const &enumerator) { |
| 808 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 809 | return "unrecognized enumerator"; |
| 810 | } |
| 811 | |
| 812 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 813 | if (enumerator & VK_SHADER_STAGE_ALL) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 814 | strings.push_back("VK_SHADER_STAGE_ALL"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 815 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 816 | if (enumerator & VK_SHADER_STAGE_FRAGMENT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 817 | strings.push_back("VK_SHADER_STAGE_FRAGMENT_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 818 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 819 | if (enumerator & VK_SHADER_STAGE_GEOMETRY_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 820 | strings.push_back("VK_SHADER_STAGE_GEOMETRY_BIT"); |
| 821 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 822 | if (enumerator & VK_SHADER_STAGE_COMPUTE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 823 | strings.push_back("VK_SHADER_STAGE_COMPUTE_BIT"); |
| 824 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 825 | if (enumerator & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 826 | strings.push_back("VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 827 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 828 | if (enumerator & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 829 | strings.push_back("VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 830 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 831 | if (enumerator & VK_SHADER_STAGE_VERTEX_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 832 | strings.push_back("VK_SHADER_STAGE_VERTEX_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 833 | } |
| 834 | |
| 835 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 836 | for (auto const &string : strings) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 837 | enumeratorString += string; |
| 838 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 839 | if (string != strings.back()) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 840 | enumeratorString += '|'; |
| 841 | } |
| 842 | } |
| 843 | |
| 844 | return enumeratorString; |
| 845 | } |
| 846 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 847 | static bool ValidateEnumerator(VkPipelineStageFlagBits const &enumerator) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 848 | VkPipelineStageFlagBits allFlags = (VkPipelineStageFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 849 | VK_PIPELINE_STAGE_ALL_COMMANDS_BIT | VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT | VK_PIPELINE_STAGE_HOST_BIT | |
| 850 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | |
| 851 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT | |
| 852 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | |
| 853 | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | |
| 854 | 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] | 855 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 856 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 857 | return false; |
| 858 | } |
| 859 | |
| 860 | return true; |
| 861 | } |
| 862 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 863 | static std::string EnumeratorString(VkPipelineStageFlagBits const &enumerator) { |
| 864 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 865 | return "unrecognized enumerator"; |
| 866 | } |
| 867 | |
| 868 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 869 | if (enumerator & VK_PIPELINE_STAGE_ALL_COMMANDS_BIT) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 870 | strings.push_back("VK_PIPELINE_STAGE_ALL_COMMANDS_BIT"); |
| 871 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 872 | if (enumerator & VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT) { |
Chia-I Wu | 89d0f94 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 873 | strings.push_back("VK_PIPELINE_STAGE_ALL_GRAPHICS_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_HOST_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 876 | strings.push_back("VK_PIPELINE_STAGE_HOST_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 877 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 878 | if (enumerator & VK_PIPELINE_STAGE_TRANSFER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 879 | strings.push_back("VK_PIPELINE_STAGE_TRANSFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 880 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 881 | if (enumerator & VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 882 | strings.push_back("VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 883 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 884 | if (enumerator & VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT) { |
Jon Ashburn | 4bf8ba4 | 2015-12-31 12:14:37 -0700 | [diff] [blame] | 885 | strings.push_back("VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 886 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 887 | if (enumerator & VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 888 | strings.push_back("VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 889 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 890 | if (enumerator & VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 891 | strings.push_back("VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 892 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 893 | if (enumerator & VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT) { |
Courtney Goeltzenleuchter | 9683589 | 2015-10-15 17:35:38 -0600 | [diff] [blame] | 894 | strings.push_back("VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 895 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 896 | if (enumerator & VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 897 | strings.push_back("VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 898 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 899 | if (enumerator & VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 900 | strings.push_back("VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT"); |
| 901 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 902 | if (enumerator & VK_PIPELINE_STAGE_VERTEX_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 903 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_SHADER_BIT"); |
| 904 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 905 | if (enumerator & VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 906 | strings.push_back("VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 907 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 908 | if (enumerator & VK_PIPELINE_STAGE_VERTEX_INPUT_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 909 | strings.push_back("VK_PIPELINE_STAGE_VERTEX_INPUT_BIT"); |
| 910 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 911 | if (enumerator & VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 912 | strings.push_back("VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT"); |
| 913 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 914 | if (enumerator & VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 915 | strings.push_back("VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT"); |
| 916 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 917 | if (enumerator & VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 918 | strings.push_back("VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 919 | } |
| 920 | |
| 921 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 922 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 923 | enumeratorString += string; |
| 924 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 925 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 926 | enumeratorString += '|'; |
| 927 | } |
| 928 | } |
| 929 | |
| 930 | return enumeratorString; |
| 931 | } |
| 932 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 933 | static bool ValidateEnumerator(VkAccessFlagBits const &enumerator) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 934 | VkAccessFlagBits allFlags = (VkAccessFlagBits)( |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 935 | VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_INDEX_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT | |
| 936 | VK_ACCESS_UNIFORM_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | |
| 937 | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | |
| 938 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT | |
| 939 | 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] | 940 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 941 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 942 | return false; |
| 943 | } |
| 944 | |
| 945 | return true; |
| 946 | } |
| 947 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 948 | static std::string EnumeratorString(VkAccessFlagBits const &enumerator) { |
| 949 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 950 | return "unrecognized enumerator"; |
| 951 | } |
| 952 | |
| 953 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 954 | if (enumerator & VK_ACCESS_INDIRECT_COMMAND_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 955 | strings.push_back("VK_ACCESS_INDIRECT_COMMAND_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 956 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 957 | if (enumerator & VK_ACCESS_INDEX_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 958 | strings.push_back("VK_ACCESS_INDEX_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 959 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 960 | if (enumerator & VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 961 | strings.push_back("VK_ACCESS_VERTEX_ATTRIBUTE_READ_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_UNIFORM_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 964 | strings.push_back("VK_ACCESS_UNIFORM_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_INPUT_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 967 | strings.push_back("VK_ACCESS_INPUT_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 968 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 969 | if (enumerator & VK_ACCESS_SHADER_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 970 | strings.push_back("VK_ACCESS_SHADER_READ_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 971 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 972 | if (enumerator & VK_ACCESS_SHADER_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 973 | strings.push_back("VK_ACCESS_SHADER_WRITE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 974 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 975 | if (enumerator & VK_ACCESS_COLOR_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 976 | strings.push_back("VK_ACCESS_COLOR_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 977 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 978 | if (enumerator & VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 979 | strings.push_back("VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 980 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 981 | if (enumerator & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 982 | strings.push_back("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 983 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 984 | if (enumerator & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 985 | strings.push_back("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 986 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 987 | if (enumerator & VK_ACCESS_TRANSFER_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 988 | strings.push_back("VK_ACCESS_TRANSFER_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 989 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 990 | if (enumerator & VK_ACCESS_TRANSFER_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 991 | strings.push_back("VK_ACCESS_TRANSFER_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 992 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 993 | if (enumerator & VK_ACCESS_HOST_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 994 | strings.push_back("VK_ACCESS_HOST_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 995 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 996 | if (enumerator & VK_ACCESS_HOST_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 997 | strings.push_back("VK_ACCESS_HOST_WRITE_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 998 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 999 | if (enumerator & VK_ACCESS_MEMORY_READ_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1000 | strings.push_back("VK_ACCESS_MEMORY_READ_BIT"); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1001 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1002 | if (enumerator & VK_ACCESS_MEMORY_WRITE_BIT) { |
Chia-I Wu | a459420 | 2015-10-27 19:54:37 +0800 | [diff] [blame] | 1003 | strings.push_back("VK_ACCESS_MEMORY_WRITE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1004 | } |
| 1005 | |
| 1006 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1007 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1008 | enumeratorString += string; |
| 1009 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1010 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1011 | enumeratorString += '|'; |
| 1012 | } |
| 1013 | } |
| 1014 | |
| 1015 | return enumeratorString; |
| 1016 | } |
| 1017 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1018 | static bool ValidateEnumerator(VkCommandPoolCreateFlagBits const &enumerator) { |
| 1019 | VkCommandPoolCreateFlagBits allFlags = |
| 1020 | (VkCommandPoolCreateFlagBits)(VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT); |
| 1021 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1022 | return false; |
| 1023 | } |
| 1024 | |
| 1025 | return true; |
| 1026 | } |
| 1027 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1028 | static std::string EnumeratorString(VkCommandPoolCreateFlagBits const &enumerator) { |
| 1029 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1030 | return "unrecognized enumerator"; |
| 1031 | } |
| 1032 | |
| 1033 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1034 | if (enumerator & VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1035 | strings.push_back("VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1036 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1037 | if (enumerator & VK_COMMAND_POOL_CREATE_TRANSIENT_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1038 | strings.push_back("VK_COMMAND_POOL_CREATE_TRANSIENT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1039 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1040 | |
| 1041 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1042 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1043 | enumeratorString += string; |
| 1044 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1045 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1046 | enumeratorString += '|'; |
| 1047 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1048 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1049 | |
| 1050 | return enumeratorString; |
| 1051 | } |
| 1052 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1053 | static bool ValidateEnumerator(VkCommandPoolResetFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1054 | VkCommandPoolResetFlagBits allFlags = (VkCommandPoolResetFlagBits)(VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1055 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1056 | return false; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1057 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1058 | |
| 1059 | return true; |
| 1060 | } |
| 1061 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1062 | static std::string EnumeratorString(VkCommandPoolResetFlagBits const &enumerator) { |
| 1063 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1064 | return "unrecognized enumerator"; |
| 1065 | } |
| 1066 | |
| 1067 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1068 | if (enumerator & VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1069 | strings.push_back("VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1070 | } |
| 1071 | |
| 1072 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1073 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1074 | enumeratorString += string; |
| 1075 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1076 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1077 | enumeratorString += '|'; |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | return enumeratorString; |
| 1082 | } |
| 1083 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1084 | static bool ValidateEnumerator(VkCommandBufferUsageFlags const &enumerator) { |
| 1085 | VkCommandBufferUsageFlags allFlags = |
| 1086 | (VkCommandBufferUsageFlags)(VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT | VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT | |
| 1087 | VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT); |
| 1088 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1089 | return false; |
| 1090 | } |
| 1091 | |
| 1092 | return true; |
| 1093 | } |
| 1094 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1095 | static std::string EnumeratorString(VkCommandBufferUsageFlags const &enumerator) { |
| 1096 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1097 | return "unrecognized enumerator"; |
| 1098 | } |
| 1099 | |
| 1100 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1101 | if (enumerator & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1102 | strings.push_back("VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1103 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1104 | if (enumerator & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1105 | strings.push_back("VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1106 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1107 | if (enumerator & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1108 | strings.push_back("VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1109 | } |
| 1110 | |
| 1111 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1112 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1113 | enumeratorString += string; |
| 1114 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1115 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1116 | enumeratorString += '|'; |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | return enumeratorString; |
| 1121 | } |
| 1122 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1123 | static bool ValidateEnumerator(VkCommandBufferResetFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1124 | VkCommandBufferResetFlagBits allFlags = (VkCommandBufferResetFlagBits)(VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1125 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1126 | return false; |
| 1127 | } |
| 1128 | |
| 1129 | return true; |
| 1130 | } |
| 1131 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1132 | static std::string EnumeratorString(VkCommandBufferResetFlagBits const &enumerator) { |
| 1133 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1134 | return "unrecognized enumerator"; |
| 1135 | } |
| 1136 | |
| 1137 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1138 | if (enumerator & VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT) { |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 1139 | strings.push_back("VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT"); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1140 | } |
| 1141 | |
| 1142 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1143 | for (auto const &string : strings) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1144 | enumeratorString += string; |
| 1145 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1146 | if (string != strings.back()) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1147 | enumeratorString += '|'; |
| 1148 | } |
| 1149 | } |
| 1150 | |
| 1151 | return enumeratorString; |
| 1152 | } |
| 1153 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1154 | static bool ValidateEnumerator(VkImageAspectFlagBits const &enumerator) { |
| 1155 | VkImageAspectFlagBits allFlags = (VkImageAspectFlagBits)(VK_IMAGE_ASPECT_METADATA_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 1156 | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_COLOR_BIT); |
| 1157 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1158 | return false; |
| 1159 | } |
| 1160 | |
| 1161 | return true; |
| 1162 | } |
| 1163 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1164 | static std::string EnumeratorString(VkImageAspectFlagBits const &enumerator) { |
| 1165 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1166 | return "unrecognized enumerator"; |
| 1167 | } |
| 1168 | |
| 1169 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1170 | if (enumerator & VK_IMAGE_ASPECT_METADATA_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1171 | strings.push_back("VK_IMAGE_ASPECT_METADATA_BIT"); |
| 1172 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1173 | if (enumerator & VK_IMAGE_ASPECT_STENCIL_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1174 | strings.push_back("VK_IMAGE_ASPECT_STENCIL_BIT"); |
| 1175 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1176 | if (enumerator & VK_IMAGE_ASPECT_DEPTH_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1177 | strings.push_back("VK_IMAGE_ASPECT_DEPTH_BIT"); |
| 1178 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1179 | if (enumerator & VK_IMAGE_ASPECT_COLOR_BIT) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1180 | strings.push_back("VK_IMAGE_ASPECT_COLOR_BIT"); |
| 1181 | } |
| 1182 | |
| 1183 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1184 | for (auto const &string : strings) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1185 | enumeratorString += string; |
| 1186 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1187 | if (string != strings.back()) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1188 | enumeratorString += '|'; |
| 1189 | } |
| 1190 | } |
| 1191 | |
| 1192 | return enumeratorString; |
| 1193 | } |
| 1194 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1195 | static bool ValidateEnumerator(VkQueryControlFlagBits const &enumerator) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 1196 | VkQueryControlFlagBits allFlags = (VkQueryControlFlagBits)(VK_QUERY_CONTROL_PRECISE_BIT); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1197 | if (enumerator & (~allFlags)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1198 | return false; |
| 1199 | } |
| 1200 | |
| 1201 | return true; |
| 1202 | } |
| 1203 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1204 | static std::string EnumeratorString(VkQueryControlFlagBits const &enumerator) { |
| 1205 | if (!ValidateEnumerator(enumerator)) { |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1206 | return "unrecognized enumerator"; |
| 1207 | } |
| 1208 | |
| 1209 | std::vector<std::string> strings; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1210 | if (enumerator & VK_QUERY_CONTROL_PRECISE_BIT) { |
Chia-I Wu | 1b99bb2 | 2015-10-27 19:25:11 +0800 | [diff] [blame] | 1211 | strings.push_back("VK_QUERY_CONTROL_PRECISE_BIT"); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1212 | } |
| 1213 | |
| 1214 | std::string enumeratorString; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1215 | for (auto const &string : strings) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1216 | enumeratorString += string; |
| 1217 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1218 | if (string != strings.back()) { |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1219 | enumeratorString += '|'; |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | return enumeratorString; |
| 1224 | } |
| 1225 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1226 | static const int MaxParamCheckerStringLength = 256; |
| 1227 | |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 1228 | 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] | 1229 | const char *validateString) { |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1230 | assert(apiName != nullptr); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1231 | assert(validateString != nullptr); |
| 1232 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1233 | bool skip = false; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1234 | |
| 1235 | VkStringErrorFlags result = vk_string_validate(MaxParamCheckerStringLength, validateString); |
| 1236 | |
| 1237 | if (result == VK_STRING_ERROR_NONE) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1238 | return skip; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1239 | } else if (result & VK_STRING_ERROR_LENGTH) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1240 | 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] | 1241 | INVALID_USAGE, LayerName, "%s: string %s exceeds max length %d", apiName, stringName.get_name().c_str(), |
| 1242 | MaxParamCheckerStringLength); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1243 | } else if (result & VK_STRING_ERROR_BAD_DATA) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1244 | 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] | 1245 | INVALID_USAGE, LayerName, "%s: string %s contains invalid characters or is badly formed", apiName, |
| 1246 | stringName.get_name().c_str()); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1247 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1248 | return skip; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1249 | } |
| 1250 | |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1251 | static bool validate_queue_family_index(layer_data *device_data, const char *function_name, const char *parameter_name, |
| 1252 | uint32_t index) { |
| 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 (index == VK_QUEUE_FAMILY_IGNORED) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1258 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1259 | "%s: %s cannot be VK_QUEUE_FAMILY_IGNORED.", function_name, parameter_name); |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1260 | } else { |
| 1261 | const auto &queue_data = device_data->queueFamilyIndexMap.find(index); |
| 1262 | if (queue_data == device_data->queueFamilyIndexMap.end()) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1263 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, |
| 1264 | "%s: %s (%d) must be one of the indices specified when the device was created, via " |
| 1265 | "the VkDeviceQueueCreateInfo structure.", |
| 1266 | function_name, parameter_name, index); |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1267 | return false; |
| 1268 | } |
| 1269 | } |
| 1270 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1271 | return skip; |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1272 | } |
| 1273 | |
| 1274 | static bool validate_queue_family_indices(layer_data *device_data, const char *function_name, const char *parameter_name, |
| 1275 | const uint32_t count, const uint32_t *indices) { |
| 1276 | assert(device_data != nullptr); |
| 1277 | debug_report_data *report_data = device_data->report_data; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1278 | bool skip = false; |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1279 | |
| 1280 | if (indices != nullptr) { |
| 1281 | for (uint32_t i = 0; i < count; i++) { |
| 1282 | if (indices[i] == VK_QUEUE_FAMILY_IGNORED) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1283 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1284 | 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] | 1285 | } else { |
| 1286 | const auto &queue_data = device_data->queueFamilyIndexMap.find(indices[i]); |
| 1287 | if (queue_data == device_data->queueFamilyIndexMap.end()) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1288 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 1289 | LayerName, |
| 1290 | "%s: %s[%d] (%d) must be one of the indices specified when the device was " |
| 1291 | "created, via the VkDeviceQueueCreateInfo structure.", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1292 | function_name, parameter_name, i, indices[i]); |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1293 | return false; |
| 1294 | } |
| 1295 | } |
| 1296 | } |
| 1297 | } |
| 1298 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1299 | return skip; |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1300 | } |
| 1301 | |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1302 | static void CheckInstanceRegisterExtensions(const VkInstanceCreateInfo *pCreateInfo, instance_layer_data *instance_data); |
Mark Lobodzinski | 7d80ef6 | 2016-08-15 16:22:50 -0600 | [diff] [blame] | 1303 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1304 | VKAPI_ATTR VkResult VKAPI_CALL CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, |
| 1305 | VkInstance *pInstance) { |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1306 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1307 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1308 | VkLayerInstanceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1309 | assert(chain_info != nullptr); |
| 1310 | assert(chain_info->u.pLayerInfo != nullptr); |
| 1311 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1312 | PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr; |
| 1313 | PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance)fpGetInstanceProcAddr(NULL, "vkCreateInstance"); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1314 | if (fpCreateInstance == NULL) { |
| 1315 | return VK_ERROR_INITIALIZATION_FAILED; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1316 | } |
| 1317 | |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1318 | // Advance the link info for the next element on the chain |
| 1319 | chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext; |
| 1320 | |
| 1321 | result = fpCreateInstance(pCreateInfo, pAllocator, pInstance); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1322 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1323 | if (result == VK_SUCCESS) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1324 | 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] | 1325 | assert(my_instance_data != nullptr); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1326 | |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1327 | 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] | 1328 | my_instance_data->instance = *pInstance; |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1329 | my_instance_data->report_data = |
| 1330 | debug_report_create_instance(&my_instance_data->dispatch_table, *pInstance, pCreateInfo->enabledExtensionCount, |
| 1331 | pCreateInfo->ppEnabledExtensionNames); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1332 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1333 | // Look for one or more debug report create info structures |
| 1334 | // and setup a callback(s) for each one found. |
| 1335 | if (!layer_copy_tmp_callbacks(pCreateInfo->pNext, &my_instance_data->num_tmp_callbacks, |
| 1336 | &my_instance_data->tmp_dbg_create_infos, &my_instance_data->tmp_callbacks)) { |
| 1337 | if (my_instance_data->num_tmp_callbacks > 0) { |
| 1338 | // Setup the temporary callback(s) here to catch early issues: |
| 1339 | if (layer_enable_tmp_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_callbacks, |
| 1340 | my_instance_data->tmp_dbg_create_infos, my_instance_data->tmp_callbacks)) { |
| 1341 | // Failure of setting up one or more of the callback. |
| 1342 | // Therefore, clean up and don't use those callbacks: |
| 1343 | layer_free_tmp_callbacks(my_instance_data->tmp_dbg_create_infos, my_instance_data->tmp_callbacks); |
| 1344 | my_instance_data->num_tmp_callbacks = 0; |
| 1345 | } |
| 1346 | } |
| 1347 | } |
| 1348 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1349 | init_parameter_validation(my_instance_data, pAllocator); |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1350 | CheckInstanceRegisterExtensions(pCreateInfo, my_instance_data); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1351 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1352 | // Ordinarily we'd check these before calling down the chain, but none of the layer |
| 1353 | // support is in place until now, if we survive we can report the issue now. |
| 1354 | parameter_validation_vkCreateInstance(my_instance_data->report_data, pCreateInfo, pAllocator, pInstance); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1355 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1356 | if (pCreateInfo->pApplicationInfo) { |
| 1357 | if (pCreateInfo->pApplicationInfo->pApplicationName) { |
| 1358 | validate_string(my_instance_data->report_data, "vkCreateInstance", |
| 1359 | "pCreateInfo->VkApplicationInfo->pApplicationName", |
| 1360 | pCreateInfo->pApplicationInfo->pApplicationName); |
| 1361 | } |
Courtney Goeltzenleuchter | 842691b | 2016-02-10 14:00:52 -0700 | [diff] [blame] | 1362 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1363 | if (pCreateInfo->pApplicationInfo->pEngineName) { |
| 1364 | validate_string(my_instance_data->report_data, "vkCreateInstance", "pCreateInfo->VkApplicationInfo->pEngineName", |
| 1365 | pCreateInfo->pApplicationInfo->pEngineName); |
| 1366 | } |
Courtney Goeltzenleuchter | 41c5c4b | 2016-02-10 15:13:55 -0700 | [diff] [blame] | 1367 | } |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1368 | |
| 1369 | // Disable the tmp callbacks: |
| 1370 | if (my_instance_data->num_tmp_callbacks > 0) { |
| 1371 | layer_disable_tmp_callbacks(my_instance_data->report_data, my_instance_data->num_tmp_callbacks, |
| 1372 | my_instance_data->tmp_callbacks); |
| 1373 | } |
Courtney Goeltzenleuchter | 842691b | 2016-02-10 14:00:52 -0700 | [diff] [blame] | 1374 | } |
| 1375 | |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1376 | return result; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1377 | } |
| 1378 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1379 | VKAPI_ATTR void VKAPI_CALL DestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1380 | // Grab the key before the instance is destroyed. |
| 1381 | dispatch_key key = get_dispatch_key(instance); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1382 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1383 | auto my_data = GetLayerDataPtr(key, instance_layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1384 | assert(my_data != NULL); |
| 1385 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1386 | // Enable the temporary callback(s) here to catch vkDestroyInstance issues: |
| 1387 | bool callback_setup = false; |
| 1388 | if (my_data->num_tmp_callbacks > 0) { |
| 1389 | if (!layer_enable_tmp_callbacks(my_data->report_data, my_data->num_tmp_callbacks, my_data->tmp_dbg_create_infos, |
| 1390 | my_data->tmp_callbacks)) { |
| 1391 | callback_setup = true; |
| 1392 | } |
| 1393 | } |
| 1394 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1395 | skip |= parameter_validation_vkDestroyInstance(my_data->report_data, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1396 | |
Ian Elliott | ed6b5ac | 2016-04-28 09:08:13 -0600 | [diff] [blame] | 1397 | // Disable and cleanup the temporary callback(s): |
| 1398 | if (callback_setup) { |
| 1399 | layer_disable_tmp_callbacks(my_data->report_data, my_data->num_tmp_callbacks, my_data->tmp_callbacks); |
| 1400 | } |
| 1401 | if (my_data->num_tmp_callbacks > 0) { |
| 1402 | layer_free_tmp_callbacks(my_data->tmp_dbg_create_infos, my_data->tmp_callbacks); |
| 1403 | my_data->num_tmp_callbacks = 0; |
| 1404 | } |
| 1405 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1406 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1407 | my_data->dispatch_table.DestroyInstance(instance, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1408 | |
| 1409 | // Clean up logging callback, if any |
| 1410 | while (my_data->logging_callback.size() > 0) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1411 | VkDebugReportCallbackEXT callback = my_data->logging_callback.back(); |
| 1412 | layer_destroy_msg_callback(my_data->report_data, callback, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1413 | my_data->logging_callback.pop_back(); |
| 1414 | } |
| 1415 | |
Chris Forbes | 78a56b0 | 2016-11-02 16:13:01 +1300 | [diff] [blame] | 1416 | layer_debug_report_destroy_instance(my_data->report_data); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1417 | instance_layer_data_map.erase(key); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1418 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1419 | } |
| 1420 | |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 1421 | VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, |
| 1422 | VkPhysicalDevice *pPhysicalDevices) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1423 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1424 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1425 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1426 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1427 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1428 | skip |= parameter_validation_vkEnumeratePhysicalDevices(my_data->report_data, pPhysicalDeviceCount, pPhysicalDevices); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1429 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1430 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1431 | result = my_data->dispatch_table.EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1432 | validate_result(my_data->report_data, "vkEnumeratePhysicalDevices", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1433 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1434 | return result; |
| 1435 | } |
| 1436 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1437 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1438 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1439 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1440 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1441 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1442 | skip |= parameter_validation_vkGetPhysicalDeviceFeatures(my_data->report_data, pFeatures); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1443 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1444 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1445 | my_data->dispatch_table.GetPhysicalDeviceFeatures(physicalDevice, pFeatures); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1446 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1447 | } |
| 1448 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1449 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 1450 | VkFormatProperties *pFormatProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1451 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1452 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1453 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1454 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1455 | skip |= parameter_validation_vkGetPhysicalDeviceFormatProperties(my_data->report_data, format, pFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1456 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1457 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1458 | my_data->dispatch_table.GetPhysicalDeviceFormatProperties(physicalDevice, format, pFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1459 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1460 | } |
| 1461 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1462 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 1463 | VkImageType type, VkImageTiling tiling, |
| 1464 | VkImageUsageFlags usage, VkImageCreateFlags flags, |
| 1465 | VkImageFormatProperties *pImageFormatProperties) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1466 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1467 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1468 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1469 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1470 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1471 | skip |= parameter_validation_vkGetPhysicalDeviceImageFormatProperties(my_data->report_data, format, type, tiling, usage, flags, |
| 1472 | pImageFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1473 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1474 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1475 | result = my_data->dispatch_table.GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, |
| 1476 | pImageFormatProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1477 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1478 | validate_result(my_data->report_data, "vkGetPhysicalDeviceImageFormatProperties", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1479 | } |
Chia-I Wu | 1724104 | 2015-10-31 00:31:16 +0800 | [diff] [blame] | 1480 | |
| 1481 | return result; |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 1482 | } |
| 1483 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1484 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1485 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1486 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1487 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1488 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1489 | skip |= parameter_validation_vkGetPhysicalDeviceProperties(my_data->report_data, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1490 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1491 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1492 | my_data->dispatch_table.GetPhysicalDeviceProperties(physicalDevice, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1493 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1494 | } |
| 1495 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1496 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, |
| 1497 | uint32_t *pQueueFamilyPropertyCount, |
| 1498 | VkQueueFamilyProperties *pQueueFamilyProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1499 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1500 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1501 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1502 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1503 | skip |= parameter_validation_vkGetPhysicalDeviceQueueFamilyProperties(my_data->report_data, pQueueFamilyPropertyCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1504 | pQueueFamilyProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1505 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1506 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1507 | my_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, |
| 1508 | pQueueFamilyProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1509 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1510 | } |
| 1511 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1512 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, |
| 1513 | VkPhysicalDeviceMemoryProperties *pMemoryProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1514 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1515 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1516 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1517 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1518 | skip |= parameter_validation_vkGetPhysicalDeviceMemoryProperties(my_data->report_data, pMemoryProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1519 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1520 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1521 | my_data->dispatch_table.GetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1522 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 1523 | } |
| 1524 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 1525 | static void validateDeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1526 | const std::vector<VkQueueFamilyProperties> properties) { |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1527 | std::unordered_set<uint32_t> set; |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1528 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1529 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1530 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1531 | if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { |
| 1532 | for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) { |
| 1533 | if (set.count(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex)) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1534 | 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] | 1535 | VALIDATION_ERROR_00035, LayerName, |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1536 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueFamilyIndex, is not unique within this " |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 1537 | "structure. %s", |
| 1538 | i, validation_error_map[VALIDATION_ERROR_00035]); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1539 | } else { |
| 1540 | set.insert(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex); |
Michael Lentine | fa71bd5 | 2016-01-27 12:50:30 -0600 | [diff] [blame] | 1541 | } |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1542 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1543 | if (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities != nullptr) { |
| 1544 | for (uint32_t j = 0; j < pCreateInfo->pQueueCreateInfos[i].queueCount; ++j) { |
| 1545 | if ((pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j] < 0.f) || |
| 1546 | (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j] > 1.f)) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1547 | 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] | 1548 | __LINE__, INVALID_USAGE, LayerName, |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1549 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->pQueuePriorities[%d], must be " |
| 1550 | "between 0 and 1. Actual value is %f", |
| 1551 | i, j, pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[j]); |
| 1552 | } |
| 1553 | } |
| 1554 | } |
| 1555 | |
| 1556 | if (pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex >= properties.size()) { |
| 1557 | log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1558 | 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] | 1559 | INVALID_USAGE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1560 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueFamilyIndex cannot be more than the number " |
| 1561 | "of queue families.", |
| 1562 | i); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1563 | } else if (pCreateInfo->pQueueCreateInfos[i].queueCount > |
| 1564 | properties[pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex].queueCount) { |
| 1565 | log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 1566 | 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] | 1567 | INVALID_USAGE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1568 | "VkDeviceCreateInfo parameter, uint32_t pQueueCreateInfos[%d]->queueCount cannot be more than the number of " |
| 1569 | "queues for the given family index.", |
| 1570 | i); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1571 | } |
Michael Lentine | 774704f | 2016-01-27 13:36:46 -0600 | [diff] [blame] | 1572 | } |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1573 | } |
| 1574 | } |
| 1575 | |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1576 | static void CheckInstanceRegisterExtensions(const VkInstanceCreateInfo *pCreateInfo, instance_layer_data *instance_data) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1577 | for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1578 | auto name = pCreateInfo->ppEnabledExtensionNames[i]; |
| 1579 | |
| 1580 | if (strcmp(name, VK_KHR_SURFACE_EXTENSION_NAME) == 0) { |
| 1581 | instance_data->extensions.surface_enabled = true; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1582 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1583 | } else if (strcmp(name, VK_KHR_XLIB_SURFACE_EXTENSION_NAME) == 0) { |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1584 | instance_data->extensions.xlib_enabled = true; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1585 | #endif |
| 1586 | #ifdef VK_USE_PLATFORM_XCB_KHR |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1587 | } else if (strcmp(name, VK_KHR_XCB_SURFACE_EXTENSION_NAME) == 0) { |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1588 | instance_data->extensions.xcb_enabled = true; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1589 | #endif |
| 1590 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1591 | } else if (strcmp(name, VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME) == 0) { |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1592 | instance_data->extensions.wayland_enabled = true; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1593 | #endif |
| 1594 | #ifdef VK_USE_PLATFORM_MIR_KHR |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1595 | } else if (strcmp(name, VK_KHR_MIR_SURFACE_EXTENSION_NAME) == 0) { |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1596 | instance_data->extensions.mir_enabled = true; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1597 | #endif |
| 1598 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1599 | } else if (strcmp(name, VK_KHR_ANDROID_SURFACE_EXTENSION_NAME) == 0) { |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1600 | instance_data->extensions.android_enabled = true; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1601 | #endif |
| 1602 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1603 | } else if (strcmp(name, VK_KHR_WIN32_SURFACE_EXTENSION_NAME) == 0) { |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1604 | instance_data->extensions.win32_enabled = true; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1605 | #endif |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1606 | } else if (strcmp(name, VK_KHR_DISPLAY_EXTENSION_NAME) == 0) { |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 1607 | instance_data->extensions.display_enabled = true; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1608 | } else if (strcmp(name, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0) { |
| 1609 | instance_data->extensions.khr_get_phys_dev_properties2_enabled = true; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 1610 | } else if (strcmp(name, VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME) == 0) { |
| 1611 | instance_data->extensions.khx_device_group_creation_enabled = true; |
| 1612 | } else if (strcmp(name, VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) == 0) { |
| 1613 | instance_data->extensions.khx_external_memory_capabilities_enabled = true; |
| 1614 | } else if (strcmp(name, VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME) == 0) { |
| 1615 | instance_data->extensions.khx_external_semaphore_capabilities_enabled = true; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1616 | } else if (strcmp(name, VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) == 0) { |
| 1617 | instance_data->extensions.nv_external_memory_capabilities_enabled = true; |
| 1618 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT |
| 1619 | } else if (strcmp(name, VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME) == 0) { |
| 1620 | instance_data->extensions.ext_acquire_xlib_display_enabled = true; |
| 1621 | #endif |
| 1622 | } else if (strcmp(name, VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME) == 0) { |
| 1623 | instance_data->extensions.ext_direct_mode_display_enabled = true; |
| 1624 | } else if (strcmp(name, VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME) == 0) { |
| 1625 | instance_data->extensions.ext_display_surface_counter_enabled = true; |
| 1626 | } else if (strcmp(name, VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME) == 0) { |
| 1627 | instance_data->extensions.nv_external_memory_capabilities_enabled = true; |
Chris Forbes | 2e47f43 | 2016-11-03 10:18:18 +1300 | [diff] [blame] | 1628 | } |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1629 | } |
| 1630 | } |
| 1631 | |
| 1632 | static void CheckDeviceRegisterExtensions(const VkDeviceCreateInfo *pCreateInfo, VkDevice device) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1633 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1634 | for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { |
| 1635 | if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1636 | device_data->enables.khr_swapchain_enabled = true; |
| 1637 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME) == 0) { |
| 1638 | device_data->enables.khr_display_swapchain_enabled = true; |
| 1639 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_MAINTENANCE1_EXTENSION_NAME) == 0) { |
| 1640 | device_data->enables.khr_maintenance1 = true; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 1641 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME) == 0) { |
| 1642 | device_data->enables.khr_push_descriptor = true; |
| 1643 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME) == 0) { |
| 1644 | device_data->enables.khr_descriptor_update_template = true; |
| 1645 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_DEVICE_GROUP_EXTENSION_NAME) == 0) { |
| 1646 | device_data->enables.khx_device_group = true; |
| 1647 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME) == 0) { |
| 1648 | device_data->enables.khx_external_memory_fd = true; |
| 1649 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME) == 0) { |
| 1650 | device_data->enables.khx_external_semaphore_fd = true; |
Jamie Madill | 0f94144 | 2017-03-16 12:53:42 -0400 | [diff] [blame] | 1651 | #ifdef VK_USE_PLATFORM_WIN32_KHX |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 1652 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME) == 0) { |
| 1653 | device_data->enables.khx_external_memory_win32 = true; |
| 1654 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME) == 0) { |
| 1655 | device_data->enables.khx_external_semaphore_win32 = true; |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 1656 | #endif |
| 1657 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_MARKER_EXTENSION_NAME) == 0) { |
| 1658 | device_data->enables.ext_debug_marker = true; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 1659 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME) == 0) { |
| 1660 | device_data->enables.ext_discard_rectangles = true; |
Mark Lobodzinski | 099b3b6 | 2017-02-08 16:04:35 -0700 | [diff] [blame] | 1661 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME) == 0) { |
| 1662 | device_data->enables.ext_display_control = true; |
| 1663 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME) == 0) { |
| 1664 | device_data->enables.amd_draw_indirect_count = true; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 1665 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME) == 0) { |
| 1666 | device_data->enables.amd_negative_viewport_height = true; |
| 1667 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME) == 0) { |
| 1668 | device_data->enables.nv_clip_space_w_scaling = true; |
| 1669 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME) == 0) { |
| 1670 | device_data->enables.nv_external_memory = true; |
| 1671 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 1672 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME) == 0) { |
| 1673 | device_data->enables.nv_external_memory_win32 = true; |
| 1674 | #endif |
| 1675 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME) == 0) { |
| 1676 | device_data->enables.nvx_device_generated_commands = true; |
Tobin Ehlis | 13e9c14 | 2017-01-13 12:13:57 -0700 | [diff] [blame] | 1677 | } else if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME) == 0) { |
| 1678 | device_data->enables.incremental_present = true; |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 1679 | } |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1680 | } |
| 1681 | } |
| 1682 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1683 | void storeCreateDeviceData(VkDevice device, const VkDeviceCreateInfo *pCreateInfo) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1684 | 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] | 1685 | |
| 1686 | if ((pCreateInfo != nullptr) && (pCreateInfo->pQueueCreateInfos != nullptr)) { |
| 1687 | for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i) { |
| 1688 | my_device_data->queueFamilyIndexMap.insert( |
| 1689 | std::make_pair(pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex, pCreateInfo->pQueueCreateInfos[i].queueCount)); |
| 1690 | } |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1691 | } |
| 1692 | } |
| 1693 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1694 | VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1695 | const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) { |
Courtney Goeltzenleuchter | bafcdf3 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 1696 | /* |
Courtney Goeltzenleuchter | bafcdf3 | 2015-09-08 17:42:57 -0600 | [diff] [blame] | 1697 | * NOTE: We do not validate physicalDevice or any dispatchable |
| 1698 | * object as the first parameter. We couldn't get here if it was wrong! |
| 1699 | */ |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1700 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1701 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1702 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1703 | 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] | 1704 | assert(my_instance_data != nullptr); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 1705 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1706 | skip |= parameter_validation_vkCreateDevice(my_instance_data->report_data, pCreateInfo, pAllocator, pDevice); |
Dustin Graves | 842621d | 2016-03-03 14:17:08 -0700 | [diff] [blame] | 1707 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1708 | if (pCreateInfo != NULL) { |
| 1709 | if ((pCreateInfo->enabledLayerCount > 0) && (pCreateInfo->ppEnabledLayerNames != NULL)) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 1710 | for (size_t i = 0; i < pCreateInfo->enabledLayerCount; i++) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1711 | skip |= validate_string(my_instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledLayerNames", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1712 | pCreateInfo->ppEnabledLayerNames[i]); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1713 | } |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1714 | } |
Michael Lentine | 774704f | 2016-01-27 13:36:46 -0600 | [diff] [blame] | 1715 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1716 | if ((pCreateInfo->enabledExtensionCount > 0) && (pCreateInfo->ppEnabledExtensionNames != NULL)) { |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 1717 | for (size_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1718 | skip |= validate_string(my_instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledExtensionNames", |
| 1719 | pCreateInfo->ppEnabledExtensionNames[i]); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1720 | } |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1721 | } |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 1722 | if (pCreateInfo->pNext != NULL && pCreateInfo->pEnabledFeatures) { |
| 1723 | // Check for get_physical_device_properties2 struct |
| 1724 | struct std_header { |
| 1725 | VkStructureType sType; |
| 1726 | const void *pNext; |
| 1727 | }; |
| 1728 | std_header *cur_pnext = (std_header *)pCreateInfo->pNext; |
| 1729 | while (cur_pnext) { |
| 1730 | if (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR == cur_pnext->sType) { |
| 1731 | // Cannot include VkPhysicalDeviceFeatures2KHR and have non-null pEnabledFeatures |
| 1732 | skip |= log_msg(my_instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, |
| 1733 | VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, LayerName, |
| 1734 | "VkDeviceCreateInfo->pNext includes a VkPhysicalDeviceFeatures2KHR struct when " |
| 1735 | "pCreateInfo->pEnabledFeatures is non-NULL."); |
| 1736 | break; |
| 1737 | } |
| 1738 | cur_pnext = (std_header *)cur_pnext->pNext; |
| 1739 | } |
| 1740 | } |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 1741 | if (pCreateInfo->pNext != NULL && pCreateInfo->pEnabledFeatures) { |
| 1742 | // Check for get_physical_device_properties2 struct |
| 1743 | struct std_header { |
| 1744 | VkStructureType sType; |
| 1745 | const void *pNext; |
| 1746 | }; |
| 1747 | std_header *cur_pnext = (std_header *)pCreateInfo->pNext; |
| 1748 | while (cur_pnext) { |
| 1749 | if (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR == cur_pnext->sType) { |
| 1750 | // Cannot include VkPhysicalDeviceFeatures2KHR and have non-null pEnabledFeatures |
| 1751 | skip |= log_msg(my_instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, |
| 1752 | VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, INVALID_USAGE, LayerName, |
| 1753 | "VkDeviceCreateInfo->pNext includes a VkPhysicalDeviceFeatures2KHR struct when " |
| 1754 | "pCreateInfo->pEnabledFeatures is non-NULL."); |
| 1755 | break; |
| 1756 | } |
| 1757 | cur_pnext = (std_header *)cur_pnext->pNext; |
| 1758 | } |
| 1759 | } |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1760 | } |
| 1761 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1762 | if (!skip) { |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1763 | VkLayerDeviceCreateInfo *chain_info = get_chain_info(pCreateInfo, VK_LAYER_LINK_INFO); |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1764 | assert(chain_info != nullptr); |
| 1765 | assert(chain_info->u.pLayerInfo != nullptr); |
| 1766 | |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1767 | PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr; |
| 1768 | PFN_vkGetDeviceProcAddr fpGetDeviceProcAddr = chain_info->u.pLayerInfo->pfnNextGetDeviceProcAddr; |
Chia-I Wu | a570b7c | 2016-05-16 07:48:14 +0800 | [diff] [blame] | 1769 | PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice)fpGetInstanceProcAddr(my_instance_data->instance, "vkCreateDevice"); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1770 | if (fpCreateDevice == NULL) { |
| 1771 | return VK_ERROR_INITIALIZATION_FAILED; |
| 1772 | } |
| 1773 | |
| 1774 | // Advance the link info for the next element on the chain |
| 1775 | chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext; |
| 1776 | |
| 1777 | result = fpCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1778 | |
| 1779 | validate_result(my_instance_data->report_data, "vkCreateDevice", result); |
| 1780 | |
| 1781 | if (result == VK_SUCCESS) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1782 | 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] | 1783 | assert(my_device_data != nullptr); |
| 1784 | |
| 1785 | 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] | 1786 | layer_init_device_dispatch_table(*pDevice, &my_device_data->dispatch_table, fpGetDeviceProcAddr); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1787 | |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 1788 | CheckDeviceRegisterExtensions(pCreateInfo, *pDevice); |
| 1789 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1790 | uint32_t count; |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1791 | my_instance_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, nullptr); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1792 | std::vector<VkQueueFamilyProperties> properties(count); |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1793 | my_instance_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, &properties[0]); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1794 | |
| 1795 | validateDeviceCreateInfo(physicalDevice, pCreateInfo, properties); |
| 1796 | storeCreateDeviceData(*pDevice, pCreateInfo); |
Mark Lobodzinski | a493251 | 2016-06-27 15:13:00 -0600 | [diff] [blame] | 1797 | |
| 1798 | // Query and save physical device limits for this device |
| 1799 | VkPhysicalDeviceProperties device_properties = {}; |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 1800 | my_instance_data->dispatch_table.GetPhysicalDeviceProperties(physicalDevice, &device_properties); |
Mark Lobodzinski | a493251 | 2016-06-27 15:13:00 -0600 | [diff] [blame] | 1801 | memcpy(&my_device_data->device_limits, &device_properties.limits, sizeof(VkPhysicalDeviceLimits)); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 1802 | my_device_data->physical_device = physicalDevice; |
Mark Lobodzinski | 7bdd9f2 | 2016-08-09 13:41:09 -0600 | [diff] [blame] | 1803 | |
| 1804 | // Save app-enabled features in this device's layer_data structure |
| 1805 | if (pCreateInfo->pEnabledFeatures) { |
| 1806 | my_device_data->physical_device_features = *pCreateInfo->pEnabledFeatures; |
| 1807 | } else { |
| 1808 | memset(&my_device_data->physical_device_features, 0, sizeof(VkPhysicalDeviceFeatures)); |
| 1809 | } |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1810 | } |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 1811 | } |
Michael Lentine | 157a2ec | 2016-01-27 11:25:05 -0600 | [diff] [blame] | 1812 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1813 | return result; |
| 1814 | } |
| 1815 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1816 | VKAPI_ATTR void VKAPI_CALL DestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator) { |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1817 | dispatch_key key = get_dispatch_key(device); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1818 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1819 | layer_data *my_data = GetLayerDataPtr(key, layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1820 | assert(my_data != NULL); |
| 1821 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1822 | skip |= parameter_validation_vkDestroyDevice(my_data->report_data, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1823 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1824 | if (!skip) { |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1825 | layer_debug_report_destroy_device(device); |
| 1826 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1827 | #if DISPATCH_MAP_DEBUG |
Mark Mueller | aab3650 | 2016-05-03 13:17:29 -0600 | [diff] [blame] | 1828 | fprintf(stderr, "Device: 0x%p, key: 0x%p\n", device, key); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1829 | #endif |
| 1830 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1831 | my_data->dispatch_table.DestroyDevice(device, pAllocator); |
Tony Barbour | d4eb06d | 2016-03-29 15:14:59 -0600 | [diff] [blame] | 1832 | layer_data_map.erase(key); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1833 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1834 | } |
| 1835 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 1836 | static bool PreGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1837 | 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] | 1838 | assert(my_device_data != nullptr); |
| 1839 | |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 1840 | validate_queue_family_index(my_device_data, "vkGetDeviceQueue", "queueFamilyIndex", queueFamilyIndex); |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 1841 | |
Dustin Graves | f5b498c | 2016-03-17 11:04:45 -0600 | [diff] [blame] | 1842 | const auto &queue_data = my_device_data->queueFamilyIndexMap.find(queueFamilyIndex); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1843 | if (queue_data->second <= queueIndex) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 1844 | log_msg( |
| 1845 | my_device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 1846 | VALIDATION_ERROR_00061, LayerName, |
| 1847 | "vkGetDeviceQueue() parameter, uint32_t queueIndex %d, must be less than the number of queues given when the device " |
| 1848 | "was created. %s", |
| 1849 | queueIndex, validation_error_map[VALIDATION_ERROR_00061]); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1850 | return false; |
| 1851 | } |
| 1852 | return true; |
| 1853 | } |
| 1854 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1855 | 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] | 1856 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1857 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1858 | assert(my_data != NULL); |
Michael Lentine | bdf744f | 2016-01-27 15:43:43 -0600 | [diff] [blame] | 1859 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1860 | skip |= parameter_validation_vkGetDeviceQueue(my_data->report_data, queueFamilyIndex, queueIndex, pQueue); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1861 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1862 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1863 | PreGetDeviceQueue(device, queueFamilyIndex, queueIndex); |
| 1864 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1865 | my_data->dispatch_table.GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1866 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1867 | } |
| 1868 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1869 | 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] | 1870 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1871 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1872 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1873 | assert(my_data != NULL); |
| 1874 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1875 | skip |= parameter_validation_vkQueueSubmit(my_data->report_data, submitCount, pSubmits, fence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1876 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1877 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1878 | result = my_data->dispatch_table.QueueSubmit(queue, submitCount, pSubmits, fence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1879 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1880 | validate_result(my_data->report_data, "vkQueueSubmit", result); |
Courtney Goeltzenleuchter | 646b907 | 2015-10-20 18:04:07 -0600 | [diff] [blame] | 1881 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1882 | |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1883 | return result; |
| 1884 | } |
| 1885 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1886 | VKAPI_ATTR VkResult VKAPI_CALL QueueWaitIdle(VkQueue queue) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1887 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1888 | assert(my_data != NULL); |
| 1889 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1890 | VkResult result = my_data->dispatch_table.QueueWaitIdle(queue); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1891 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1892 | validate_result(my_data->report_data, "vkQueueWaitIdle", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1893 | |
| 1894 | return result; |
| 1895 | } |
| 1896 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1897 | VKAPI_ATTR VkResult VKAPI_CALL DeviceWaitIdle(VkDevice device) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1898 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1899 | assert(my_data != NULL); |
| 1900 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1901 | VkResult result = my_data->dispatch_table.DeviceWaitIdle(device); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1902 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1903 | validate_result(my_data->report_data, "vkDeviceWaitIdle", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1904 | |
| 1905 | return result; |
| 1906 | } |
| 1907 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1908 | VKAPI_ATTR VkResult VKAPI_CALL AllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1909 | const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1910 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1911 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1912 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1913 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1914 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1915 | skip |= parameter_validation_vkAllocateMemory(my_data->report_data, pAllocateInfo, pAllocator, pMemory); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1916 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1917 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1918 | result = my_data->dispatch_table.AllocateMemory(device, pAllocateInfo, pAllocator, pMemory); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1919 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1920 | validate_result(my_data->report_data, "vkAllocateMemory", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1921 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1922 | |
| 1923 | return result; |
| 1924 | } |
| 1925 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1926 | 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] | 1927 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1928 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1929 | assert(my_data != NULL); |
| 1930 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1931 | skip |= parameter_validation_vkFreeMemory(my_data->report_data, memory, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1932 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1933 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1934 | my_data->dispatch_table.FreeMemory(device, memory, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 1935 | } |
| 1936 | } |
| 1937 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1938 | VKAPI_ATTR VkResult VKAPI_CALL MapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, |
| 1939 | VkMemoryMapFlags flags, void **ppData) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1940 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1941 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1942 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1943 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1944 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1945 | 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] | 1946 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1947 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1948 | result = my_data->dispatch_table.MapMemory(device, memory, offset, size, flags, ppData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1949 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1950 | validate_result(my_data->report_data, "vkMapMemory", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1951 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1952 | |
| 1953 | return result; |
| 1954 | } |
| 1955 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 1956 | VKAPI_ATTR void VKAPI_CALL UnmapMemory(VkDevice device, VkDeviceMemory memory) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1957 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1958 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1959 | assert(my_data != NULL); |
| 1960 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1961 | skip |= parameter_validation_vkUnmapMemory(my_data->report_data, memory); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1962 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1963 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1964 | my_data->dispatch_table.UnmapMemory(device, memory); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 1965 | } |
| 1966 | } |
| 1967 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1968 | VKAPI_ATTR VkResult VKAPI_CALL FlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, |
| 1969 | const VkMappedMemoryRange *pMemoryRanges) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1970 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1971 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1972 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1973 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1974 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1975 | skip |= parameter_validation_vkFlushMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges); |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 1976 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1977 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 1978 | result = my_data->dispatch_table.FlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1979 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1980 | validate_result(my_data->report_data, "vkFlushMappedMemoryRanges", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1981 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 1982 | |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1983 | return result; |
| 1984 | } |
| 1985 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 1986 | VKAPI_ATTR VkResult VKAPI_CALL InvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, |
| 1987 | const VkMappedMemoryRange *pMemoryRanges) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 1988 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1989 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 1990 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1991 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 1992 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1993 | skip |= parameter_validation_vkInvalidateMappedMemoryRanges(my_data->report_data, memoryRangeCount, pMemoryRanges); |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 1994 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 1995 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 1996 | result = my_data->dispatch_table.InvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1997 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 1998 | validate_result(my_data->report_data, "vkInvalidateMappedMemoryRanges", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 1999 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2000 | |
Tony Barbour | b125054 | 2015-04-16 19:23:13 -0600 | [diff] [blame] | 2001 | return result; |
| 2002 | } |
| 2003 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2004 | VKAPI_ATTR void VKAPI_CALL GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, |
| 2005 | VkDeviceSize *pCommittedMemoryInBytes) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2006 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2007 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2008 | assert(my_data != NULL); |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2009 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2010 | skip |= parameter_validation_vkGetDeviceMemoryCommitment(my_data->report_data, memory, pCommittedMemoryInBytes); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2011 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2012 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2013 | my_data->dispatch_table.GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2014 | } |
Courtney Goeltzenleuchter | fb71f22 | 2015-07-09 21:57:28 -0600 | [diff] [blame] | 2015 | } |
| 2016 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2017 | VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, |
| 2018 | VkDeviceSize memoryOffset) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2019 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2020 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2021 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2022 | assert(my_data != NULL); |
| 2023 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2024 | skip |= parameter_validation_vkBindBufferMemory(my_data->report_data, buffer, memory, memoryOffset); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2025 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2026 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2027 | result = my_data->dispatch_table.BindBufferMemory(device, buffer, memory, memoryOffset); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2028 | |
| 2029 | validate_result(my_data->report_data, "vkBindBufferMemory", result); |
| 2030 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2031 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2032 | return result; |
| 2033 | } |
| 2034 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2035 | 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] | 2036 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2037 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2038 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2039 | assert(my_data != NULL); |
| 2040 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2041 | skip |= parameter_validation_vkBindImageMemory(my_data->report_data, image, memory, memoryOffset); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2042 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2043 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2044 | result = my_data->dispatch_table.BindImageMemory(device, image, memory, memoryOffset); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2045 | |
| 2046 | validate_result(my_data->report_data, "vkBindImageMemory", result); |
| 2047 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2048 | |
| 2049 | return result; |
| 2050 | } |
| 2051 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2052 | VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, |
| 2053 | VkMemoryRequirements *pMemoryRequirements) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2054 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2055 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2056 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2057 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2058 | skip |= parameter_validation_vkGetBufferMemoryRequirements(my_data->report_data, buffer, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2059 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2060 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2061 | my_data->dispatch_table.GetBufferMemoryRequirements(device, buffer, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2062 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2063 | } |
| 2064 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2065 | VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2066 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2067 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2068 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2069 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2070 | skip |= parameter_validation_vkGetImageMemoryRequirements(my_data->report_data, image, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2071 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2072 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2073 | my_data->dispatch_table.GetImageMemoryRequirements(device, image, pMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2074 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2075 | } |
| 2076 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 2077 | static bool PostGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pNumRequirements, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2078 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2079 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2080 | if (pSparseMemoryRequirements != nullptr) { |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 2081 | if ((pSparseMemoryRequirements->formatProperties.aspectMask & |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2082 | (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 2083 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 2084 | 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] | 2085 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2086 | "vkGetImageSparseMemoryRequirements parameter, VkImageAspect " |
| 2087 | "pSparseMemoryRequirements->formatProperties.aspectMask, is an unrecognized enumerator"); |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 2088 | return false; |
| 2089 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2090 | } |
| 2091 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2092 | return true; |
| 2093 | } |
| 2094 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2095 | VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, |
| 2096 | VkSparseImageMemoryRequirements *pSparseMemoryRequirements) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2097 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2098 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2099 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2100 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2101 | skip |= parameter_validation_vkGetImageSparseMemoryRequirements(my_data->report_data, image, pSparseMemoryRequirementCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2102 | pSparseMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2103 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2104 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2105 | my_data->dispatch_table.GetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, |
| 2106 | pSparseMemoryRequirements); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2107 | |
| 2108 | PostGetImageSparseMemoryRequirements(device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 2109 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2110 | } |
| 2111 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 2112 | static bool PostGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2113 | VkSampleCountFlagBits samples, VkImageUsageFlags usage, |
| 2114 | VkImageTiling tiling, uint32_t *pNumProperties, |
| 2115 | VkSparseImageFormatProperties *pProperties) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2116 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2117 | if (pProperties != nullptr) { |
| 2118 | if ((pProperties->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 2119 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 2120 | 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] | 2121 | LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2122 | "vkGetPhysicalDeviceSparseImageFormatProperties parameter, VkImageAspect pProperties->aspectMask, is an " |
| 2123 | "unrecognized enumerator"); |
Dustin Graves | 02a24a2 | 2016-03-08 13:34:49 -0700 | [diff] [blame] | 2124 | return false; |
| 2125 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2126 | } |
| 2127 | |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2128 | return true; |
| 2129 | } |
| 2130 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2131 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, |
| 2132 | VkImageType type, VkSampleCountFlagBits samples, |
| 2133 | VkImageUsageFlags usage, VkImageTiling tiling, |
| 2134 | uint32_t *pPropertyCount, |
| 2135 | VkSparseImageFormatProperties *pProperties) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2136 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2137 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2138 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2139 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2140 | skip |= parameter_validation_vkGetPhysicalDeviceSparseImageFormatProperties(my_data->report_data, format, type, samples, usage, |
| 2141 | tiling, pPropertyCount, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2142 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2143 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 2144 | my_data->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, |
| 2145 | pPropertyCount, pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2146 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2147 | PostGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, format, type, samples, usage, tiling, pPropertyCount, |
| 2148 | pProperties); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2149 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2150 | } |
| 2151 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2152 | VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, |
| 2153 | VkFence fence) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2154 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2155 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2156 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2157 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2158 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2159 | skip |= parameter_validation_vkQueueBindSparse(my_data->report_data, bindInfoCount, pBindInfo, fence); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2160 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2161 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2162 | result = my_data->dispatch_table.QueueBindSparse(queue, bindInfoCount, pBindInfo, fence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2163 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2164 | validate_result(my_data->report_data, "vkQueueBindSparse", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2165 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2166 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2167 | return result; |
| 2168 | } |
| 2169 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2170 | VKAPI_ATTR VkResult VKAPI_CALL CreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, |
| 2171 | const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2172 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2173 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2174 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2175 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2176 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2177 | skip |= parameter_validation_vkCreateFence(my_data->report_data, pCreateInfo, pAllocator, pFence); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2178 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2179 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2180 | result = my_data->dispatch_table.CreateFence(device, pCreateInfo, pAllocator, pFence); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2181 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2182 | validate_result(my_data->report_data, "vkCreateFence", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2183 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2184 | |
| 2185 | return result; |
| 2186 | } |
| 2187 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2188 | 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] | 2189 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2190 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2191 | assert(my_data != NULL); |
| 2192 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2193 | skip |= parameter_validation_vkDestroyFence(my_data->report_data, fence, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2194 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2195 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2196 | my_data->dispatch_table.DestroyFence(device, fence, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2197 | } |
| 2198 | } |
| 2199 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2200 | 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] | 2201 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2202 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2203 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2204 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2205 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2206 | skip |= parameter_validation_vkResetFences(my_data->report_data, fenceCount, pFences); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2207 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2208 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2209 | result = my_data->dispatch_table.ResetFences(device, fenceCount, pFences); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2210 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2211 | validate_result(my_data->report_data, "vkResetFences", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2212 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2213 | |
| 2214 | return result; |
| 2215 | } |
| 2216 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2217 | VKAPI_ATTR VkResult VKAPI_CALL GetFenceStatus(VkDevice device, VkFence fence) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2218 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2219 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2220 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2221 | assert(my_data != NULL); |
| 2222 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2223 | skip |= parameter_validation_vkGetFenceStatus(my_data->report_data, fence); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2224 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2225 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2226 | result = my_data->dispatch_table.GetFenceStatus(device, fence); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2227 | |
| 2228 | validate_result(my_data->report_data, "vkGetFenceStatus", result); |
| 2229 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2230 | |
| 2231 | return result; |
| 2232 | } |
| 2233 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2234 | VKAPI_ATTR VkResult VKAPI_CALL WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, |
| 2235 | uint64_t timeout) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2236 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2237 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2238 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2239 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2240 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2241 | skip |= parameter_validation_vkWaitForFences(my_data->report_data, fenceCount, pFences, waitAll, timeout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2242 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2243 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2244 | result = my_data->dispatch_table.WaitForFences(device, fenceCount, pFences, waitAll, timeout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2245 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2246 | validate_result(my_data->report_data, "vkWaitForFences", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2247 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2248 | |
| 2249 | return result; |
| 2250 | } |
| 2251 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2252 | VKAPI_ATTR VkResult VKAPI_CALL CreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2253 | const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2254 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2255 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2256 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2257 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2258 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2259 | skip |= parameter_validation_vkCreateSemaphore(my_data->report_data, pCreateInfo, pAllocator, pSemaphore); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2260 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2261 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2262 | result = my_data->dispatch_table.CreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2263 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2264 | validate_result(my_data->report_data, "vkCreateSemaphore", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2265 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2266 | |
| 2267 | return result; |
| 2268 | } |
| 2269 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2270 | 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] | 2271 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2272 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2273 | assert(my_data != NULL); |
| 2274 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2275 | skip |= parameter_validation_vkDestroySemaphore(my_data->report_data, semaphore, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2276 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2277 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2278 | my_data->dispatch_table.DestroySemaphore(device, semaphore, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2279 | } |
| 2280 | } |
| 2281 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2282 | VKAPI_ATTR VkResult VKAPI_CALL CreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, |
| 2283 | const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2284 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2285 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2286 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2287 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2288 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2289 | skip |= parameter_validation_vkCreateEvent(my_data->report_data, pCreateInfo, pAllocator, pEvent); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2290 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2291 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2292 | result = my_data->dispatch_table.CreateEvent(device, pCreateInfo, pAllocator, pEvent); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2293 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2294 | validate_result(my_data->report_data, "vkCreateEvent", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2295 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2296 | |
| 2297 | return result; |
| 2298 | } |
| 2299 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2300 | 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] | 2301 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2302 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2303 | assert(my_data != NULL); |
| 2304 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2305 | skip |= parameter_validation_vkDestroyEvent(my_data->report_data, event, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2306 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2307 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2308 | my_data->dispatch_table.DestroyEvent(device, event, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2309 | } |
| 2310 | } |
| 2311 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2312 | VKAPI_ATTR VkResult VKAPI_CALL GetEventStatus(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2313 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2314 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2315 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2316 | assert(my_data != NULL); |
| 2317 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2318 | skip |= parameter_validation_vkGetEventStatus(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2319 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2320 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2321 | result = my_data->dispatch_table.GetEventStatus(device, event); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2322 | |
| 2323 | validate_result(my_data->report_data, "vkGetEventStatus", result); |
| 2324 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2325 | |
| 2326 | return result; |
| 2327 | } |
| 2328 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2329 | VKAPI_ATTR VkResult VKAPI_CALL SetEvent(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2330 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2331 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2332 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2333 | assert(my_data != NULL); |
| 2334 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2335 | skip |= parameter_validation_vkSetEvent(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2336 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2337 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2338 | result = my_data->dispatch_table.SetEvent(device, event); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2339 | |
| 2340 | validate_result(my_data->report_data, "vkSetEvent", result); |
| 2341 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2342 | |
| 2343 | return result; |
| 2344 | } |
| 2345 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2346 | VKAPI_ATTR VkResult VKAPI_CALL ResetEvent(VkDevice device, VkEvent event) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2347 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2348 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2349 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2350 | assert(my_data != NULL); |
| 2351 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2352 | skip |= parameter_validation_vkResetEvent(my_data->report_data, event); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2353 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2354 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2355 | result = my_data->dispatch_table.ResetEvent(device, event); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 2356 | |
| 2357 | validate_result(my_data->report_data, "vkResetEvent", result); |
| 2358 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2359 | |
| 2360 | return result; |
| 2361 | } |
| 2362 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2363 | VKAPI_ATTR VkResult VKAPI_CALL CreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2364 | const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2365 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2366 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2367 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2368 | assert(device_data != nullptr); |
| 2369 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2370 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2371 | skip |= parameter_validation_vkCreateQueryPool(device_data->report_data, pCreateInfo, pAllocator, pQueryPool); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2372 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2373 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 2374 | if (pCreateInfo != nullptr) { |
| 2375 | // If queryType is VK_QUERY_TYPE_PIPELINE_STATISTICS, pipelineStatistics must be a valid combination of |
| 2376 | // VkQueryPipelineStatisticFlagBits values |
| 2377 | if ((pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS) && (pCreateInfo->pipelineStatistics != 0) && |
| 2378 | ((pCreateInfo->pipelineStatistics & (~AllVkQueryPipelineStatisticFlagBits)) != 0)) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2379 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2380 | VALIDATION_ERROR_01007, LayerName, |
| 2381 | "vkCreateQueryPool(): if pCreateInfo->queryType is " |
| 2382 | "VK_QUERY_TYPE_PIPELINE_STATISTICS, pCreateInfo->pipelineStatistics must be " |
| 2383 | "a valid combination of VkQueryPipelineStatisticFlagBits values. %s", |
| 2384 | validation_error_map[VALIDATION_ERROR_01007]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2385 | } |
| 2386 | } |
| 2387 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2388 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2389 | result = device_data->dispatch_table.CreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2390 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2391 | validate_result(report_data, "vkCreateQueryPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2392 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2393 | |
| 2394 | return result; |
| 2395 | } |
| 2396 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2397 | 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] | 2398 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2399 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2400 | assert(my_data != NULL); |
| 2401 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2402 | skip |= parameter_validation_vkDestroyQueryPool(my_data->report_data, queryPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2403 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2404 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2405 | my_data->dispatch_table.DestroyQueryPool(device, queryPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2406 | } |
| 2407 | } |
| 2408 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2409 | VKAPI_ATTR VkResult VKAPI_CALL GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, |
| 2410 | size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2411 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2412 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2413 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2414 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2415 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2416 | skip |= parameter_validation_vkGetQueryPoolResults(my_data->report_data, queryPool, firstQuery, queryCount, dataSize, pData, |
| 2417 | stride, flags); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2418 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2419 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2420 | result = |
| 2421 | 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] | 2422 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2423 | validate_result(my_data->report_data, "vkGetQueryPoolResults", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2424 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2425 | |
| 2426 | return result; |
| 2427 | } |
| 2428 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2429 | VKAPI_ATTR VkResult VKAPI_CALL CreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, |
| 2430 | const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2431 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2432 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2433 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2434 | assert(device_data != nullptr); |
| 2435 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2436 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2437 | skip |= parameter_validation_vkCreateBuffer(report_data, pCreateInfo, pAllocator, pBuffer); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2438 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2439 | if (pCreateInfo != nullptr) { |
Maciej Jesionowski | 420b1c3 | 2016-12-14 11:01:21 +0100 | [diff] [blame] | 2440 | // Buffer size must be greater than 0 (error 00663) |
| 2441 | skip |= |
| 2442 | ValidateGreaterThan(report_data, "vkCreateBuffer", "pCreateInfo->size", static_cast<uint32_t>(pCreateInfo->size), 0u); |
| 2443 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2444 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 2445 | if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { |
| 2446 | // If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1 |
| 2447 | if (pCreateInfo->queueFamilyIndexCount <= 1) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2448 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2449 | VALIDATION_ERROR_00665, LayerName, |
| 2450 | "vkCreateBuffer: if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " |
| 2451 | "pCreateInfo->queueFamilyIndexCount must be greater than 1. %s", |
| 2452 | validation_error_map[VALIDATION_ERROR_00665]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2453 | } |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2454 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2455 | // If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a pointer to an array of |
| 2456 | // queueFamilyIndexCount uint32_t values |
| 2457 | if (pCreateInfo->pQueueFamilyIndices == nullptr) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2458 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2459 | VALIDATION_ERROR_00664, LayerName, |
| 2460 | "vkCreateBuffer: if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " |
| 2461 | "pCreateInfo->pQueueFamilyIndices must be a pointer to an array of " |
| 2462 | "pCreateInfo->queueFamilyIndexCount uint32_t values. %s", |
| 2463 | validation_error_map[VALIDATION_ERROR_00664]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2464 | } |
| 2465 | |
| 2466 | // Ensure that the queue family indices were specified at device creation |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2467 | skip |= validate_queue_family_indices(device_data, "vkCreateBuffer", "pCreateInfo->pQueueFamilyIndices", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2468 | pCreateInfo->queueFamilyIndexCount, pCreateInfo->pQueueFamilyIndices); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2469 | } |
Maciej Jesionowski | 420b1c3 | 2016-12-14 11:01:21 +0100 | [diff] [blame] | 2470 | |
| 2471 | // If flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain |
| 2472 | // VK_BUFFER_CREATE_SPARSE_BINDING_BIT |
| 2473 | if (((pCreateInfo->flags & (VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT)) != 0) && |
| 2474 | ((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] | 2475 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2476 | VALIDATION_ERROR_00669, LayerName, |
| 2477 | "vkCreateBuffer: if pCreateInfo->flags contains VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT or " |
| 2478 | "VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_BUFFER_CREATE_SPARSE_BINDING_BIT. %s", |
| 2479 | validation_error_map[VALIDATION_ERROR_00669]); |
Maciej Jesionowski | 420b1c3 | 2016-12-14 11:01:21 +0100 | [diff] [blame] | 2480 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2481 | } |
| 2482 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2483 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2484 | result = device_data->dispatch_table.CreateBuffer(device, pCreateInfo, pAllocator, pBuffer); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2485 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2486 | validate_result(report_data, "vkCreateBuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2487 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2488 | |
| 2489 | return result; |
| 2490 | } |
| 2491 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2492 | 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] | 2493 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2494 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2495 | assert(my_data != NULL); |
| 2496 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2497 | skip |= parameter_validation_vkDestroyBuffer(my_data->report_data, buffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2498 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2499 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2500 | my_data->dispatch_table.DestroyBuffer(device, buffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2501 | } |
| 2502 | } |
| 2503 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2504 | VKAPI_ATTR VkResult VKAPI_CALL CreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, |
| 2505 | const VkAllocationCallbacks *pAllocator, VkBufferView *pView) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2506 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2507 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2508 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2509 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2510 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2511 | skip |= parameter_validation_vkCreateBufferView(my_data->report_data, pCreateInfo, pAllocator, pView); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2512 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2513 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2514 | result = my_data->dispatch_table.CreateBufferView(device, pCreateInfo, pAllocator, pView); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2515 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2516 | validate_result(my_data->report_data, "vkCreateBufferView", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2517 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2518 | |
| 2519 | return result; |
| 2520 | } |
| 2521 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2522 | 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] | 2523 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2524 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2525 | assert(my_data != NULL); |
| 2526 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2527 | skip |= parameter_validation_vkDestroyBufferView(my_data->report_data, bufferView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2528 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2529 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2530 | my_data->dispatch_table.DestroyBufferView(device, bufferView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2531 | } |
| 2532 | } |
| 2533 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2534 | VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, |
| 2535 | const VkAllocationCallbacks *pAllocator, VkImage *pImage) { |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2536 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2537 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2538 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2539 | assert(device_data != nullptr); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2540 | debug_report_data *report_data = device_data->report_data; |
| 2541 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2542 | skip |= parameter_validation_vkCreateImage(report_data, pCreateInfo, pAllocator, pImage); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2543 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2544 | if (pCreateInfo != nullptr) { |
Mark Lobodzinski | 7d9ef88 | 2017-03-01 16:15:02 -0700 | [diff] [blame] | 2545 | |
| 2546 | if ((device_data->physical_device_features.textureCompressionETC2 == false) && |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 2547 | FormatIsCompressed_ETC2_EAC(pCreateInfo->format)) { |
Mark Lobodzinski | 7d9ef88 | 2017-03-01 16:15:02 -0700 | [diff] [blame] | 2548 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2549 | DEVICE_FEATURE, LayerName, |
| 2550 | "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionETC2 feature is " |
| 2551 | "not enabled: neither ETC2 nor EAC formats can be used to create images.", |
| 2552 | string_VkFormat(pCreateInfo->format)); |
| 2553 | } |
| 2554 | |
Mark Lobodzinski | 846c214 | 2017-03-01 16:17:39 -0700 | [diff] [blame] | 2555 | if ((device_data->physical_device_features.textureCompressionASTC_LDR == false) && |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 2556 | FormatIsCompressed_ASTC_LDR(pCreateInfo->format)) { |
Mark Lobodzinski | 846c214 | 2017-03-01 16:17:39 -0700 | [diff] [blame] | 2557 | skip |= |
| 2558 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2559 | DEVICE_FEATURE, LayerName, |
| 2560 | "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionASTC_LDR feature is " |
| 2561 | "not enabled: ASTC formats cannot be used to create images.", |
| 2562 | string_VkFormat(pCreateInfo->format)); |
| 2563 | } |
| 2564 | |
Mark Lobodzinski | 64f374e | 2017-03-01 16:19:36 -0700 | [diff] [blame] | 2565 | if ((device_data->physical_device_features.textureCompressionBC == false) && |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 2566 | FormatIsCompressed_BC(pCreateInfo->format)) { |
Mark Lobodzinski | 64f374e | 2017-03-01 16:19:36 -0700 | [diff] [blame] | 2567 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2568 | DEVICE_FEATURE, LayerName, |
| 2569 | "vkCreateImage(): Attempting to create VkImage with format %s. The textureCompressionBC feature is " |
| 2570 | "not enabled: BC compressed formats cannot be used to create images.", |
| 2571 | string_VkFormat(pCreateInfo->format)); |
| 2572 | } |
| 2573 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2574 | // 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] | 2575 | if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2576 | // If sharingMode is VK_SHARING_MODE_CONCURRENT, queueFamilyIndexCount must be greater than 1 |
| 2577 | if (pCreateInfo->queueFamilyIndexCount <= 1) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2578 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2579 | VALIDATION_ERROR_00714, LayerName, |
| 2580 | "vkCreateImage(): if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " |
| 2581 | "pCreateInfo->queueFamilyIndexCount must be greater than 1. %s", |
| 2582 | validation_error_map[VALIDATION_ERROR_00714]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2583 | } |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2584 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2585 | // If sharingMode is VK_SHARING_MODE_CONCURRENT, pQueueFamilyIndices must be a pointer to an array of |
| 2586 | // queueFamilyIndexCount uint32_t values |
| 2587 | if (pCreateInfo->pQueueFamilyIndices == nullptr) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2588 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2589 | VALIDATION_ERROR_00713, LayerName, |
| 2590 | "vkCreateImage(): if pCreateInfo->sharingMode is VK_SHARING_MODE_CONCURRENT, " |
| 2591 | "pCreateInfo->pQueueFamilyIndices must be a pointer to an array of " |
| 2592 | "pCreateInfo->queueFamilyIndexCount uint32_t values. %s", |
| 2593 | validation_error_map[VALIDATION_ERROR_00713]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 2594 | } |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2595 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2596 | skip |= validate_queue_family_indices(device_data, "vkCreateImage", "pCreateInfo->pQueueFamilyIndices", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2597 | pCreateInfo->queueFamilyIndexCount, pCreateInfo->pQueueFamilyIndices); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2598 | } |
| 2599 | |
| 2600 | // width, height, and depth members of extent must be greater than 0 |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2601 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.width", pCreateInfo->extent.width, 0u); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2602 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.height", pCreateInfo->extent.height, 0u); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2603 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->extent.depth", pCreateInfo->extent.depth, 0u); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2604 | |
| 2605 | // mipLevels must be greater than 0 |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2606 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->mipLevels", pCreateInfo->mipLevels, 0u); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2607 | |
| 2608 | // arrayLayers must be greater than 0 |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2609 | skip |= ValidateGreaterThan(report_data, "vkCreateImage", "pCreateInfo->arrayLayers", pCreateInfo->arrayLayers, 0u); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2610 | |
| 2611 | // If imageType is VK_IMAGE_TYPE_1D, both extent.height and extent.depth must be 1 |
| 2612 | if ((pCreateInfo->imageType == VK_IMAGE_TYPE_1D) && (pCreateInfo->extent.height != 1) && (pCreateInfo->extent.depth != 1)) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 2613 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2614 | VALIDATION_ERROR_02129, LayerName, |
| 2615 | "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_1D, both " |
| 2616 | "pCreateInfo->extent.height and pCreateInfo->extent.depth must be 1. %s", |
| 2617 | validation_error_map[VALIDATION_ERROR_02129]); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2618 | } |
| 2619 | |
| 2620 | if (pCreateInfo->imageType == VK_IMAGE_TYPE_2D) { |
| 2621 | // If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and |
| 2622 | // extent.height must be equal |
| 2623 | if ((pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) && |
| 2624 | (pCreateInfo->extent.width != pCreateInfo->extent.height)) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2625 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2626 | VALIDATION_ERROR_02127, LayerName, |
| 2627 | "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D and " |
| 2628 | "pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, " |
| 2629 | "pCreateInfo->extent.width and pCreateInfo->extent.height must be equal. %s", |
| 2630 | validation_error_map[VALIDATION_ERROR_02127]); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2631 | } |
| 2632 | |
| 2633 | if (pCreateInfo->extent.depth != 1) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2634 | skip |= log_msg( |
| 2635 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, VALIDATION_ERROR_02130, |
| 2636 | LayerName, |
| 2637 | "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D, pCreateInfo->extent.depth must be 1. %s", |
| 2638 | validation_error_map[VALIDATION_ERROR_02130]); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2639 | } |
| 2640 | } |
| 2641 | |
| 2642 | // mipLevels must be less than or equal to floor(log2(max(extent.width,extent.height,extent.depth)))+1 |
| 2643 | uint32_t maxDim = std::max(std::max(pCreateInfo->extent.width, pCreateInfo->extent.height), pCreateInfo->extent.depth); |
| 2644 | if (pCreateInfo->mipLevels > (floor(log2(maxDim)) + 1)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2645 | skip |= |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2646 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2647 | VALIDATION_ERROR_02131, LayerName, |
Mike Weiblen | fa0fd07 | 2017-01-06 16:20:51 -0700 | [diff] [blame] | 2648 | "vkCreateImage(): pCreateInfo->mipLevels must be less than or equal to " |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 2649 | "floor(log2(max(pCreateInfo->extent.width, pCreateInfo->extent.height, pCreateInfo->extent.depth)))+1. %s", |
| 2650 | validation_error_map[VALIDATION_ERROR_02131]); |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2651 | } |
| 2652 | |
| 2653 | // If flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain |
| 2654 | // VK_IMAGE_CREATE_SPARSE_BINDING_BIT |
| 2655 | if (((pCreateInfo->flags & (VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT)) != 0) && |
| 2656 | ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) != VK_IMAGE_CREATE_SPARSE_BINDING_BIT)) { |
Mark Lobodzinski | 181ec3a | 2016-12-14 13:37:04 -0700 | [diff] [blame] | 2657 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2658 | VALIDATION_ERROR_02160, LayerName, |
| 2659 | "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT or " |
| 2660 | "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, it must also contain VK_IMAGE_CREATE_SPARSE_BINDING_BIT. %s", |
| 2661 | validation_error_map[VALIDATION_ERROR_02160]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2662 | } |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2663 | |
| 2664 | // Check for combinations of attributes that are incompatible with having VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT set |
| 2665 | if ((pCreateInfo->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) != 0) { |
| 2666 | // Linear tiling is unsupported |
| 2667 | if (VK_IMAGE_TILING_LINEAR == pCreateInfo->tiling) { |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 2668 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2669 | INVALID_USAGE, LayerName, |
| 2670 | "vkCreateImage: if pCreateInfo->flags contains VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT " |
| 2671 | "then image tiling of VK_IMAGE_TILING_LINEAR is not supported"); |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2672 | } |
| 2673 | |
| 2674 | // Sparse 1D image isn't valid |
| 2675 | if (VK_IMAGE_TYPE_1D == pCreateInfo->imageType) { |
| 2676 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 2677 | VALIDATION_ERROR_02352, LayerName, |
| 2678 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 1D image. %s", |
| 2679 | validation_error_map[VALIDATION_ERROR_02352]); |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2680 | } |
| 2681 | |
Dave Houlton | 7e679e2 | 2017-01-23 16:37:04 -0700 | [diff] [blame] | 2682 | // Sparse 2D image when device doesn't support it |
| 2683 | if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage2D) && |
| 2684 | (VK_IMAGE_TYPE_2D == pCreateInfo->imageType)) { |
| 2685 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2686 | VALIDATION_ERROR_02144, LayerName, |
| 2687 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2D image if corresponding " |
| 2688 | "feature is not enabled on the device. %s", |
| 2689 | validation_error_map[VALIDATION_ERROR_02144]); |
| 2690 | } |
| 2691 | |
| 2692 | // Sparse 3D image when device doesn't support it |
| 2693 | if ((VK_FALSE == device_data->physical_device_features.sparseResidencyImage3D) && |
| 2694 | (VK_IMAGE_TYPE_3D == pCreateInfo->imageType)) { |
| 2695 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2696 | VALIDATION_ERROR_02145, LayerName, |
| 2697 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 3D image if corresponding " |
| 2698 | "feature is not enabled on the device. %s", |
| 2699 | validation_error_map[VALIDATION_ERROR_02145]); |
| 2700 | } |
| 2701 | |
| 2702 | // Multi-sample 2D image when device doesn't support it |
| 2703 | if (VK_IMAGE_TYPE_2D == pCreateInfo->imageType) { |
| 2704 | if ((VK_FALSE == device_data->physical_device_features.sparseResidency2Samples) && |
| 2705 | (VK_SAMPLE_COUNT_2_BIT == pCreateInfo->samples)) { |
| 2706 | skip |= log_msg( |
| 2707 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2708 | VALIDATION_ERROR_02146, LayerName, |
| 2709 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 2-sample image if corresponding " |
| 2710 | "feature is not enabled on the device. %s", |
| 2711 | validation_error_map[VALIDATION_ERROR_02146]); |
| 2712 | } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency4Samples) && |
| 2713 | (VK_SAMPLE_COUNT_4_BIT == pCreateInfo->samples)) { |
| 2714 | skip |= log_msg( |
| 2715 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2716 | VALIDATION_ERROR_02147, LayerName, |
| 2717 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 4-sample image if corresponding " |
| 2718 | "feature is not enabled on the device. %s", |
| 2719 | validation_error_map[VALIDATION_ERROR_02147]); |
| 2720 | } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency8Samples) && |
| 2721 | (VK_SAMPLE_COUNT_8_BIT == pCreateInfo->samples)) { |
| 2722 | skip |= log_msg( |
| 2723 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2724 | VALIDATION_ERROR_02148, LayerName, |
| 2725 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 8-sample image if corresponding " |
| 2726 | "feature is not enabled on the device. %s", |
| 2727 | validation_error_map[VALIDATION_ERROR_02148]); |
| 2728 | } else if ((VK_FALSE == device_data->physical_device_features.sparseResidency16Samples) && |
| 2729 | (VK_SAMPLE_COUNT_16_BIT == pCreateInfo->samples)) { |
| 2730 | skip |= log_msg( |
| 2731 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 2732 | VALIDATION_ERROR_02149, LayerName, |
| 2733 | "vkCreateImage: cannot specify VK_IMAGE_CREATE_SPARSE_BINDING_BIT for 16-sample image if corresponding " |
| 2734 | "feature is not enabled on the device. %s", |
| 2735 | validation_error_map[VALIDATION_ERROR_02149]); |
| 2736 | } |
| 2737 | } |
| 2738 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2739 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2740 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2741 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2742 | result = device_data->dispatch_table.CreateImage(device, pCreateInfo, pAllocator, pImage); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2743 | |
Dustin Graves | f8032f2 | 2016-05-11 18:31:44 -0600 | [diff] [blame] | 2744 | validate_result(report_data, "vkCreateImage", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2745 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2746 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 2747 | return result; |
| 2748 | } |
| 2749 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2750 | 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] | 2751 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2752 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2753 | assert(my_data != NULL); |
| 2754 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2755 | skip |= parameter_validation_vkDestroyImage(my_data->report_data, image, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2756 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2757 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2758 | my_data->dispatch_table.DestroyImage(device, image, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2759 | } |
| 2760 | } |
| 2761 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 2762 | static bool PreGetImageSubresourceLayout(VkDevice device, const VkImageSubresource *pSubresource) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2763 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2764 | if (pSubresource != nullptr) { |
| 2765 | if ((pSubresource->aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT | |
| 2766 | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 2767 | 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] | 2768 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2769 | "vkGetImageSubresourceLayout parameter, VkImageAspect pSubresource->aspectMask, is an unrecognized enumerator"); |
| 2770 | return false; |
| 2771 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2772 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2773 | |
| 2774 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2775 | } |
| 2776 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2777 | VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, |
| 2778 | VkSubresourceLayout *pLayout) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2779 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2780 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2781 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2782 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2783 | skip |= parameter_validation_vkGetImageSubresourceLayout(my_data->report_data, image, pSubresource, pLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2784 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2785 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2786 | PreGetImageSubresourceLayout(device, pSubresource); |
| 2787 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2788 | my_data->dispatch_table.GetImageSubresourceLayout(device, image, pSubresource, pLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2789 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2790 | } |
| 2791 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2792 | VKAPI_ATTR VkResult VKAPI_CALL CreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, |
| 2793 | const VkAllocationCallbacks *pAllocator, VkImageView *pView) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2794 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2795 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2796 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2797 | assert(my_data != NULL); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2798 | debug_report_data *report_data = my_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 2799 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2800 | skip |= parameter_validation_vkCreateImageView(report_data, pCreateInfo, pAllocator, pView); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2801 | |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2802 | if (pCreateInfo != nullptr) { |
| 2803 | 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] | 2804 | if ((pCreateInfo->subresourceRange.layerCount != 1) && |
| 2805 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 2806 | skip |= |
| 2807 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, |
| 2808 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD, " |
| 2809 | "pCreateInfo->subresourceRange.layerCount must be 1", |
| 2810 | ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D) ? 1 : 2)); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2811 | } |
| 2812 | } else if ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D_ARRAY) || |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2813 | (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D_ARRAY)) { |
| 2814 | if ((pCreateInfo->subresourceRange.layerCount < 1) && |
| 2815 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 2816 | skip |= |
| 2817 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, |
| 2818 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_%dD_ARRAY, " |
| 2819 | "pCreateInfo->subresourceRange.layerCount must be >= 1", |
| 2820 | ((pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_1D_ARRAY) ? 1 : 2)); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2821 | } |
| 2822 | } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE) { |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2823 | if ((pCreateInfo->subresourceRange.layerCount != 6) && |
| 2824 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 2825 | skip |= |
| 2826 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, |
| 2827 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE, " |
| 2828 | "pCreateInfo->subresourceRange.layerCount must be 6"); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2829 | } |
| 2830 | } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) { |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2831 | if (((pCreateInfo->subresourceRange.layerCount == 0) || ((pCreateInfo->subresourceRange.layerCount % 6) != 0)) && |
| 2832 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 2833 | skip |= |
| 2834 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, |
| 2835 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_CUBE_ARRAY, " |
| 2836 | "pCreateInfo->subresourceRange.layerCount must be a multiple of 6"); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2837 | } |
Mark Lobodzinski | 3d7e6b5 | 2017-02-28 13:45:20 -0700 | [diff] [blame] | 2838 | if (!my_data->physical_device_features.imageCubeArray) { |
| 2839 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, |
| 2840 | LayerName, "vkCreateImageView: Device feature imageCubeArray not enabled."); |
| 2841 | } |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2842 | } else if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_3D) { |
| 2843 | if (pCreateInfo->subresourceRange.baseArrayLayer != 0) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 2844 | skip |= |
| 2845 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, |
| 2846 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " |
| 2847 | "pCreateInfo->subresourceRange.baseArrayLayer must be 0"); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2848 | } |
| 2849 | |
Dustin Graves | 2a80dc6 | 2016-07-12 13:57:02 -0600 | [diff] [blame] | 2850 | if ((pCreateInfo->subresourceRange.layerCount != 1) && |
| 2851 | (pCreateInfo->subresourceRange.layerCount != VK_REMAINING_ARRAY_LAYERS)) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 2852 | skip |= |
| 2853 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, 1, LayerName, |
| 2854 | "vkCreateImageView: if pCreateInfo->viewType is VK_IMAGE_TYPE_3D, " |
| 2855 | "pCreateInfo->subresourceRange.layerCount must be 1"); |
Dustin Graves | 0b70a63 | 2016-04-27 17:44:56 -0600 | [diff] [blame] | 2856 | } |
| 2857 | } |
| 2858 | } |
| 2859 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2860 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2861 | result = my_data->dispatch_table.CreateImageView(device, pCreateInfo, pAllocator, pView); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2862 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2863 | validate_result(my_data->report_data, "vkCreateImageView", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2864 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 2865 | |
| 2866 | return result; |
| 2867 | } |
| 2868 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2869 | 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] | 2870 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2871 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2872 | assert(my_data != NULL); |
| 2873 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2874 | skip |= parameter_validation_vkDestroyImageView(my_data->report_data, imageView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2875 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2876 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2877 | my_data->dispatch_table.DestroyImageView(device, imageView, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2878 | } |
| 2879 | } |
| 2880 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2881 | VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2882 | const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2883 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2884 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2885 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2886 | assert(my_data != NULL); |
| 2887 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2888 | skip |= parameter_validation_vkCreateShaderModule(my_data->report_data, pCreateInfo, pAllocator, pShaderModule); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2889 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2890 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2891 | result = my_data->dispatch_table.CreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2892 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2893 | validate_result(my_data->report_data, "vkCreateShaderModule", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2894 | } |
| 2895 | |
Michael Lentine | 03d8e57 | 2015-09-15 14:59:14 -0500 | [diff] [blame] | 2896 | return result; |
| 2897 | } |
| 2898 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2899 | VKAPI_ATTR void VKAPI_CALL DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, |
| 2900 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2901 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2902 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2903 | assert(my_data != NULL); |
| 2904 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2905 | skip |= parameter_validation_vkDestroyShaderModule(my_data->report_data, shaderModule, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2906 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2907 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2908 | my_data->dispatch_table.DestroyShaderModule(device, shaderModule, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2909 | } |
| 2910 | } |
| 2911 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 2912 | VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2913 | const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2914 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2915 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2916 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2917 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2918 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2919 | skip |= parameter_validation_vkCreatePipelineCache(my_data->report_data, pCreateInfo, pAllocator, pPipelineCache); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2920 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2921 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 2922 | result = my_data->dispatch_table.CreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2923 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2924 | validate_result(my_data->report_data, "vkCreatePipelineCache", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2925 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2926 | |
| 2927 | return result; |
| 2928 | } |
| 2929 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2930 | VKAPI_ATTR void VKAPI_CALL DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, |
| 2931 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2932 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2933 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2934 | assert(my_data != NULL); |
| 2935 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2936 | skip |= parameter_validation_vkDestroyPipelineCache(my_data->report_data, pipelineCache, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2937 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2938 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2939 | my_data->dispatch_table.DestroyPipelineCache(device, pipelineCache, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 2940 | } |
| 2941 | } |
| 2942 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2943 | VKAPI_ATTR VkResult VKAPI_CALL GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, |
| 2944 | void *pData) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2945 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2946 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2947 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2948 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2949 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2950 | skip |= parameter_validation_vkGetPipelineCacheData(my_data->report_data, pipelineCache, pDataSize, pData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2951 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2952 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2953 | result = my_data->dispatch_table.GetPipelineCacheData(device, pipelineCache, pDataSize, pData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2954 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2955 | validate_result(my_data->report_data, "vkGetPipelineCacheData", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2956 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2957 | |
| 2958 | return result; |
| 2959 | } |
| 2960 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 2961 | VKAPI_ATTR VkResult VKAPI_CALL MergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, |
| 2962 | const VkPipelineCache *pSrcCaches) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2963 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2964 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2965 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2966 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2967 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2968 | skip |= parameter_validation_vkMergePipelineCaches(my_data->report_data, dstCache, srcCacheCount, pSrcCaches); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2969 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 2970 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 2971 | result = my_data->dispatch_table.MergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2972 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 2973 | validate_result(my_data->report_data, "vkMergePipelineCaches", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 2974 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 2975 | |
| 2976 | return result; |
| 2977 | } |
| 2978 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 2979 | static bool PreCreateGraphicsPipelines(VkDevice device, const VkGraphicsPipelineCreateInfo *pCreateInfos) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 2980 | layer_data *data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2981 | bool skip = false; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 2982 | |
| 2983 | // TODO: Handle count |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2984 | if (pCreateInfos != nullptr) { |
Maks Naumov | 34f52a1 | 2016-12-28 01:15:17 +0200 | [diff] [blame] | 2985 | if (pCreateInfos->flags & VK_PIPELINE_CREATE_DERIVATIVE_BIT) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2986 | if (pCreateInfos->basePipelineIndex != -1) { |
| 2987 | if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 2988 | skip |= log_msg( |
| 2989 | data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 2990 | VALIDATION_ERROR_00526, LayerName, |
| 2991 | "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineHandle, must be VK_NULL_HANDLE if " |
| 2992 | "pCreateInfos->flags " |
| 2993 | "contains the VK_PIPELINE_CREATE_DERIVATIVE_BIT flag and pCreateInfos->basePipelineIndex is not -1. %s", |
| 2994 | validation_error_map[VALIDATION_ERROR_00526]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 2995 | } |
| 2996 | } |
| 2997 | |
| 2998 | if (pCreateInfos->basePipelineHandle != VK_NULL_HANDLE) { |
| 2999 | if (pCreateInfos->basePipelineIndex != -1) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3000 | skip |= log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 3001 | 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] | 3002 | VALIDATION_ERROR_00528, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3003 | "vkCreateGraphicsPipelines parameter, pCreateInfos->basePipelineIndex, must be -1 if pCreateInfos->flags " |
| 3004 | "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] | 3005 | "VK_NULL_HANDLE. %s", |
| 3006 | validation_error_map[VALIDATION_ERROR_00528]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3007 | } |
Jeremy Hayes | 2fdaaf2 | 2016-03-01 17:51:54 -0700 | [diff] [blame] | 3008 | } |
| 3009 | } |
| 3010 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3011 | if (pCreateInfos->pRasterizationState != nullptr) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3012 | if (pCreateInfos->pRasterizationState->cullMode & ~VK_CULL_MODE_FRONT_AND_BACK) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3013 | skip |= |
| 3014 | log_msg(data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3015 | UNRECOGNIZED_VALUE, LayerName, |
| 3016 | "vkCreateGraphicsPipelines parameter, VkCullMode pCreateInfos->pRasterizationState->cullMode, is an " |
| 3017 | "unrecognized enumerator"); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3018 | } |
Mark Lobodzinski | 2e67fdb | 2016-08-09 13:10:51 -0600 | [diff] [blame] | 3019 | |
| 3020 | if ((pCreateInfos->pRasterizationState->polygonMode != VK_POLYGON_MODE_FILL) && |
| 3021 | (data->physical_device_features.fillModeNonSolid == false)) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3022 | skip |= log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 3023 | 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] | 3024 | DEVICE_FEATURE, LayerName, |
| 3025 | "vkCreateGraphicsPipelines parameter, VkPolygonMode pCreateInfos->pRasterizationState->polygonMode cannot be " |
| 3026 | "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] | 3027 | } |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3028 | } |
Jeremy Hayes | 2fdaaf2 | 2016-03-01 17:51:54 -0700 | [diff] [blame] | 3029 | |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3030 | size_t i = 0; |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 3031 | for (size_t j = 0; j < pCreateInfos[i].stageCount; j++) { |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3032 | skip |= validate_string(data->report_data, "vkCreateGraphicsPipelines", |
| 3033 | ParameterName("pCreateInfos[%i].pStages[%i].pName", ParameterName::IndexVector{i, j}), |
| 3034 | pCreateInfos[i].pStages[j].pName); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3035 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3036 | } |
| 3037 | |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3038 | return skip; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3039 | } |
| 3040 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3041 | VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 3042 | const VkGraphicsPipelineCreateInfo *pCreateInfos, |
| 3043 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3044 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3045 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3046 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3047 | assert(device_data != nullptr); |
| 3048 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3049 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3050 | skip |= parameter_validation_vkCreateGraphicsPipelines(report_data, pipelineCache, createInfoCount, pCreateInfos, pAllocator, |
| 3051 | pPipelines); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3052 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3053 | if (pCreateInfos != nullptr) { |
| 3054 | for (uint32_t i = 0; i < createInfoCount; ++i) { |
| 3055 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 3056 | if (pCreateInfos[i].pTessellationState == nullptr) { |
| 3057 | if (pCreateInfos[i].pStages != nullptr) { |
| 3058 | // If pStages includes a tessellation control shader stage and a tessellation evaluation shader stage, |
| 3059 | // pTessellationState must not be NULL |
| 3060 | bool has_control = false; |
| 3061 | bool has_eval = false; |
| 3062 | |
| 3063 | for (uint32_t stage_index = 0; stage_index < pCreateInfos[i].stageCount; ++stage_index) { |
| 3064 | if (pCreateInfos[i].pStages[stage_index].stage == VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) { |
| 3065 | has_control = true; |
| 3066 | } else if (pCreateInfos[i].pStages[stage_index].stage == VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) { |
| 3067 | has_eval = true; |
| 3068 | } |
| 3069 | } |
| 3070 | |
| 3071 | if (has_control && has_eval) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3072 | 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] | 3073 | __LINE__, VALIDATION_ERROR_00536, LayerName, |
| 3074 | "vkCreateGraphicsPipelines: if pCreateInfos[%d].pStages includes a tessellation " |
| 3075 | "control shader stage and a tessellation evaluation shader stage, " |
| 3076 | "pCreateInfos[%d].pTessellationState must not be NULL. %s", |
| 3077 | i, i, validation_error_map[VALIDATION_ERROR_00536]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3078 | } |
| 3079 | } |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3080 | } else { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3081 | skip |= validate_struct_pnext( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3082 | report_data, "vkCreateGraphicsPipelines", |
| 3083 | ParameterName("pCreateInfos[%i].pTessellationState->pNext", ParameterName::IndexVector{i}), NULL, |
| 3084 | pCreateInfos[i].pTessellationState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3085 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3086 | skip |= validate_reserved_flags( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3087 | report_data, "vkCreateGraphicsPipelines", |
| 3088 | ParameterName("pCreateInfos[%i].pTessellationState->flags", ParameterName::IndexVector{i}), |
| 3089 | pCreateInfos[i].pTessellationState->flags); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3090 | |
| 3091 | 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] | 3092 | 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] | 3093 | __LINE__, VALIDATION_ERROR_00538, LayerName, |
| 3094 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pTessellationState->sType must be " |
| 3095 | "VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO. %s", |
| 3096 | i, validation_error_map[VALIDATION_ERROR_00538]); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3097 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3098 | } |
| 3099 | |
| 3100 | if (pCreateInfos[i].pViewportState == nullptr) { |
| 3101 | // If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pViewportState must be a pointer to a |
| 3102 | // valid VkPipelineViewportStateCreateInfo structure |
| 3103 | if ((pCreateInfos[i].pRasterizationState != nullptr) && |
| 3104 | (pCreateInfos[i].pRasterizationState->rasterizerDiscardEnable == VK_FALSE)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3105 | skip |= log_msg( |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3106 | 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] | 3107 | VALIDATION_ERROR_02113, LayerName, |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3108 | "vkCreateGraphicsPipelines: if pCreateInfos[%d].pRasterizationState->rasterizerDiscardEnable is VK_FALSE, " |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3109 | "pCreateInfos[%d].pViewportState must be a pointer to a valid VkPipelineViewportStateCreateInfo structure. " |
| 3110 | "%s", |
| 3111 | i, i, validation_error_map[VALIDATION_ERROR_02113]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3112 | } |
| 3113 | } else { |
Mark Lobodzinski | b81000e | 2016-12-16 13:08:00 -0700 | [diff] [blame] | 3114 | if (pCreateInfos[i].pViewportState->scissorCount != pCreateInfos[i].pViewportState->viewportCount) { |
| 3115 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
| 3116 | VALIDATION_ERROR_01434, LayerName, |
| 3117 | "Graphics Pipeline viewport count (%u) must match scissor count (%u). %s", |
| 3118 | pCreateInfos[i].pViewportState->viewportCount, pCreateInfos[i].pViewportState->scissorCount, |
| 3119 | validation_error_map[VALIDATION_ERROR_01434]); |
| 3120 | } |
| 3121 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3122 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3123 | validate_struct_pnext(report_data, "vkCreateGraphicsPipelines", |
| 3124 | ParameterName("pCreateInfos[%i].pViewportState->pNext", ParameterName::IndexVector{i}), |
| 3125 | NULL, pCreateInfos[i].pViewportState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3126 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3127 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3128 | validate_reserved_flags(report_data, "vkCreateGraphicsPipelines", |
| 3129 | ParameterName("pCreateInfos[%i].pViewportState->flags", ParameterName::IndexVector{i}), |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3130 | pCreateInfos[i].pViewportState->flags); |
| 3131 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3132 | 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] | 3133 | 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] | 3134 | __LINE__, INVALID_STRUCT_STYPE, LayerName, |
| 3135 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pViewportState->sType must be " |
| 3136 | "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO", |
| 3137 | i); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3138 | } |
| 3139 | |
Mark Lobodzinski | d40eeb1 | 2016-12-18 09:43:01 -0700 | [diff] [blame] | 3140 | if (device_data->physical_device_features.multiViewport == false) { |
| 3141 | if (pCreateInfos[i].pViewportState->viewportCount != 1) { |
| 3142 | skip |= |
| 3143 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3144 | __LINE__, VALIDATION_ERROR_01430, LayerName, |
| 3145 | "vkCreateGraphicsPipelines: The multiViewport feature is not enabled, so " |
| 3146 | "pCreateInfos[%d].pViewportState->viewportCount must be 1 but is %d. %s", |
| 3147 | i, pCreateInfos[i].pViewportState->viewportCount, validation_error_map[VALIDATION_ERROR_01430]); |
| 3148 | } |
| 3149 | if (pCreateInfos[i].pViewportState->scissorCount != 1) { |
| 3150 | skip |= |
| 3151 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3152 | __LINE__, VALIDATION_ERROR_01431, LayerName, |
| 3153 | "vkCreateGraphicsPipelines: The multiViewport feature is not enabled, so " |
| 3154 | "pCreateInfos[%d].pViewportState->scissorCount must be 1 but is %d. %s", |
| 3155 | i, pCreateInfos[i].pViewportState->scissorCount, validation_error_map[VALIDATION_ERROR_01431]); |
| 3156 | } |
| 3157 | } else { |
| 3158 | if ((pCreateInfos[i].pViewportState->viewportCount < 1) || |
| 3159 | (pCreateInfos[i].pViewportState->viewportCount > device_data->device_limits.maxViewports)) { |
| 3160 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3161 | __LINE__, VALIDATION_ERROR_01432, LayerName, |
| 3162 | "vkCreateGraphicsPipelines: multiViewport feature is enabled; " |
| 3163 | "pCreateInfos[%d].pViewportState->viewportCount is %d but must be between 1 and " |
| 3164 | "maxViewports (%d), inclusive. %s", |
| 3165 | i, pCreateInfos[i].pViewportState->viewportCount, device_data->device_limits.maxViewports, |
| 3166 | validation_error_map[VALIDATION_ERROR_01432]); |
| 3167 | } |
| 3168 | if ((pCreateInfos[i].pViewportState->scissorCount < 1) || |
| 3169 | (pCreateInfos[i].pViewportState->scissorCount > device_data->device_limits.maxViewports)) { |
| 3170 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3171 | __LINE__, VALIDATION_ERROR_01433, LayerName, |
| 3172 | "vkCreateGraphicsPipelines: multiViewport feature is enabled; " |
| 3173 | "pCreateInfos[%d].pViewportState->scissorCount is %d but must be between 1 and " |
| 3174 | "maxViewports (%d), inclusive. %s", |
| 3175 | i, pCreateInfos[i].pViewportState->scissorCount, device_data->device_limits.maxViewports, |
| 3176 | validation_error_map[VALIDATION_ERROR_01433]); |
| 3177 | } |
| 3178 | } |
| 3179 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3180 | if (pCreateInfos[i].pDynamicState != nullptr) { |
| 3181 | bool has_dynamic_viewport = false; |
| 3182 | bool has_dynamic_scissor = false; |
| 3183 | |
| 3184 | for (uint32_t state_index = 0; state_index < pCreateInfos[i].pDynamicState->dynamicStateCount; ++state_index) { |
| 3185 | if (pCreateInfos[i].pDynamicState->pDynamicStates[state_index] == VK_DYNAMIC_STATE_VIEWPORT) { |
| 3186 | has_dynamic_viewport = true; |
| 3187 | } else if (pCreateInfos[i].pDynamicState->pDynamicStates[state_index] == VK_DYNAMIC_STATE_SCISSOR) { |
| 3188 | has_dynamic_scissor = true; |
| 3189 | } |
| 3190 | } |
| 3191 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3192 | // If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_VIEWPORT, the pViewports |
| 3193 | // member of pViewportState must be a pointer to an array of pViewportState->viewportCount VkViewport structures |
| 3194 | if (!has_dynamic_viewport && (pCreateInfos[i].pViewportState->pViewports == nullptr)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3195 | skip |= |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3196 | 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] | 3197 | __LINE__, VALIDATION_ERROR_02110, LayerName, |
Tobin Ehlis | bebd316 | 2016-08-18 10:53:58 -0600 | [diff] [blame] | 3198 | "vkCreateGraphicsPipelines: if pCreateInfos[%d].pDynamicState->pDynamicStates does not contain " |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3199 | "VK_DYNAMIC_STATE_VIEWPORT, pCreateInfos[%d].pViewportState->pViewports must not be NULL. %s", |
| 3200 | i, i, validation_error_map[VALIDATION_ERROR_02110]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3201 | } |
| 3202 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3203 | // If no element of the pDynamicStates member of pDynamicState is VK_DYNAMIC_STATE_SCISSOR, the pScissors member |
| 3204 | // of pViewportState must be a pointer to an array of pViewportState->scissorCount VkRect2D structures |
| 3205 | if (!has_dynamic_scissor && (pCreateInfos[i].pViewportState->pScissors == nullptr)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3206 | skip |= |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3207 | 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] | 3208 | __LINE__, VALIDATION_ERROR_02111, LayerName, |
Tobin Ehlis | bebd316 | 2016-08-18 10:53:58 -0600 | [diff] [blame] | 3209 | "vkCreateGraphicsPipelines: if pCreateInfos[%d].pDynamicState->pDynamicStates does not contain " |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3210 | "VK_DYNAMIC_STATE_SCISSOR, pCreateInfos[%d].pViewportState->pScissors must not be NULL. %s", |
| 3211 | i, i, validation_error_map[VALIDATION_ERROR_02111]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3212 | } |
| 3213 | } |
| 3214 | } |
| 3215 | |
| 3216 | if (pCreateInfos[i].pMultisampleState == nullptr) { |
| 3217 | // If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, pMultisampleState must be a pointer to |
| 3218 | // a valid VkPipelineMultisampleStateCreateInfo structure |
| 3219 | if ((pCreateInfos[i].pRasterizationState != nullptr) && |
| 3220 | pCreateInfos[i].pRasterizationState->rasterizerDiscardEnable == VK_FALSE) { |
Mike Weiblen | 9858d96 | 2016-10-31 23:59:10 -0600 | [diff] [blame] | 3221 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3222 | __LINE__, VALIDATION_ERROR_02114, LayerName, |
| 3223 | "vkCreateGraphicsPipelines: if " |
| 3224 | "pCreateInfos[%d].pRasterizationState->rasterizerDiscardEnable is " |
| 3225 | "VK_FALSE, pCreateInfos[%d].pMultisampleState must not be NULL. %s", |
| 3226 | i, i, validation_error_map[VALIDATION_ERROR_02114]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3227 | } |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3228 | } else { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3229 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3230 | validate_struct_pnext(report_data, "vkCreateGraphicsPipelines", |
| 3231 | ParameterName("pCreateInfos[%i].pMultisampleState->pNext", ParameterName::IndexVector{i}), |
Dustin Graves | af5c029 | 2016-07-19 13:43:53 -0600 | [diff] [blame] | 3232 | NULL, pCreateInfos[i].pMultisampleState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3233 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3234 | skip |= validate_reserved_flags( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3235 | report_data, "vkCreateGraphicsPipelines", |
| 3236 | ParameterName("pCreateInfos[%i].pMultisampleState->flags", ParameterName::IndexVector{i}), |
| 3237 | pCreateInfos[i].pMultisampleState->flags); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3238 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3239 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3240 | report_data, "vkCreateGraphicsPipelines", |
| 3241 | ParameterName("pCreateInfos[%i].pMultisampleState->sampleShadingEnable", ParameterName::IndexVector{i}), |
| 3242 | pCreateInfos[i].pMultisampleState->sampleShadingEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3243 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3244 | skip |= validate_array( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3245 | report_data, "vkCreateGraphicsPipelines", |
| 3246 | ParameterName("pCreateInfos[%i].pMultisampleState->rasterizationSamples", ParameterName::IndexVector{i}), |
| 3247 | ParameterName("pCreateInfos[%i].pMultisampleState->pSampleMask", ParameterName::IndexVector{i}), |
| 3248 | pCreateInfos[i].pMultisampleState->rasterizationSamples, pCreateInfos[i].pMultisampleState->pSampleMask, true, |
| 3249 | false); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3250 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3251 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3252 | report_data, "vkCreateGraphicsPipelines", |
| 3253 | ParameterName("pCreateInfos[%i].pMultisampleState->alphaToCoverageEnable", ParameterName::IndexVector{i}), |
| 3254 | pCreateInfos[i].pMultisampleState->alphaToCoverageEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3255 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3256 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3257 | report_data, "vkCreateGraphicsPipelines", |
| 3258 | ParameterName("pCreateInfos[%i].pMultisampleState->alphaToOneEnable", ParameterName::IndexVector{i}), |
| 3259 | pCreateInfos[i].pMultisampleState->alphaToOneEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3260 | |
| 3261 | 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] | 3262 | 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] | 3263 | __LINE__, INVALID_STRUCT_STYPE, LayerName, |
| 3264 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pMultisampleState->sType must be " |
| 3265 | "VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO", |
| 3266 | i); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3267 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3268 | } |
| 3269 | |
| 3270 | // TODO: Conditional NULL check based on rasterizerDiscardEnable and subpass |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3271 | if (pCreateInfos[i].pDepthStencilState != nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3272 | skip |= validate_struct_pnext( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3273 | report_data, "vkCreateGraphicsPipelines", |
| 3274 | ParameterName("pCreateInfos[%i].pDepthStencilState->pNext", ParameterName::IndexVector{i}), NULL, |
| 3275 | pCreateInfos[i].pDepthStencilState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3276 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3277 | skip |= validate_reserved_flags( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3278 | report_data, "vkCreateGraphicsPipelines", |
| 3279 | ParameterName("pCreateInfos[%i].pDepthStencilState->flags", ParameterName::IndexVector{i}), |
| 3280 | pCreateInfos[i].pDepthStencilState->flags); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3281 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3282 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3283 | report_data, "vkCreateGraphicsPipelines", |
| 3284 | ParameterName("pCreateInfos[%i].pDepthStencilState->depthTestEnable", ParameterName::IndexVector{i}), |
| 3285 | pCreateInfos[i].pDepthStencilState->depthTestEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3286 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3287 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3288 | report_data, "vkCreateGraphicsPipelines", |
| 3289 | ParameterName("pCreateInfos[%i].pDepthStencilState->depthWriteEnable", ParameterName::IndexVector{i}), |
| 3290 | pCreateInfos[i].pDepthStencilState->depthWriteEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3291 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3292 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3293 | report_data, "vkCreateGraphicsPipelines", |
| 3294 | ParameterName("pCreateInfos[%i].pDepthStencilState->depthCompareOp", ParameterName::IndexVector{i}), |
| 3295 | "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, |
| 3296 | pCreateInfos[i].pDepthStencilState->depthCompareOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3297 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3298 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3299 | report_data, "vkCreateGraphicsPipelines", |
| 3300 | ParameterName("pCreateInfos[%i].pDepthStencilState->depthBoundsTestEnable", ParameterName::IndexVector{i}), |
| 3301 | pCreateInfos[i].pDepthStencilState->depthBoundsTestEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3302 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3303 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3304 | report_data, "vkCreateGraphicsPipelines", |
| 3305 | ParameterName("pCreateInfos[%i].pDepthStencilState->stencilTestEnable", ParameterName::IndexVector{i}), |
| 3306 | pCreateInfos[i].pDepthStencilState->stencilTestEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3307 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3308 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3309 | report_data, "vkCreateGraphicsPipelines", |
| 3310 | ParameterName("pCreateInfos[%i].pDepthStencilState->front.failOp", ParameterName::IndexVector{i}), |
| 3311 | "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, |
| 3312 | pCreateInfos[i].pDepthStencilState->front.failOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3313 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3314 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3315 | report_data, "vkCreateGraphicsPipelines", |
| 3316 | ParameterName("pCreateInfos[%i].pDepthStencilState->front.passOp", ParameterName::IndexVector{i}), |
| 3317 | "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, |
| 3318 | pCreateInfos[i].pDepthStencilState->front.passOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3319 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3320 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3321 | report_data, "vkCreateGraphicsPipelines", |
| 3322 | ParameterName("pCreateInfos[%i].pDepthStencilState->front.depthFailOp", ParameterName::IndexVector{i}), |
| 3323 | "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, |
| 3324 | pCreateInfos[i].pDepthStencilState->front.depthFailOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3325 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3326 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3327 | report_data, "vkCreateGraphicsPipelines", |
| 3328 | ParameterName("pCreateInfos[%i].pDepthStencilState->front.compareOp", ParameterName::IndexVector{i}), |
| 3329 | "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, |
| 3330 | pCreateInfos[i].pDepthStencilState->front.compareOp); |
| 3331 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3332 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3333 | report_data, "vkCreateGraphicsPipelines", |
| 3334 | ParameterName("pCreateInfos[%i].pDepthStencilState->back.failOp", ParameterName::IndexVector{i}), "VkStencilOp", |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3335 | VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, pCreateInfos[i].pDepthStencilState->back.failOp); |
| 3336 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3337 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3338 | report_data, "vkCreateGraphicsPipelines", |
| 3339 | ParameterName("pCreateInfos[%i].pDepthStencilState->back.passOp", ParameterName::IndexVector{i}), "VkStencilOp", |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3340 | VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, pCreateInfos[i].pDepthStencilState->back.passOp); |
| 3341 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3342 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3343 | report_data, "vkCreateGraphicsPipelines", |
| 3344 | ParameterName("pCreateInfos[%i].pDepthStencilState->back.depthFailOp", ParameterName::IndexVector{i}), |
| 3345 | "VkStencilOp", VK_STENCIL_OP_BEGIN_RANGE, VK_STENCIL_OP_END_RANGE, |
| 3346 | pCreateInfos[i].pDepthStencilState->back.depthFailOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3347 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3348 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3349 | report_data, "vkCreateGraphicsPipelines", |
| 3350 | ParameterName("pCreateInfos[%i].pDepthStencilState->back.compareOp", ParameterName::IndexVector{i}), |
| 3351 | "VkCompareOp", VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, |
| 3352 | pCreateInfos[i].pDepthStencilState->back.compareOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3353 | |
| 3354 | 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] | 3355 | 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] | 3356 | __LINE__, INVALID_STRUCT_STYPE, LayerName, |
| 3357 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pDepthStencilState->sType must be " |
| 3358 | "VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO", |
| 3359 | i); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3360 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3361 | } |
| 3362 | |
| 3363 | // TODO: Conditional NULL check based on rasterizerDiscardEnable and subpass |
| 3364 | if (pCreateInfos[i].pColorBlendState != nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3365 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3366 | validate_struct_pnext(report_data, "vkCreateGraphicsPipelines", |
| 3367 | ParameterName("pCreateInfos[%i].pColorBlendState->pNext", ParameterName::IndexVector{i}), |
| 3368 | NULL, pCreateInfos[i].pColorBlendState->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3369 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3370 | skip |= validate_reserved_flags( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3371 | report_data, "vkCreateGraphicsPipelines", |
| 3372 | ParameterName("pCreateInfos[%i].pColorBlendState->flags", ParameterName::IndexVector{i}), |
| 3373 | pCreateInfos[i].pColorBlendState->flags); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3374 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3375 | skip |= validate_bool32( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3376 | report_data, "vkCreateGraphicsPipelines", |
| 3377 | ParameterName("pCreateInfos[%i].pColorBlendState->logicOpEnable", ParameterName::IndexVector{i}), |
| 3378 | pCreateInfos[i].pColorBlendState->logicOpEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3379 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3380 | skip |= validate_array( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3381 | report_data, "vkCreateGraphicsPipelines", |
| 3382 | ParameterName("pCreateInfos[%i].pColorBlendState->attachmentCount", ParameterName::IndexVector{i}), |
| 3383 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments", ParameterName::IndexVector{i}), |
| 3384 | pCreateInfos[i].pColorBlendState->attachmentCount, pCreateInfos[i].pColorBlendState->pAttachments, false, true); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3385 | |
| 3386 | if (pCreateInfos[i].pColorBlendState->pAttachments != NULL) { |
| 3387 | for (uint32_t attachmentIndex = 0; attachmentIndex < pCreateInfos[i].pColorBlendState->attachmentCount; |
| 3388 | ++attachmentIndex) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3389 | skip |= validate_bool32(report_data, "vkCreateGraphicsPipelines", |
| 3390 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].blendEnable", |
| 3391 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3392 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].blendEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3393 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3394 | skip |= validate_ranged_enum( |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3395 | report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3396 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].srcColorBlendFactor", |
| 3397 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3398 | "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3399 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].srcColorBlendFactor); |
| 3400 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3401 | skip |= validate_ranged_enum( |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3402 | report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3403 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].dstColorBlendFactor", |
| 3404 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3405 | "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3406 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].dstColorBlendFactor); |
| 3407 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3408 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3409 | validate_ranged_enum(report_data, "vkCreateGraphicsPipelines", |
| 3410 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].colorBlendOp", |
| 3411 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3412 | "VkBlendOp", VK_BLEND_OP_BEGIN_RANGE, VK_BLEND_OP_END_RANGE, |
| 3413 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].colorBlendOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3414 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3415 | skip |= validate_ranged_enum( |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3416 | report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3417 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].srcAlphaBlendFactor", |
| 3418 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3419 | "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3420 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].srcAlphaBlendFactor); |
| 3421 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3422 | skip |= validate_ranged_enum( |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3423 | report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3424 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].dstAlphaBlendFactor", |
| 3425 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3426 | "VkBlendFactor", VK_BLEND_FACTOR_BEGIN_RANGE, VK_BLEND_FACTOR_END_RANGE, |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3427 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].dstAlphaBlendFactor); |
| 3428 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3429 | skip |= |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3430 | validate_ranged_enum(report_data, "vkCreateGraphicsPipelines", |
| 3431 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].alphaBlendOp", |
| 3432 | ParameterName::IndexVector{i, attachmentIndex}), |
| 3433 | "VkBlendOp", VK_BLEND_OP_BEGIN_RANGE, VK_BLEND_OP_END_RANGE, |
| 3434 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].alphaBlendOp); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3435 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3436 | skip |= |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3437 | validate_flags(report_data, "vkCreateGraphicsPipelines", |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3438 | ParameterName("pCreateInfos[%i].pColorBlendState->pAttachments[%i].colorWriteMask", |
| 3439 | ParameterName::IndexVector{i, attachmentIndex}), |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3440 | "VkColorComponentFlagBits", AllVkColorComponentFlagBits, |
| 3441 | pCreateInfos[i].pColorBlendState->pAttachments[attachmentIndex].colorWriteMask, false); |
| 3442 | } |
| 3443 | } |
| 3444 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3445 | 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] | 3446 | 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] | 3447 | __LINE__, INVALID_STRUCT_STYPE, LayerName, |
| 3448 | "vkCreateGraphicsPipelines: parameter pCreateInfos[%d].pColorBlendState->sType must be " |
| 3449 | "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO", |
| 3450 | i); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3451 | } |
| 3452 | |
| 3453 | // If logicOpEnable is VK_TRUE, logicOp must be a valid VkLogicOp value |
| 3454 | if (pCreateInfos[i].pColorBlendState->logicOpEnable == VK_TRUE) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3455 | skip |= validate_ranged_enum( |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3456 | report_data, "vkCreateGraphicsPipelines", |
| 3457 | ParameterName("pCreateInfos[%i].pColorBlendState->logicOp", ParameterName::IndexVector{i}), "VkLogicOp", |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3458 | VK_LOGIC_OP_BEGIN_RANGE, VK_LOGIC_OP_END_RANGE, pCreateInfos[i].pColorBlendState->logicOp); |
| 3459 | } |
| 3460 | } |
| 3461 | } |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3462 | skip |= PreCreateGraphicsPipelines(device, pCreateInfos); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3463 | } |
| 3464 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3465 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3466 | result = device_data->dispatch_table.CreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, |
| 3467 | pAllocator, pPipelines); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3468 | validate_result(report_data, "vkCreateGraphicsPipelines", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3469 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3470 | |
| 3471 | return result; |
| 3472 | } |
| 3473 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3474 | bool PreCreateComputePipelines(VkDevice device, const VkComputePipelineCreateInfo *pCreateInfos) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3475 | layer_data *data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3476 | bool skip = false; |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3477 | if (pCreateInfos != nullptr) { |
| 3478 | // TODO: Handle count! |
Dustin Graves | 8ffbbf6 | 2016-07-22 13:19:46 -0600 | [diff] [blame] | 3479 | uint32_t i = 0; |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3480 | skip |= validate_string(data->report_data, "vkCreateComputePipelines", |
| 3481 | ParameterName("pCreateInfos[%i].stage.pName", ParameterName::IndexVector{i}), |
| 3482 | pCreateInfos[i].stage.pName); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3483 | } |
| 3484 | |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3485 | return skip; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3486 | } |
| 3487 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3488 | VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, |
| 3489 | const VkComputePipelineCreateInfo *pCreateInfos, |
| 3490 | const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3491 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3492 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3493 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3494 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3495 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3496 | skip |= parameter_validation_vkCreateComputePipelines(my_data->report_data, pipelineCache, createInfoCount, pCreateInfos, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3497 | pAllocator, pPipelines); |
Mark Lobodzinski | ff6a86c | 2017-02-14 14:30:08 -0700 | [diff] [blame] | 3498 | skip |= PreCreateComputePipelines(device, pCreateInfos); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3499 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3500 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3501 | result = my_data->dispatch_table.CreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, |
| 3502 | pPipelines); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3503 | validate_result(my_data->report_data, "vkCreateComputePipelines", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3504 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3505 | |
| 3506 | return result; |
| 3507 | } |
| 3508 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3509 | 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] | 3510 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3511 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3512 | assert(my_data != NULL); |
| 3513 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3514 | skip |= parameter_validation_vkDestroyPipeline(my_data->report_data, pipeline, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3515 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3516 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3517 | my_data->dispatch_table.DestroyPipeline(device, pipeline, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3518 | } |
| 3519 | } |
| 3520 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3521 | VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, |
| 3522 | const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3523 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3524 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3525 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3526 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3527 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3528 | skip |= parameter_validation_vkCreatePipelineLayout(my_data->report_data, pCreateInfo, pAllocator, pPipelineLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3529 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3530 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3531 | result = my_data->dispatch_table.CreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3532 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3533 | validate_result(my_data->report_data, "vkCreatePipelineLayout", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3534 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3535 | |
| 3536 | return result; |
| 3537 | } |
| 3538 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3539 | VKAPI_ATTR void VKAPI_CALL DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, |
| 3540 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3541 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3542 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3543 | assert(my_data != NULL); |
| 3544 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3545 | skip |= parameter_validation_vkDestroyPipelineLayout(my_data->report_data, pipelineLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3546 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3547 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3548 | my_data->dispatch_table.DestroyPipelineLayout(device, pipelineLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3549 | } |
| 3550 | } |
| 3551 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3552 | VKAPI_ATTR VkResult VKAPI_CALL CreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, |
| 3553 | const VkAllocationCallbacks *pAllocator, VkSampler *pSampler) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3554 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3555 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3556 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3557 | assert(device_data != NULL); |
| 3558 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3559 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3560 | skip |= parameter_validation_vkCreateSampler(report_data, pCreateInfo, pAllocator, pSampler); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3561 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3562 | if (pCreateInfo != nullptr) { |
Mark Lobodzinski | 262f61f | 2017-03-01 15:52:49 -0700 | [diff] [blame] | 3563 | |
| 3564 | if ((device_data->physical_device_features.samplerAnisotropy == false) && (pCreateInfo->maxAnisotropy != 1.0)) { |
| 3565 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3566 | DEVICE_FEATURE, LayerName, |
| 3567 | "vkCreateSampler(): The samplerAnisotropy feature is not enabled, so the maxAnisotropy member of the " |
| 3568 | "VkSamplerCreateInfo structure must be 1.0 but is %f.", |
| 3569 | pCreateInfo->maxAnisotropy); |
| 3570 | } |
| 3571 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3572 | // If compareEnable is VK_TRUE, compareOp must be a valid VkCompareOp value |
| 3573 | if (pCreateInfo->compareEnable == VK_TRUE) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3574 | skip |= validate_ranged_enum(report_data, "vkCreateSampler", "pCreateInfo->compareOp", "VkCompareOp", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3575 | VK_COMPARE_OP_BEGIN_RANGE, VK_COMPARE_OP_END_RANGE, pCreateInfo->compareOp); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3576 | } |
| 3577 | |
| 3578 | // If any of addressModeU, addressModeV or addressModeW are VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, borderColor must be a |
| 3579 | // valid VkBorderColor value |
| 3580 | if ((pCreateInfo->addressModeU == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) || |
| 3581 | (pCreateInfo->addressModeV == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) || |
| 3582 | (pCreateInfo->addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3583 | skip |= validate_ranged_enum(report_data, "vkCreateSampler", "pCreateInfo->borderColor", "VkBorderColor", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3584 | VK_BORDER_COLOR_BEGIN_RANGE, VK_BORDER_COLOR_END_RANGE, pCreateInfo->borderColor); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3585 | } |
| 3586 | } |
| 3587 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3588 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3589 | result = device_data->dispatch_table.CreateSampler(device, pCreateInfo, pAllocator, pSampler); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3590 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3591 | validate_result(report_data, "vkCreateSampler", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3592 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3593 | |
| 3594 | return result; |
| 3595 | } |
| 3596 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3597 | 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] | 3598 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3599 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3600 | assert(my_data != NULL); |
| 3601 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3602 | skip |= parameter_validation_vkDestroySampler(my_data->report_data, sampler, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3603 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3604 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3605 | my_data->dispatch_table.DestroySampler(device, sampler, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3606 | } |
| 3607 | } |
| 3608 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3609 | VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, |
| 3610 | const VkAllocationCallbacks *pAllocator, |
| 3611 | VkDescriptorSetLayout *pSetLayout) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3612 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3613 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3614 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3615 | assert(device_data != nullptr); |
| 3616 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3617 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3618 | skip |= parameter_validation_vkCreateDescriptorSetLayout(report_data, pCreateInfo, pAllocator, pSetLayout); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3619 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3620 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 3621 | if ((pCreateInfo != nullptr) && (pCreateInfo->pBindings != nullptr)) { |
| 3622 | for (uint32_t i = 0; i < pCreateInfo->bindingCount; ++i) { |
| 3623 | if (pCreateInfo->pBindings[i].descriptorCount != 0) { |
| 3624 | // If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and descriptorCount |
| 3625 | // is not 0 and pImmutableSamplers is not NULL, pImmutableSamplers must be a pointer to an array of descriptorCount |
| 3626 | // valid VkSampler handles |
| 3627 | if (((pCreateInfo->pBindings[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER) || |
| 3628 | (pCreateInfo->pBindings[i].descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)) && |
| 3629 | (pCreateInfo->pBindings[i].pImmutableSamplers != nullptr)) { |
| 3630 | for (uint32_t descriptor_index = 0; descriptor_index < pCreateInfo->pBindings[i].descriptorCount; |
| 3631 | ++descriptor_index) { |
| 3632 | if (pCreateInfo->pBindings[i].pImmutableSamplers[descriptor_index] == VK_NULL_HANDLE) { |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 3633 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 3634 | __LINE__, REQUIRED_PARAMETER, LayerName, |
| 3635 | "vkCreateDescriptorSetLayout: required parameter " |
| 3636 | "pCreateInfo->pBindings[%d].pImmutableSamplers[%d]" |
| 3637 | " specified as VK_NULL_HANDLE", |
| 3638 | i, descriptor_index); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3639 | } |
| 3640 | } |
| 3641 | } |
| 3642 | |
| 3643 | // If descriptorCount is not 0, stageFlags must be a valid combination of VkShaderStageFlagBits values |
| 3644 | if ((pCreateInfo->pBindings[i].stageFlags != 0) && |
| 3645 | ((pCreateInfo->pBindings[i].stageFlags & (~AllVkShaderStageFlagBits)) != 0)) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3646 | skip |= log_msg( |
| 3647 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3648 | VALIDATION_ERROR_00853, LayerName, |
| 3649 | "vkCreateDescriptorSetLayout(): if pCreateInfo->pBindings[%d].descriptorCount is not 0, " |
| 3650 | "pCreateInfo->pBindings[%d].stageFlags must be a valid combination of VkShaderStageFlagBits values. %s", |
| 3651 | i, i, validation_error_map[VALIDATION_ERROR_00853]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3652 | } |
| 3653 | } |
| 3654 | } |
| 3655 | } |
| 3656 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3657 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3658 | result = device_data->dispatch_table.CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3659 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3660 | validate_result(report_data, "vkCreateDescriptorSetLayout", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3661 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3662 | |
| 3663 | return result; |
| 3664 | } |
| 3665 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3666 | VKAPI_ATTR void VKAPI_CALL DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, |
| 3667 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3668 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3669 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3670 | assert(my_data != NULL); |
| 3671 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3672 | skip |= parameter_validation_vkDestroyDescriptorSetLayout(my_data->report_data, descriptorSetLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3673 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3674 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3675 | my_data->dispatch_table.DestroyDescriptorSetLayout(device, descriptorSetLayout, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3676 | } |
| 3677 | } |
| 3678 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3679 | VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, |
| 3680 | const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3681 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3682 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3683 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3684 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3685 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3686 | skip |= parameter_validation_vkCreateDescriptorPool(my_data->report_data, pCreateInfo, pAllocator, pDescriptorPool); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3687 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3688 | /* TODOVV: How do we validate maxSets? Probably belongs in the limits layer? */ |
| 3689 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3690 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3691 | result = my_data->dispatch_table.CreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3692 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3693 | validate_result(my_data->report_data, "vkCreateDescriptorPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3694 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3695 | |
| 3696 | return result; |
| 3697 | } |
| 3698 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3699 | VKAPI_ATTR void VKAPI_CALL DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, |
| 3700 | const VkAllocationCallbacks *pAllocator) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3701 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3702 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3703 | assert(my_data != NULL); |
| 3704 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3705 | skip |= parameter_validation_vkDestroyDescriptorPool(my_data->report_data, descriptorPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3706 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3707 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3708 | my_data->dispatch_table.DestroyDescriptorPool(device, descriptorPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3709 | } |
| 3710 | } |
| 3711 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3712 | VKAPI_ATTR VkResult VKAPI_CALL ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, |
| 3713 | VkDescriptorPoolResetFlags flags) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3714 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3715 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3716 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3717 | assert(my_data != NULL); |
| 3718 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3719 | skip |= parameter_validation_vkResetDescriptorPool(my_data->report_data, descriptorPool, flags); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3720 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3721 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3722 | result = my_data->dispatch_table.ResetDescriptorPool(device, descriptorPool, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 3723 | |
| 3724 | validate_result(my_data->report_data, "vkResetDescriptorPool", result); |
| 3725 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3726 | |
| 3727 | return result; |
| 3728 | } |
| 3729 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3730 | VKAPI_ATTR VkResult VKAPI_CALL AllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, |
| 3731 | VkDescriptorSet *pDescriptorSets) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3732 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3733 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3734 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3735 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3736 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3737 | skip |= parameter_validation_vkAllocateDescriptorSets(my_data->report_data, pAllocateInfo, pDescriptorSets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3738 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3739 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3740 | result = my_data->dispatch_table.AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3741 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3742 | validate_result(my_data->report_data, "vkAllocateDescriptorSets", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3743 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3744 | |
| 3745 | return result; |
| 3746 | } |
| 3747 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3748 | 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] | 3749 | const VkDescriptorSet *pDescriptorSets) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3750 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3751 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3752 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3753 | assert(device_data != nullptr); |
| 3754 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3755 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3756 | skip |= parameter_validation_vkFreeDescriptorSets(report_data, descriptorPool, descriptorSetCount, pDescriptorSets); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3757 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3758 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 3759 | // This is an array of handles, where the elements are allowed to be VK_NULL_HANDLE, and does not require any validation beyond |
| 3760 | // validate_array() |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3761 | skip |= validate_array(report_data, "vkFreeDescriptorSets", "descriptorSetCount", "pDescriptorSets", descriptorSetCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3762 | pDescriptorSets, true, true); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3763 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3764 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3765 | result = device_data->dispatch_table.FreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3766 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3767 | validate_result(report_data, "vkFreeDescriptorSets", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3768 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3769 | |
| 3770 | return result; |
| 3771 | } |
| 3772 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3773 | VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, |
| 3774 | const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, |
| 3775 | const VkCopyDescriptorSet *pDescriptorCopies) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3776 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3777 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3778 | assert(device_data != NULL); |
| 3779 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 3780 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3781 | skip |= parameter_validation_vkUpdateDescriptorSets(report_data, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, |
| 3782 | pDescriptorCopies); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3783 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3784 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 3785 | if (pDescriptorWrites != NULL) { |
| 3786 | for (uint32_t i = 0; i < descriptorWriteCount; ++i) { |
| 3787 | // descriptorCount must be greater than 0 |
| 3788 | if (pDescriptorWrites[i].descriptorCount == 0) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3789 | skip |= |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3790 | 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] | 3791 | VALIDATION_ERROR_00957, LayerName, |
| 3792 | "vkUpdateDescriptorSets(): parameter pDescriptorWrites[%d].descriptorCount must be greater than 0. %s", |
| 3793 | i, validation_error_map[VALIDATION_ERROR_00957]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3794 | } |
| 3795 | |
Dustin Graves | ce68f08 | 2017-03-30 15:42:16 -0600 | [diff] [blame] | 3796 | // dstSet must be a valid VkDescriptorSet handle |
| 3797 | skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", |
| 3798 | ParameterName("pDescriptorWrites[%i].dstSet", ParameterName::IndexVector{i}), |
| 3799 | pDescriptorWrites[i].dstSet); |
| 3800 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3801 | if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER) || |
| 3802 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) || |
| 3803 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) || |
| 3804 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) || |
| 3805 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT)) { |
| 3806 | // If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, |
| 3807 | // VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, |
| 3808 | // pImageInfo must be a pointer to an array of descriptorCount valid VkDescriptorImageInfo structures |
| 3809 | if (pDescriptorWrites[i].pImageInfo == nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3810 | 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] | 3811 | __LINE__, VALIDATION_ERROR_00939, LayerName, |
| 3812 | "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " |
| 3813 | "VK_DESCRIPTOR_TYPE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, " |
| 3814 | "VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or " |
| 3815 | "VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, pDescriptorWrites[%d].pImageInfo must not be NULL. %s", |
| 3816 | i, i, validation_error_map[VALIDATION_ERROR_00939]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3817 | } else if (pDescriptorWrites[i].descriptorType != VK_DESCRIPTOR_TYPE_SAMPLER) { |
| 3818 | // If descriptorType is VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, |
| 3819 | // VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the imageView and imageLayout |
| 3820 | // members of any given element of pImageInfo must be a valid VkImageView and VkImageLayout, respectively |
| 3821 | for (uint32_t descriptor_index = 0; descriptor_index < pDescriptorWrites[i].descriptorCount; |
| 3822 | ++descriptor_index) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3823 | skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3824 | ParameterName("pDescriptorWrites[%i].pImageInfo[%i].imageView", |
| 3825 | ParameterName::IndexVector{i, descriptor_index}), |
| 3826 | pDescriptorWrites[i].pImageInfo[descriptor_index].imageView); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3827 | skip |= validate_ranged_enum(report_data, "vkUpdateDescriptorSets", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3828 | ParameterName("pDescriptorWrites[%i].pImageInfo[%i].imageLayout", |
| 3829 | ParameterName::IndexVector{i, descriptor_index}), |
| 3830 | "VkImageLayout", VK_IMAGE_LAYOUT_BEGIN_RANGE, VK_IMAGE_LAYOUT_END_RANGE, |
| 3831 | pDescriptorWrites[i].pImageInfo[descriptor_index].imageLayout); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3832 | } |
| 3833 | } |
| 3834 | } else if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) || |
| 3835 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) || |
| 3836 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) || |
| 3837 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) { |
| 3838 | // If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 3839 | // VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, pBufferInfo must be a |
| 3840 | // pointer to an array of descriptorCount valid VkDescriptorBufferInfo structures |
| 3841 | if (pDescriptorWrites[i].pBufferInfo == nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3842 | 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] | 3843 | __LINE__, VALIDATION_ERROR_00941, LayerName, |
| 3844 | "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " |
| 3845 | "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, " |
| 3846 | "VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, " |
| 3847 | "pDescriptorWrites[%d].pBufferInfo must not be NULL. %s", |
| 3848 | i, i, validation_error_map[VALIDATION_ERROR_00941]); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3849 | } else { |
| 3850 | for (uint32_t descriptorIndex = 0; descriptorIndex < pDescriptorWrites[i].descriptorCount; ++descriptorIndex) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3851 | skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3852 | ParameterName("pDescriptorWrites[%i].pBufferInfo[%i].buffer", |
| 3853 | ParameterName::IndexVector{i, descriptorIndex}), |
| 3854 | pDescriptorWrites[i].pBufferInfo[descriptorIndex].buffer); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 3855 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3856 | } |
| 3857 | } else if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) || |
| 3858 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER)) { |
| 3859 | // If descriptorType is VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, |
| 3860 | // pTexelBufferView must be a pointer to an array of descriptorCount valid VkBufferView handles |
| 3861 | if (pDescriptorWrites[i].pTexelBufferView == nullptr) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3862 | 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] | 3863 | __LINE__, VALIDATION_ERROR_00940, LayerName, |
| 3864 | "vkUpdateDescriptorSets(): if pDescriptorWrites[%d].descriptorType is " |
| 3865 | "VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, " |
| 3866 | "pDescriptorWrites[%d].pTexelBufferView must not be NULL. %s", |
| 3867 | i, i, validation_error_map[VALIDATION_ERROR_00940]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3868 | } else { |
| 3869 | for (uint32_t descriptor_index = 0; descriptor_index < pDescriptorWrites[i].descriptorCount; |
| 3870 | ++descriptor_index) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3871 | skip |= validate_required_handle(report_data, "vkUpdateDescriptorSets", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3872 | ParameterName("pDescriptorWrites[%i].pTexelBufferView[%i]", |
| 3873 | ParameterName::IndexVector{i, descriptor_index}), |
| 3874 | pDescriptorWrites[i].pTexelBufferView[descriptor_index]); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3875 | } |
| 3876 | } |
| 3877 | } |
Mark Lobodzinski | 1a34d7e | 2016-06-28 11:51:16 -0600 | [diff] [blame] | 3878 | |
| 3879 | if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) || |
| 3880 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC)) { |
| 3881 | VkDeviceSize uniformAlignment = device_data->device_limits.minUniformBufferOffsetAlignment; |
| 3882 | for (uint32_t j = 0; j < pDescriptorWrites[i].descriptorCount; j++) { |
| 3883 | if (pDescriptorWrites[i].pBufferInfo != NULL) { |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 3884 | if (SafeModulo(pDescriptorWrites[i].pBufferInfo[j].offset, uniformAlignment) != 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3885 | skip |= log_msg( |
| 3886 | device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, |
| 3887 | VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, VALIDATION_ERROR_00944, LayerName, |
| 3888 | "vkUpdateDescriptorSets(): pDescriptorWrites[%d].pBufferInfo[%d].offset (0x%" PRIxLEAST64 |
| 3889 | ") must be a multiple of device limit minUniformBufferOffsetAlignment 0x%" PRIxLEAST64 ". %s", |
| 3890 | i, j, pDescriptorWrites[i].pBufferInfo[j].offset, uniformAlignment, |
| 3891 | validation_error_map[VALIDATION_ERROR_00944]); |
Mark Lobodzinski | 1a34d7e | 2016-06-28 11:51:16 -0600 | [diff] [blame] | 3892 | } |
| 3893 | } |
| 3894 | } |
| 3895 | } else if ((pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) || |
| 3896 | (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)) { |
| 3897 | VkDeviceSize storageAlignment = device_data->device_limits.minStorageBufferOffsetAlignment; |
| 3898 | for (uint32_t j = 0; j < pDescriptorWrites[i].descriptorCount; j++) { |
| 3899 | if (pDescriptorWrites[i].pBufferInfo != NULL) { |
Dave Houlton | 1d2022c | 2017-03-29 11:43:58 -0600 | [diff] [blame] | 3900 | if (SafeModulo(pDescriptorWrites[i].pBufferInfo[j].offset, storageAlignment) != 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3901 | skip |= log_msg( |
| 3902 | device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, |
| 3903 | VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, VALIDATION_ERROR_00945, LayerName, |
| 3904 | "vkUpdateDescriptorSets(): pDescriptorWrites[%d].pBufferInfo[%d].offset (0x%" PRIxLEAST64 |
| 3905 | ") must be a multiple of device limit minStorageBufferOffsetAlignment 0x%" PRIxLEAST64 ". %s", |
| 3906 | i, j, pDescriptorWrites[i].pBufferInfo[j].offset, storageAlignment, |
| 3907 | validation_error_map[VALIDATION_ERROR_00945]); |
Mark Lobodzinski | 1a34d7e | 2016-06-28 11:51:16 -0600 | [diff] [blame] | 3908 | } |
| 3909 | } |
| 3910 | } |
| 3911 | } |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 3912 | } |
| 3913 | } |
| 3914 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3915 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 3916 | device_data->dispatch_table.UpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, |
| 3917 | pDescriptorCopies); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3918 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 3919 | } |
| 3920 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3921 | VKAPI_ATTR VkResult VKAPI_CALL CreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3922 | const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3923 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3924 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3925 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3926 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3927 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3928 | skip |= parameter_validation_vkCreateFramebuffer(my_data->report_data, pCreateInfo, pAllocator, pFramebuffer); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3929 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3930 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3931 | result = my_data->dispatch_table.CreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3932 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3933 | validate_result(my_data->report_data, "vkCreateFramebuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3934 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3935 | |
| 3936 | return result; |
| 3937 | } |
| 3938 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3939 | 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] | 3940 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3941 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3942 | assert(my_data != NULL); |
| 3943 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3944 | skip |= parameter_validation_vkDestroyFramebuffer(my_data->report_data, framebuffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3945 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3946 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3947 | my_data->dispatch_table.DestroyFramebuffer(device, framebuffer, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3948 | } |
| 3949 | } |
| 3950 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 3951 | static bool PreCreateRenderPass(layer_data *dev_data, const VkRenderPassCreateInfo *pCreateInfo) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3952 | bool skip = false; |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3953 | uint32_t max_color_attachments = dev_data->device_limits.maxColorAttachments; |
| 3954 | |
Mark Lobodzinski | e907fe4 | 2017-01-27 14:50:23 -0700 | [diff] [blame] | 3955 | for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) { |
| 3956 | if (pCreateInfo->pAttachments[i].format == VK_FORMAT_UNDEFINED) { |
| 3957 | std::stringstream ss; |
| 3958 | ss << "vkCreateRenderPass: pCreateInfo->pAttachments[" << i << "].format is VK_FORMAT_UNDEFINED. " |
| 3959 | << validation_error_map[VALIDATION_ERROR_00336]; |
Jeremy Hayes | 632e0ab | 2017-02-09 13:32:28 -0700 | [diff] [blame] | 3960 | skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
Mark Lobodzinski | e907fe4 | 2017-01-27 14:50:23 -0700 | [diff] [blame] | 3961 | VALIDATION_ERROR_00336, "IMAGE", "%s", ss.str().c_str()); |
| 3962 | } |
| 3963 | } |
| 3964 | |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3965 | for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { |
| 3966 | if (pCreateInfo->pSubpasses[i].colorAttachmentCount > max_color_attachments) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 3967 | skip |= |
| 3968 | log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 3969 | VALIDATION_ERROR_00348, "DL", "Cannot create a render pass with %d color attachments. Max is %d. %s", |
| 3970 | pCreateInfo->pSubpasses[i].colorAttachmentCount, max_color_attachments, |
| 3971 | validation_error_map[VALIDATION_ERROR_00348]); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3972 | } |
| 3973 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3974 | return skip; |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 3975 | } |
| 3976 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 3977 | VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3978 | const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 3979 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3980 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3981 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3982 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3983 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3984 | skip |= parameter_validation_vkCreateRenderPass(my_data->report_data, pCreateInfo, pAllocator, pRenderPass); |
| 3985 | skip |= PreCreateRenderPass(my_data, pCreateInfo); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3986 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 3987 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 3988 | result = my_data->dispatch_table.CreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3989 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 3990 | validate_result(my_data->report_data, "vkCreateRenderPass", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 3991 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 3992 | |
| 3993 | return result; |
| 3994 | } |
| 3995 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 3996 | 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] | 3997 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 3998 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 3999 | assert(my_data != NULL); |
| 4000 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4001 | skip |= parameter_validation_vkDestroyRenderPass(my_data->report_data, renderPass, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 4002 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4003 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4004 | my_data->dispatch_table.DestroyRenderPass(device, renderPass, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 4005 | } |
| 4006 | } |
| 4007 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4008 | VKAPI_ATTR void VKAPI_CALL GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4009 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4010 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4011 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4012 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4013 | skip |= parameter_validation_vkGetRenderAreaGranularity(my_data->report_data, renderPass, pGranularity); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4014 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4015 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4016 | my_data->dispatch_table.GetRenderAreaGranularity(device, renderPass, pGranularity); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4017 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4018 | } |
| 4019 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4020 | VKAPI_ATTR VkResult VKAPI_CALL CreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4021 | const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4022 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4023 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4024 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4025 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4026 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4027 | skip |= |
Dustin Graves | de62853 | 2016-04-21 16:30:17 -0600 | [diff] [blame] | 4028 | validate_queue_family_index(my_data, "vkCreateCommandPool", "pCreateInfo->queueFamilyIndex", pCreateInfo->queueFamilyIndex); |
Mark Lobodzinski | f20f094 | 2016-03-22 10:07:26 -0600 | [diff] [blame] | 4029 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4030 | skip |= parameter_validation_vkCreateCommandPool(my_data->report_data, pCreateInfo, pAllocator, pCommandPool); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4031 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4032 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4033 | result = my_data->dispatch_table.CreateCommandPool(device, pCreateInfo, pAllocator, pCommandPool); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4034 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4035 | validate_result(my_data->report_data, "vkCreateCommandPool", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4036 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4037 | |
| 4038 | return result; |
| 4039 | } |
| 4040 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4041 | 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] | 4042 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4043 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 4044 | assert(my_data != NULL); |
| 4045 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4046 | skip |= parameter_validation_vkDestroyCommandPool(my_data->report_data, commandPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 4047 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4048 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4049 | my_data->dispatch_table.DestroyCommandPool(device, commandPool, pAllocator); |
Dustin Graves | 27a912a | 2016-03-07 17:52:14 -0700 | [diff] [blame] | 4050 | } |
| 4051 | } |
| 4052 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4053 | VKAPI_ATTR VkResult VKAPI_CALL ResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) { |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4054 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4055 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4056 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4057 | assert(my_data != NULL); |
| 4058 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4059 | skip |= parameter_validation_vkResetCommandPool(my_data->report_data, commandPool, flags); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4060 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4061 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4062 | result = my_data->dispatch_table.ResetCommandPool(device, commandPool, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4063 | |
| 4064 | validate_result(my_data->report_data, "vkResetCommandPool", result); |
| 4065 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4066 | |
| 4067 | return result; |
| 4068 | } |
| 4069 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4070 | VKAPI_ATTR VkResult VKAPI_CALL AllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, |
| 4071 | VkCommandBuffer *pCommandBuffers) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4072 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4073 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4074 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4075 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4076 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4077 | skip |= parameter_validation_vkAllocateCommandBuffers(my_data->report_data, pAllocateInfo, pCommandBuffers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4078 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4079 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4080 | result = my_data->dispatch_table.AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4081 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4082 | validate_result(my_data->report_data, "vkAllocateCommandBuffers", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4083 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4084 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4085 | return result; |
| 4086 | } |
| 4087 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4088 | 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] | 4089 | const VkCommandBuffer *pCommandBuffers) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4090 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4091 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4092 | assert(device_data != nullptr); |
| 4093 | debug_report_data *report_data = device_data->report_data; |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 4094 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4095 | skip |= parameter_validation_vkFreeCommandBuffers(report_data, commandPool, commandBufferCount, pCommandBuffers); |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 4096 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4097 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 4098 | // This is an array of handles, where the elements are allowed to be VK_NULL_HANDLE, and does not require any validation beyond |
| 4099 | // validate_array() |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4100 | skip |= validate_array(report_data, "vkFreeCommandBuffers", "commandBufferCount", "pCommandBuffers", commandBufferCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4101 | pCommandBuffers, true, true); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4102 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4103 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4104 | device_data->dispatch_table.FreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers); |
Dustin Graves | a2b2e46 | 2016-02-26 11:53:28 -0700 | [diff] [blame] | 4105 | } |
| 4106 | } |
| 4107 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4108 | static bool PreBeginCommandBuffer(layer_data *dev_data, VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4109 | bool skip = false; |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 4110 | const VkCommandBufferInheritanceInfo *pInfo = pBeginInfo->pInheritanceInfo; |
| 4111 | |
| 4112 | if (pInfo != NULL) { |
Chris Forbes | c5554a5 | 2016-11-24 14:45:16 +1300 | [diff] [blame] | 4113 | 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] | 4114 | skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, |
| 4115 | reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00116, LayerName, |
| 4116 | "Cannot set inherited occlusionQueryEnable in vkBeginCommandBuffer() when device does not support " |
| 4117 | "inheritedQueries. %s", |
| 4118 | validation_error_map[VALIDATION_ERROR_00116]); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 4119 | } |
Mark Lobodzinski | 38df456 | 2016-12-15 13:06:55 -0700 | [diff] [blame] | 4120 | // VALIDATION_ERROR_00117 check |
| 4121 | if ((dev_data->physical_device_features.inheritedQueries != VK_FALSE) && (pInfo->occlusionQueryEnable != VK_FALSE)) { |
| 4122 | skip |= validate_flags(dev_data->report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->queryFlags", |
| 4123 | "VkQueryControlFlagBits", AllVkQueryControlFlagBits, pInfo->queryFlags, false); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 4124 | } |
| 4125 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4126 | return skip; |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 4127 | } |
| 4128 | |
| 4129 | VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo) { |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4130 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4131 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4132 | layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4133 | assert(device_data != nullptr); |
| 4134 | debug_report_data *report_data = device_data->report_data; |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4135 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4136 | skip |= parameter_validation_vkBeginCommandBuffer(report_data, pBeginInfo); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4137 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4138 | // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml |
| 4139 | // 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] | 4140 | skip |= validate_struct_type(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4141 | "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO", pBeginInfo->pInheritanceInfo, |
| 4142 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO, false); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4143 | |
| 4144 | if (pBeginInfo->pInheritanceInfo != NULL) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4145 | skip |= validate_struct_pnext(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->pNext", NULL, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4146 | pBeginInfo->pInheritanceInfo->pNext, 0, NULL, GeneratedHeaderVersion); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 4147 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4148 | skip |= validate_bool32(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->occlusionQueryEnable", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4149 | pBeginInfo->pInheritanceInfo->occlusionQueryEnable); |
Dustin Graves | 629259b | 2016-05-30 16:14:27 -0600 | [diff] [blame] | 4150 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4151 | // 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] | 4152 | // skip |= validate_flags(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->queryFlags", |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4153 | // "VkQueryControlFlagBits", AllVkQueryControlFlagBits, pBeginInfo->pInheritanceInfo->queryFlags, false); |
| 4154 | |
| 4155 | // 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] | 4156 | skip |= validate_flags(report_data, "vkBeginCommandBuffer", "pBeginInfo->pInheritanceInfo->pipelineStatistics", |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4157 | "VkQueryPipelineStatisticFlagBits", AllVkQueryPipelineStatisticFlagBits, |
| 4158 | pBeginInfo->pInheritanceInfo->pipelineStatistics, false); |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4159 | } |
| 4160 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4161 | skip |= PreBeginCommandBuffer(device_data, commandBuffer, pBeginInfo); |
Mark Lobodzinski | 4dc6cb0 | 2016-06-28 11:23:08 -0600 | [diff] [blame] | 4162 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4163 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4164 | result = device_data->dispatch_table.BeginCommandBuffer(commandBuffer, pBeginInfo); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4165 | |
Dustin Graves | c900f57 | 2016-05-16 11:07:59 -0600 | [diff] [blame] | 4166 | validate_result(report_data, "vkBeginCommandBuffer", result); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4167 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4168 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4169 | return result; |
| 4170 | } |
| 4171 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4172 | VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer(VkCommandBuffer commandBuffer) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4173 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4174 | assert(my_data != NULL); |
| 4175 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4176 | VkResult result = my_data->dispatch_table.EndCommandBuffer(commandBuffer); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4177 | |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4178 | validate_result(my_data->report_data, "vkEndCommandBuffer", result); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4179 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4180 | return result; |
| 4181 | } |
| 4182 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4183 | VKAPI_ATTR VkResult VKAPI_CALL ResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) { |
Dustin Graves | 16d1897 | 2016-05-09 17:36:57 -0600 | [diff] [blame] | 4184 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4185 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | ca7aa7c | 2016-03-25 15:13:28 -0600 | [diff] [blame] | 4186 | assert(my_data != NULL); |
| 4187 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4188 | bool skip = parameter_validation_vkResetCommandBuffer(my_data->report_data, flags); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4189 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4190 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4191 | result = my_data->dispatch_table.ResetCommandBuffer(commandBuffer, flags); |
Dustin Graves | 16d1897 | 2016-05-09 17:36:57 -0600 | [diff] [blame] | 4192 | |
| 4193 | validate_result(my_data->report_data, "vkResetCommandBuffer", result); |
| 4194 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4195 | |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4196 | return result; |
| 4197 | } |
| 4198 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4199 | VKAPI_ATTR void VKAPI_CALL CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, |
| 4200 | VkPipeline pipeline) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4201 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4202 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4203 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4204 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4205 | skip |= parameter_validation_vkCmdBindPipeline(my_data->report_data, pipelineBindPoint, pipeline); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4206 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4207 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4208 | my_data->dispatch_table.CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4209 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4210 | } |
| 4211 | |
Mark Lobodzinski | 147e692 | 2017-03-01 15:45:52 -0700 | [diff] [blame] | 4212 | 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] | 4213 | debug_report_data *report_data = my_data->report_data; |
| 4214 | |
Mark Lobodzinski | 5a24296 | 2016-10-28 12:57:23 -0600 | [diff] [blame] | 4215 | bool skip = |
| 4216 | validate_array(report_data, "vkCmdSetViewport", "viewportCount", "pViewports", viewport_count, viewports, true, true); |
Mike Weiblen | 2906c9a | 2016-10-31 21:04:10 -0600 | [diff] [blame] | 4217 | |
| 4218 | if (viewport_count > 0 && viewports != nullptr) { |
| 4219 | const VkPhysicalDeviceLimits &limits = my_data->device_limits; |
| 4220 | for (uint32_t viewportIndex = 0; viewportIndex < viewport_count; ++viewportIndex) { |
| 4221 | const VkViewport &viewport = viewports[viewportIndex]; |
| 4222 | |
Mark Lobodzinski | 147e692 | 2017-03-01 15:45:52 -0700 | [diff] [blame] | 4223 | if (my_data->physical_device_features.multiViewport == false) { |
| 4224 | if (viewport_count != 1) { |
| 4225 | skip |= log_msg( |
| 4226 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4227 | DEVICE_FEATURE, LayerName, |
| 4228 | "vkCmdSetViewport(): The multiViewport feature is not enabled, so viewportCount must be 1 but is %d.", |
| 4229 | viewport_count); |
| 4230 | } |
| 4231 | if (first_viewport != 0) { |
| 4232 | skip |= log_msg( |
| 4233 | report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4234 | DEVICE_FEATURE, LayerName, |
| 4235 | "vkCmdSetViewport(): The multiViewport feature is not enabled, so firstViewport must be 0 but is %d.", |
| 4236 | first_viewport); |
| 4237 | } |
| 4238 | } |
| 4239 | |
Mike Weiblen | 2906c9a | 2016-10-31 21:04:10 -0600 | [diff] [blame] | 4240 | if (viewport.width <= 0 || viewport.width > limits.maxViewportDimensions[0]) { |
| 4241 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4242 | VALIDATION_ERROR_01448, LayerName, |
| 4243 | "vkCmdSetViewport %d: width (%f) exceeds permitted bounds (0,%u). %s", viewportIndex, |
| 4244 | viewport.width, limits.maxViewportDimensions[0], validation_error_map[VALIDATION_ERROR_01448]); |
| 4245 | } |
| 4246 | |
| 4247 | bool invalid_height = (viewport.height <= 0 || viewport.height > limits.maxViewportDimensions[1]); |
Mark Lobodzinski | 885790e | 2017-03-09 11:54:48 -0700 | [diff] [blame] | 4248 | 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] | 4249 | // VALIDATION_ERROR_01790 |
| 4250 | invalid_height = false; |
| 4251 | } |
| 4252 | if (invalid_height) { |
| 4253 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4254 | VALIDATION_ERROR_01449, LayerName, |
| 4255 | "vkCmdSetViewport %d: height (%f) exceeds permitted bounds (0,%u). %s", viewportIndex, |
| 4256 | viewport.height, limits.maxViewportDimensions[1], validation_error_map[VALIDATION_ERROR_01449]); |
| 4257 | } |
| 4258 | |
| 4259 | if (viewport.x < limits.viewportBoundsRange[0] || viewport.x > limits.viewportBoundsRange[1]) { |
| 4260 | skip |= |
| 4261 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4262 | VALIDATION_ERROR_01450, LayerName, "vkCmdSetViewport %d: x (%f) exceeds permitted bounds (%f,%f). %s", |
| 4263 | viewportIndex, viewport.x, limits.viewportBoundsRange[0], limits.viewportBoundsRange[1], |
| 4264 | validation_error_map[VALIDATION_ERROR_01450]); |
| 4265 | } |
| 4266 | |
| 4267 | if (viewport.y < limits.viewportBoundsRange[0] || viewport.y > limits.viewportBoundsRange[1]) { |
| 4268 | skip |= |
| 4269 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4270 | VALIDATION_ERROR_01450, LayerName, "vkCmdSetViewport %d: y (%f) exceeds permitted bounds (%f,%f). %s", |
| 4271 | viewportIndex, viewport.y, limits.viewportBoundsRange[0], limits.viewportBoundsRange[1], |
| 4272 | validation_error_map[VALIDATION_ERROR_01450]); |
| 4273 | } |
| 4274 | |
| 4275 | if (viewport.x + viewport.width > limits.viewportBoundsRange[1]) { |
| 4276 | skip |= |
| 4277 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4278 | VALIDATION_ERROR_01451, LayerName, |
| 4279 | "vkCmdSetViewport %d: x (%f) + width (%f) exceeds permitted bound (%f). %s", viewportIndex, viewport.x, |
| 4280 | viewport.width, limits.viewportBoundsRange[1], validation_error_map[VALIDATION_ERROR_01451]); |
| 4281 | } |
| 4282 | |
| 4283 | if (viewport.y + viewport.height > limits.viewportBoundsRange[1]) { |
| 4284 | skip |= |
| 4285 | log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4286 | VALIDATION_ERROR_01452, LayerName, |
| 4287 | "vkCmdSetViewport %d: y (%f) + height (%f) exceeds permitted bound (%f). %s", viewportIndex, viewport.y, |
| 4288 | viewport.height, limits.viewportBoundsRange[1], validation_error_map[VALIDATION_ERROR_01452]); |
| 4289 | } |
| 4290 | } |
| 4291 | } |
| 4292 | |
Mark Lobodzinski | 5a24296 | 2016-10-28 12:57:23 -0600 | [diff] [blame] | 4293 | return skip; |
| 4294 | } |
| 4295 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4296 | VKAPI_ATTR void VKAPI_CALL CmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, |
| 4297 | const VkViewport *pViewports) { |
Mark Lobodzinski | b79b773 | 2016-10-28 12:59:47 -0600 | [diff] [blame] | 4298 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4299 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4300 | assert(my_data != NULL); |
| 4301 | |
Mark Lobodzinski | 147e692 | 2017-03-01 15:45:52 -0700 | [diff] [blame] | 4302 | skip |= preCmdSetViewport(my_data, firstViewport, viewportCount, pViewports); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4303 | |
Mark Lobodzinski | b79b773 | 2016-10-28 12:59:47 -0600 | [diff] [blame] | 4304 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4305 | my_data->dispatch_table.CmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4306 | } |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 4307 | } |
| 4308 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4309 | VKAPI_ATTR void VKAPI_CALL CmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, |
| 4310 | const VkRect2D *pScissors) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4311 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4312 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4313 | assert(my_data != NULL); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4314 | debug_report_data *report_data = my_data->report_data; |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4315 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4316 | skip |= parameter_validation_vkCmdSetScissor(my_data->report_data, firstScissor, scissorCount, pScissors); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4317 | |
Mark Lobodzinski | 147e692 | 2017-03-01 15:45:52 -0700 | [diff] [blame] | 4318 | if (my_data->physical_device_features.multiViewport == false) { |
| 4319 | if (scissorCount != 1) { |
| 4320 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4321 | DEVICE_FEATURE, LayerName, |
| 4322 | "vkCmdSetScissor(): The multiViewport feature is not enabled, so scissorCount must be 1 but is %d.", |
| 4323 | scissorCount); |
| 4324 | } |
| 4325 | if (firstScissor != 0) { |
| 4326 | skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4327 | DEVICE_FEATURE, LayerName, |
| 4328 | "vkCmdSetScissor(): The multiViewport feature is not enabled, so firstScissor must be 0 but is %d.", |
| 4329 | firstScissor); |
| 4330 | } |
| 4331 | } |
| 4332 | |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4333 | for (uint32_t scissorIndex = 0; scissorIndex < scissorCount; ++scissorIndex) { |
| 4334 | const VkRect2D &pScissor = pScissors[scissorIndex]; |
| 4335 | |
| 4336 | if (pScissor.offset.x < 0) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4337 | 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] | 4338 | VALIDATION_ERROR_01489, LayerName, "vkCmdSetScissor %d: offset.x (%d) must not be negative. %s", |
| 4339 | scissorIndex, pScissor.offset.x, validation_error_map[VALIDATION_ERROR_01489]); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4340 | } 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] | 4341 | 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] | 4342 | VALIDATION_ERROR_01490, LayerName, |
| 4343 | "vkCmdSetScissor %d: adding offset.x (%d) and extent.width (%u) will overflow. %s", scissorIndex, |
| 4344 | pScissor.offset.x, pScissor.extent.width, validation_error_map[VALIDATION_ERROR_01490]); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4345 | } |
| 4346 | |
| 4347 | if (pScissor.offset.y < 0) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4348 | 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] | 4349 | VALIDATION_ERROR_01489, LayerName, "vkCmdSetScissor %d: offset.y (%d) must not be negative. %s", |
| 4350 | scissorIndex, pScissor.offset.y, validation_error_map[VALIDATION_ERROR_01489]); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4351 | } 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] | 4352 | 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] | 4353 | VALIDATION_ERROR_01491, LayerName, |
| 4354 | "vkCmdSetScissor %d: adding offset.y (%d) and extent.height (%u) will overflow. %s", scissorIndex, |
| 4355 | pScissor.offset.y, pScissor.extent.height, validation_error_map[VALIDATION_ERROR_01491]); |
Mike Weiblen | a4742dc | 2016-10-31 11:05:56 -0600 | [diff] [blame] | 4356 | } |
| 4357 | } |
| 4358 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4359 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4360 | my_data->dispatch_table.CmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4361 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4362 | } |
| 4363 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4364 | VKAPI_ATTR void VKAPI_CALL CmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4365 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4366 | my_data->dispatch_table.CmdSetLineWidth(commandBuffer, lineWidth); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4367 | } |
| 4368 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4369 | VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, |
| 4370 | float depthBiasSlopeFactor) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4371 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4372 | my_data->dispatch_table.CmdSetDepthBias(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4373 | } |
| 4374 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4375 | VKAPI_ATTR void VKAPI_CALL CmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4376 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4377 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4378 | assert(my_data != NULL); |
| 4379 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4380 | skip |= parameter_validation_vkCmdSetBlendConstants(my_data->report_data, blendConstants); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4381 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4382 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4383 | my_data->dispatch_table.CmdSetBlendConstants(commandBuffer, blendConstants); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4384 | } |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 4385 | } |
| 4386 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4387 | VKAPI_ATTR void VKAPI_CALL CmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4388 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4389 | my_data->dispatch_table.CmdSetDepthBounds(commandBuffer, minDepthBounds, maxDepthBounds); |
Cody Northrop | 1236511 | 2015-08-17 11:10:49 -0600 | [diff] [blame] | 4390 | } |
| 4391 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4392 | VKAPI_ATTR void VKAPI_CALL CmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, |
| 4393 | uint32_t compareMask) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4394 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4395 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4396 | assert(my_data != NULL); |
| 4397 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4398 | skip |= parameter_validation_vkCmdSetStencilCompareMask(my_data->report_data, faceMask, compareMask); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4399 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4400 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4401 | my_data->dispatch_table.CmdSetStencilCompareMask(commandBuffer, faceMask, compareMask); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4402 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4403 | } |
| 4404 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4405 | 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] | 4406 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4407 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4408 | assert(my_data != NULL); |
| 4409 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4410 | skip |= parameter_validation_vkCmdSetStencilWriteMask(my_data->report_data, faceMask, writeMask); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4411 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4412 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4413 | my_data->dispatch_table.CmdSetStencilWriteMask(commandBuffer, faceMask, writeMask); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4414 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4415 | } |
| 4416 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4417 | 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] | 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 | 46948e6 | 2016-05-06 10:16:06 -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_vkCmdSetStencilReference(my_data->report_data, faceMask, reference); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -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.CmdSetStencilReference(commandBuffer, faceMask, reference); |
Dustin Graves | 46948e6 | 2016-05-06 10:16:06 -0600 | [diff] [blame] | 4426 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4427 | } |
| 4428 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4429 | VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, |
| 4430 | VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, |
| 4431 | const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, |
| 4432 | const uint32_t *pDynamicOffsets) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4433 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4434 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4435 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4436 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4437 | skip |= parameter_validation_vkCmdBindDescriptorSets(my_data->report_data, pipelineBindPoint, layout, firstSet, |
| 4438 | descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4439 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4440 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4441 | my_data->dispatch_table.CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, |
| 4442 | pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4443 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4444 | } |
| 4445 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4446 | VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 4447 | VkIndexType indexType) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4448 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4449 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4450 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4451 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4452 | skip |= parameter_validation_vkCmdBindIndexBuffer(my_data->report_data, buffer, offset, indexType); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4453 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4454 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4455 | my_data->dispatch_table.CmdBindIndexBuffer(commandBuffer, buffer, offset, indexType); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 4456 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4457 | } |
| 4458 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4459 | VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, |
| 4460 | const VkBuffer *pBuffers, const VkDeviceSize *pOffsets) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4461 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4462 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4463 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4464 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4465 | skip |= parameter_validation_vkCmdBindVertexBuffers(my_data->report_data, firstBinding, bindingCount, pBuffers, pOffsets); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4466 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4467 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4468 | my_data->dispatch_table.CmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4469 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4470 | } |
| 4471 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4472 | 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] | 4473 | uint32_t firstInstance) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4474 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 4475 | if (vertexCount == 0) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4476 | // 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] | 4477 | // this an error or leave as is. |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4478 | 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] | 4479 | REQUIRED_PARAMETER, LayerName, "vkCmdDraw parameter, uint32_t vertexCount, is 0"); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 4480 | return false; |
| 4481 | } |
| 4482 | |
| 4483 | if (instanceCount == 0) { |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4484 | // 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] | 4485 | // this an error or leave as is. |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4486 | 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] | 4487 | REQUIRED_PARAMETER, LayerName, "vkCmdDraw parameter, uint32_t instanceCount, is 0"); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 4488 | return false; |
| 4489 | } |
| 4490 | |
| 4491 | return true; |
| 4492 | } |
| 4493 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4494 | VKAPI_ATTR void VKAPI_CALL CmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, |
| 4495 | uint32_t firstVertex, uint32_t firstInstance) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4496 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Lobodzinski | 1ed594e | 2016-02-03 09:57:14 -0700 | [diff] [blame] | 4497 | PreCmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
Michael Lentine | 55a913f | 2015-11-24 09:48:23 -0600 | [diff] [blame] | 4498 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4499 | my_data->dispatch_table.CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4500 | } |
| 4501 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4502 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, |
| 4503 | uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4504 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4505 | my_data->dispatch_table.CmdDrawIndexed(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); |
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 CmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, |
| 4509 | uint32_t stride) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4510 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4511 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4512 | assert(my_data != NULL); |
| 4513 | |
Mark Lobodzinski | 33d8c9b | 2017-02-28 14:18:04 -0700 | [diff] [blame] | 4514 | if (!my_data->physical_device_features.multiDrawIndirect && ((count > 1))) { |
| 4515 | skip = log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4516 | DEVICE_FEATURE, LayerName, |
| 4517 | "CmdDrawIndirect(): Device feature multiDrawIndirect disabled: count must be 0 or 1 but is %d", count); |
| 4518 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4519 | skip |= parameter_validation_vkCmdDrawIndirect(my_data->report_data, buffer, offset, count, stride); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4520 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4521 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4522 | my_data->dispatch_table.CmdDrawIndirect(commandBuffer, buffer, offset, count, stride); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4523 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4524 | } |
| 4525 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4526 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 4527 | uint32_t count, uint32_t stride) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4528 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4529 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4530 | assert(my_data != NULL); |
Mark Lobodzinski | 33d8c9b | 2017-02-28 14:18:04 -0700 | [diff] [blame] | 4531 | if (!my_data->physical_device_features.multiDrawIndirect && ((count > 1))) { |
| 4532 | skip = |
| 4533 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4534 | DEVICE_FEATURE, LayerName, |
| 4535 | "CmdDrawIndexedIndirect(): Device feature multiDrawIndirect disabled: count must be 0 or 1 but is %d", count); |
| 4536 | } |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4537 | skip |= parameter_validation_vkCmdDrawIndexedIndirect(my_data->report_data, buffer, offset, count, stride); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4538 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4539 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4540 | my_data->dispatch_table.CmdDrawIndexedIndirect(commandBuffer, buffer, offset, count, stride); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4541 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4542 | } |
| 4543 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4544 | 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] | 4545 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4546 | my_data->dispatch_table.CmdDispatch(commandBuffer, x, y, z); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 4547 | } |
| 4548 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4549 | VKAPI_ATTR void VKAPI_CALL CmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4550 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4551 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4552 | assert(my_data != NULL); |
| 4553 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4554 | skip |= parameter_validation_vkCmdDispatchIndirect(my_data->report_data, buffer, offset); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4555 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4556 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4557 | my_data->dispatch_table.CmdDispatchIndirect(commandBuffer, buffer, offset); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4558 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4559 | } |
| 4560 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4561 | VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, |
| 4562 | uint32_t regionCount, const VkBufferCopy *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4563 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4564 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4565 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4566 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4567 | skip |= parameter_validation_vkCmdCopyBuffer(my_data->report_data, srcBuffer, dstBuffer, regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4568 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4569 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4570 | my_data->dispatch_table.CmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4571 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4572 | } |
| 4573 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4574 | static bool PreCmdCopyImage(VkCommandBuffer commandBuffer, const VkImageCopy *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4575 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4576 | if (pRegions != nullptr) { |
| 4577 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4578 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4579 | log_msg( |
| 4580 | my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4581 | VALIDATION_ERROR_01225, LayerName, |
| 4582 | "vkCmdCopyImage() parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator. %s", |
| 4583 | validation_error_map[VALIDATION_ERROR_01225]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4584 | return false; |
| 4585 | } |
| 4586 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4587 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4588 | log_msg( |
| 4589 | my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 4590 | VALIDATION_ERROR_01225, LayerName, |
| 4591 | "vkCmdCopyImage() parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator. %s", |
| 4592 | validation_error_map[VALIDATION_ERROR_01225]); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4593 | return false; |
| 4594 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4595 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4596 | |
| 4597 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4598 | } |
| 4599 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4600 | VKAPI_ATTR void VKAPI_CALL CmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 4601 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
| 4602 | const VkImageCopy *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4603 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4604 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4605 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4606 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4607 | skip |= parameter_validation_vkCmdCopyImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4608 | regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4609 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4610 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4611 | PreCmdCopyImage(commandBuffer, pRegions); |
| 4612 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4613 | my_data->dispatch_table.CmdCopyImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
| 4614 | pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4615 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4616 | } |
| 4617 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4618 | static bool PreCmdBlitImage(VkCommandBuffer commandBuffer, const VkImageBlit *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4619 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4620 | if (pRegions != nullptr) { |
| 4621 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4622 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4623 | 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] | 4624 | UNRECOGNIZED_VALUE, LayerName, |
Mike Weiblen | fa0fd07 | 2017-01-06 16:20:51 -0700 | [diff] [blame] | 4625 | "vkCmdBlitImage() parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4626 | return false; |
| 4627 | } |
| 4628 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4629 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4630 | 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] | 4631 | UNRECOGNIZED_VALUE, LayerName, |
Mike Weiblen | fa0fd07 | 2017-01-06 16:20:51 -0700 | [diff] [blame] | 4632 | "vkCmdBlitImage() parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4633 | return false; |
| 4634 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4635 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4636 | |
| 4637 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4638 | } |
| 4639 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4640 | VKAPI_ATTR void VKAPI_CALL CmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 4641 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
| 4642 | const VkImageBlit *pRegions, VkFilter filter) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4643 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4644 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4645 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4646 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4647 | skip |= parameter_validation_vkCmdBlitImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4648 | regionCount, pRegions, filter); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4649 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4650 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4651 | PreCmdBlitImage(commandBuffer, pRegions); |
| 4652 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4653 | my_data->dispatch_table.CmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
| 4654 | pRegions, filter); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4655 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4656 | } |
| 4657 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4658 | static bool PreCmdCopyBufferToImage(VkCommandBuffer commandBuffer, const VkBufferImageCopy *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4659 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4660 | if (pRegions != nullptr) { |
| 4661 | if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4662 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4663 | 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] | 4664 | UNRECOGNIZED_VALUE, LayerName, |
Mike Weiblen | fa0fd07 | 2017-01-06 16:20:51 -0700 | [diff] [blame] | 4665 | "vkCmdCopyBufferToImage() parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4666 | "enumerator"); |
| 4667 | return false; |
| 4668 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4669 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4670 | |
| 4671 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4672 | } |
| 4673 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4674 | VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, |
| 4675 | VkImageLayout dstImageLayout, uint32_t regionCount, |
| 4676 | const VkBufferImageCopy *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4677 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4678 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4679 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4680 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4681 | skip |= parameter_validation_vkCmdCopyBufferToImage(my_data->report_data, srcBuffer, dstImage, dstImageLayout, regionCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4682 | pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4683 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4684 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4685 | PreCmdCopyBufferToImage(commandBuffer, pRegions); |
| 4686 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4687 | my_data->dispatch_table.CmdCopyBufferToImage(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4688 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4689 | } |
| 4690 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4691 | static bool PreCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, const VkBufferImageCopy *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4692 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4693 | if (pRegions != nullptr) { |
| 4694 | if ((pRegions->imageSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4695 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4696 | 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] | 4697 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4698 | "vkCmdCopyImageToBuffer parameter, VkImageAspect pRegions->imageSubresource.aspectMask, is an unrecognized " |
| 4699 | "enumerator"); |
| 4700 | return false; |
| 4701 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4702 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4703 | |
| 4704 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4705 | } |
| 4706 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4707 | VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 4708 | VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4709 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4710 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4711 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4712 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4713 | skip |= parameter_validation_vkCmdCopyImageToBuffer(my_data->report_data, srcImage, srcImageLayout, dstBuffer, regionCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4714 | pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4715 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4716 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4717 | PreCmdCopyImageToBuffer(commandBuffer, pRegions); |
| 4718 | |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4719 | my_data->dispatch_table.CmdCopyImageToBuffer(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4720 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4721 | } |
| 4722 | |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4723 | VKAPI_ATTR void VKAPI_CALL CmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
Mark Lobodzinski | a2d9384 | 2017-02-08 16:28:18 -0700 | [diff] [blame] | 4724 | VkDeviceSize dataSize, const void *pData) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4725 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4726 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4727 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4728 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4729 | skip |= parameter_validation_vkCmdUpdateBuffer(my_data->report_data, dstBuffer, dstOffset, dataSize, pData); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4730 | |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4731 | if (dstOffset & 3) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4732 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, |
| 4733 | VALIDATION_ERROR_01147, LayerName, |
| 4734 | "vkCmdUpdateBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", |
| 4735 | dstOffset, validation_error_map[VALIDATION_ERROR_01147]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4736 | } |
| 4737 | |
| 4738 | if ((dataSize <= 0) || (dataSize > 65536)) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4739 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4740 | VALIDATION_ERROR_01148, LayerName, "vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64 |
| 4741 | "), must be greater than zero and less than or equal to 65536. %s", |
| 4742 | dataSize, validation_error_map[VALIDATION_ERROR_01148]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4743 | } else if (dataSize & 3) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4744 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, |
| 4745 | VALIDATION_ERROR_01149, LayerName, |
| 4746 | "vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", |
| 4747 | dataSize, validation_error_map[VALIDATION_ERROR_01149]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4748 | } |
| 4749 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4750 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4751 | my_data->dispatch_table.CmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4752 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4753 | } |
| 4754 | |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4755 | VKAPI_ATTR void VKAPI_CALL CmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
| 4756 | VkDeviceSize size, uint32_t data) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4757 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4758 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4759 | assert(my_data != NULL); |
| 4760 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4761 | skip |= parameter_validation_vkCmdFillBuffer(my_data->report_data, dstBuffer, dstOffset, size, data); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4762 | |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4763 | if (dstOffset & 3) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4764 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, |
| 4765 | VALIDATION_ERROR_01133, LayerName, |
| 4766 | "vkCmdFillBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", |
| 4767 | dstOffset, validation_error_map[VALIDATION_ERROR_01133]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4768 | } |
| 4769 | |
| 4770 | if (size != VK_WHOLE_SIZE) { |
| 4771 | if (size <= 0) { |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4772 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, |
| 4773 | VALIDATION_ERROR_01134, LayerName, |
| 4774 | "vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), must be greater than zero. %s", |
| 4775 | size, validation_error_map[VALIDATION_ERROR_01134]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4776 | } else if (size & 3) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4777 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, |
Mike Weiblen | a666638 | 2017-01-05 15:16:11 -0700 | [diff] [blame] | 4778 | VALIDATION_ERROR_01136, LayerName, |
| 4779 | "vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", size, |
| 4780 | validation_error_map[VALIDATION_ERROR_01136]); |
Mark Lobodzinski | bbed437 | 2016-06-09 17:01:19 -0600 | [diff] [blame] | 4781 | } |
| 4782 | } |
| 4783 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4784 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4785 | my_data->dispatch_table.CmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4786 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4787 | } |
| 4788 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4789 | VKAPI_ATTR void VKAPI_CALL CmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 4790 | const VkClearColorValue *pColor, uint32_t rangeCount, |
| 4791 | const VkImageSubresourceRange *pRanges) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4792 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4793 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4794 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4795 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4796 | 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] | 4797 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4798 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4799 | my_data->dispatch_table.CmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4800 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4801 | } |
| 4802 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4803 | VKAPI_ATTR void VKAPI_CALL CmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, |
| 4804 | const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, |
| 4805 | const VkImageSubresourceRange *pRanges) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4806 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4807 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4808 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4809 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4810 | skip |= parameter_validation_vkCmdClearDepthStencilImage(my_data->report_data, image, imageLayout, pDepthStencil, rangeCount, |
| 4811 | pRanges); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4812 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4813 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4814 | my_data->dispatch_table.CmdClearDepthStencilImage(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4815 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4816 | } |
| 4817 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4818 | VKAPI_ATTR void VKAPI_CALL CmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, |
| 4819 | const VkClearAttachment *pAttachments, uint32_t rectCount, |
| 4820 | const VkClearRect *pRects) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4821 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4822 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4823 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4824 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4825 | skip |= parameter_validation_vkCmdClearAttachments(my_data->report_data, attachmentCount, pAttachments, rectCount, pRects); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4826 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4827 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4828 | my_data->dispatch_table.CmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4829 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4830 | } |
| 4831 | |
Mike Weiblen | 3716627 | 2017-01-05 15:11:00 -0700 | [diff] [blame] | 4832 | static bool PreCmdResolveImage(VkCommandBuffer commandBuffer, const VkImageResolve *pRegions) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4833 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4834 | if (pRegions != nullptr) { |
| 4835 | if ((pRegions->srcSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4836 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 4837 | log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4838 | 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] | 4839 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4840 | "vkCmdResolveImage parameter, VkImageAspect pRegions->srcSubresource.aspectMask, is an unrecognized enumerator"); |
| 4841 | return false; |
| 4842 | } |
| 4843 | if ((pRegions->dstSubresource.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 4844 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 4845 | log_msg( |
Chris Forbes | 0e0161a | 2016-11-02 16:21:28 +1300 | [diff] [blame] | 4846 | 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] | 4847 | UNRECOGNIZED_VALUE, LayerName, |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4848 | "vkCmdResolveImage parameter, VkImageAspect pRegions->dstSubresource.aspectMask, is an unrecognized enumerator"); |
| 4849 | return false; |
| 4850 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 4851 | } |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4852 | |
| 4853 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4854 | } |
| 4855 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4856 | VKAPI_ATTR void VKAPI_CALL CmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, |
| 4857 | VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, |
| 4858 | const VkImageResolve *pRegions) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4859 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4860 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4861 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4862 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4863 | skip |= parameter_validation_vkCmdResolveImage(my_data->report_data, srcImage, srcImageLayout, dstImage, dstImageLayout, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4864 | regionCount, pRegions); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4865 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4866 | if (!skip) { |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4867 | PreCmdResolveImage(commandBuffer, pRegions); |
| 4868 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4869 | my_data->dispatch_table.CmdResolveImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, |
| 4870 | pRegions); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4871 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4872 | } |
| 4873 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4874 | VKAPI_ATTR void VKAPI_CALL CmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4875 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4876 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4877 | assert(my_data != NULL); |
| 4878 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4879 | skip |= parameter_validation_vkCmdSetEvent(my_data->report_data, event, stageMask); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4880 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4881 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4882 | my_data->dispatch_table.CmdSetEvent(commandBuffer, event, stageMask); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4883 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4884 | } |
| 4885 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4886 | VKAPI_ATTR void VKAPI_CALL CmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4887 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4888 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4889 | assert(my_data != NULL); |
| 4890 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4891 | skip |= parameter_validation_vkCmdResetEvent(my_data->report_data, event, stageMask); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4892 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4893 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4894 | my_data->dispatch_table.CmdResetEvent(commandBuffer, event, stageMask); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4895 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4896 | } |
| 4897 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4898 | VKAPI_ATTR void VKAPI_CALL CmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, |
| 4899 | VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, |
| 4900 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 4901 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 4902 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4903 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4904 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4905 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4906 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4907 | skip |= parameter_validation_vkCmdWaitEvents(my_data->report_data, eventCount, pEvents, srcStageMask, dstStageMask, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4908 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, |
| 4909 | pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4910 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4911 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4912 | my_data->dispatch_table.CmdWaitEvents(commandBuffer, eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, |
| 4913 | pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, |
| 4914 | imageMemoryBarrierCount, pImageMemoryBarriers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4915 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4916 | } |
| 4917 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4918 | VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, |
| 4919 | VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, |
| 4920 | uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, |
| 4921 | uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, |
| 4922 | uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4923 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4924 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4925 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4926 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4927 | skip |= parameter_validation_vkCmdPipelineBarrier(my_data->report_data, srcStageMask, dstStageMask, dependencyFlags, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4928 | memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, |
| 4929 | pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4930 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4931 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 4932 | my_data->dispatch_table.CmdPipelineBarrier(commandBuffer, srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, |
| 4933 | pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, |
| 4934 | imageMemoryBarrierCount, pImageMemoryBarriers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 4935 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4936 | } |
| 4937 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4938 | VKAPI_ATTR void VKAPI_CALL CmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t slot, |
| 4939 | VkQueryControlFlags flags) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4940 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4941 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4942 | assert(my_data != NULL); |
| 4943 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4944 | skip |= parameter_validation_vkCmdBeginQuery(my_data->report_data, queryPool, slot, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4945 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4946 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4947 | my_data->dispatch_table.CmdBeginQuery(commandBuffer, queryPool, slot, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4948 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4949 | } |
| 4950 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4951 | 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] | 4952 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4953 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4954 | assert(my_data != NULL); |
| 4955 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4956 | skip |= parameter_validation_vkCmdEndQuery(my_data->report_data, queryPool, slot); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4957 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4958 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4959 | my_data->dispatch_table.CmdEndQuery(commandBuffer, queryPool, slot); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4960 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4961 | } |
| 4962 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4963 | VKAPI_ATTR void VKAPI_CALL CmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, |
| 4964 | uint32_t queryCount) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4965 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4966 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4967 | assert(my_data != NULL); |
| 4968 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4969 | skip |= parameter_validation_vkCmdResetQueryPool(my_data->report_data, queryPool, firstQuery, queryCount); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4970 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4971 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 4972 | my_data->dispatch_table.CmdResetQueryPool(commandBuffer, queryPool, firstQuery, queryCount); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4973 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4974 | } |
| 4975 | |
Jon Ashburn | 5484e0c | 2016-03-08 17:48:44 -0700 | [diff] [blame] | 4976 | bool PostCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, |
| 4977 | uint32_t slot) { |
Chia-I Wu | 51ce5ea | 2015-10-26 19:40:27 +0800 | [diff] [blame] | 4978 | ValidateEnumerator(pipelineStage); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 4979 | |
| 4980 | return true; |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4981 | } |
| 4982 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 4983 | VKAPI_ATTR void VKAPI_CALL CmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, |
| 4984 | VkQueryPool queryPool, uint32_t query) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4985 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 4986 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4987 | assert(my_data != NULL); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4988 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 4989 | skip |= parameter_validation_vkCmdWriteTimestamp(my_data->report_data, pipelineStage, queryPool, query); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -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 | my_data->dispatch_table.CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 4993 | |
| 4994 | PostCmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, query); |
| 4995 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 4996 | } |
| 4997 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 4998 | VKAPI_ATTR void VKAPI_CALL CmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, |
| 4999 | uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, |
| 5000 | VkDeviceSize stride, VkQueryResultFlags flags) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5001 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5002 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 5003 | assert(my_data != NULL); |
| 5004 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5005 | skip |= parameter_validation_vkCmdCopyQueryPoolResults(my_data->report_data, queryPool, firstQuery, queryCount, dstBuffer, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5006 | dstOffset, stride, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 5007 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5008 | if (!skip) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5009 | my_data->dispatch_table.CmdCopyQueryPoolResults(commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, |
| 5010 | stride, flags); |
Dustin Graves | 20fd66f | 2016-04-18 18:33:21 -0600 | [diff] [blame] | 5011 | } |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5012 | } |
| 5013 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5014 | VKAPI_ATTR void VKAPI_CALL CmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, |
| 5015 | uint32_t offset, uint32_t size, const void *pValues) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5016 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5017 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 5018 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5019 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5020 | 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] | 5021 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5022 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5023 | my_data->dispatch_table.CmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 5024 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5025 | } |
| 5026 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5027 | VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, |
| 5028 | VkSubpassContents contents) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5029 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5030 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 5031 | assert(my_data != NULL); |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5032 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5033 | skip |= parameter_validation_vkCmdBeginRenderPass(my_data->report_data, pRenderPassBegin, contents); |
Jeremy Hayes | 99a9632 | 2015-06-26 12:48:09 -0600 | [diff] [blame] | 5034 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5035 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5036 | my_data->dispatch_table.CmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 5037 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5038 | } |
| 5039 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 5040 | VKAPI_ATTR void VKAPI_CALL CmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5041 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5042 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 5043 | assert(my_data != NULL); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 5044 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5045 | skip |= parameter_validation_vkCmdNextSubpass(my_data->report_data, contents); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 5046 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5047 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5048 | my_data->dispatch_table.CmdNextSubpass(commandBuffer, contents); |
Dustin Graves | 29148ff | 2016-03-23 19:44:00 -0600 | [diff] [blame] | 5049 | } |
Jeremy Hayes | f4b6f56 | 2015-07-29 11:23:46 -0600 | [diff] [blame] | 5050 | } |
| 5051 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 5052 | VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass(VkCommandBuffer commandBuffer) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5053 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5054 | my_data->dispatch_table.CmdEndRenderPass(commandBuffer); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5055 | } |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 5056 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5057 | VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, |
| 5058 | const VkCommandBuffer *pCommandBuffers) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5059 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5060 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 5061 | assert(my_data != NULL); |
Jeremy Hayes | 359eeb9 | 2015-07-09 17:11:25 -0600 | [diff] [blame] | 5062 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5063 | skip |= parameter_validation_vkCmdExecuteCommands(my_data->report_data, commandBufferCount, pCommandBuffers); |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 5064 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5065 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5066 | my_data->dispatch_table.CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers); |
Dustin Graves | 1e92cd7 | 2016-02-09 14:00:18 -0700 | [diff] [blame] | 5067 | } |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 5068 | } |
| 5069 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5070 | VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 5071 | return util_GetLayerProperties(1, &global_layer, pCount, pProperties); |
| 5072 | } |
| 5073 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5074 | VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, |
| 5075 | VkLayerProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 5076 | return util_GetLayerProperties(1, &global_layer, pCount, pProperties); |
| 5077 | } |
| 5078 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5079 | VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, |
| 5080 | VkExtensionProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 5081 | if (pLayerName && !strcmp(pLayerName, global_layer.layerName)) |
| 5082 | return util_GetExtensionProperties(1, instance_extensions, pCount, pProperties); |
| 5083 | |
| 5084 | return VK_ERROR_LAYER_NOT_PRESENT; |
| 5085 | } |
| 5086 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5087 | VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, |
| 5088 | uint32_t *pCount, VkExtensionProperties *pProperties) { |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 5089 | /* parameter_validation does not have any physical device extensions */ |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5090 | 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] | 5091 | |
| 5092 | assert(physicalDevice); |
| 5093 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5094 | return GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map) |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5095 | ->dispatch_table.EnumerateDeviceExtensionProperties(physicalDevice, NULL, pCount, pProperties); |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 5096 | } |
| 5097 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5098 | 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] | 5099 | if (!flag) { |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5100 | return log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 5101 | EXTENSION_NOT_ENABLED, LayerName, |
| 5102 | "%s() called even though the %s extension was not enabled for this VkDevice.", function_name, |
| 5103 | extension_name); |
Chris Forbes | 448ebcb | 2016-11-03 09:29:52 +1300 | [diff] [blame] | 5104 | } |
| 5105 | |
| 5106 | return false; |
| 5107 | } |
| 5108 | |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5109 | // WSI Extension Functions |
| 5110 | |
| 5111 | VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5112 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5113 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5114 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5115 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5116 | assert(my_data != NULL); |
| 5117 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5118 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain_enabled, "vkCreateSwapchainKHR", |
| 5119 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5120 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5121 | skip |= parameter_validation_vkCreateSwapchainKHR(my_data->report_data, pCreateInfo, pAllocator, pSwapchain); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5122 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5123 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5124 | result = my_data->dispatch_table.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5125 | |
| 5126 | validate_result(my_data->report_data, "vkCreateSwapchainKHR", result); |
| 5127 | } |
| 5128 | |
| 5129 | return result; |
| 5130 | } |
| 5131 | |
| 5132 | 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] | 5133 | VkImage *pSwapchainImages) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5134 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5135 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5136 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5137 | assert(my_data != NULL); |
| 5138 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5139 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain_enabled, "vkGetSwapchainImagesKHR", |
| 5140 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5141 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5142 | skip |= parameter_validation_vkGetSwapchainImagesKHR(my_data->report_data, swapchain, pSwapchainImageCount, pSwapchainImages); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5143 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5144 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5145 | result = my_data->dispatch_table.GetSwapchainImagesKHR(device, swapchain, pSwapchainImageCount, pSwapchainImages); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5146 | |
| 5147 | validate_result(my_data->report_data, "vkGetSwapchainImagesKHR", result); |
| 5148 | } |
| 5149 | |
| 5150 | return result; |
| 5151 | } |
| 5152 | |
| 5153 | 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] | 5154 | VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5155 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5156 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5157 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5158 | assert(my_data != NULL); |
| 5159 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5160 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain_enabled, "vkAcquireNextImageKHR", |
| 5161 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5162 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5163 | 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] | 5164 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5165 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5166 | result = my_data->dispatch_table.AcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5167 | |
| 5168 | validate_result(my_data->report_data, "vkAcquireNextImageKHR", result); |
| 5169 | } |
| 5170 | |
| 5171 | return result; |
| 5172 | } |
| 5173 | |
| 5174 | VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) { |
| 5175 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5176 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5177 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(queue), layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5178 | assert(my_data != NULL); |
| 5179 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5180 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain_enabled, "vkQueuePresentKHR", |
| 5181 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5182 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5183 | skip |= parameter_validation_vkQueuePresentKHR(my_data->report_data, pPresentInfo); |
Tobin Ehlis | 13e9c14 | 2017-01-13 12:13:57 -0700 | [diff] [blame] | 5184 | |
| 5185 | if (pPresentInfo && pPresentInfo->pNext) { |
| 5186 | // Verify ext struct |
| 5187 | struct std_header { |
| 5188 | VkStructureType sType; |
| 5189 | const void *pNext; |
| 5190 | }; |
| 5191 | std_header *pnext = (std_header *)pPresentInfo->pNext; |
| 5192 | while (pnext) { |
| 5193 | if (VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR == pnext->sType) { |
| 5194 | skip |= require_device_extension(my_data, my_data->enables.incremental_present, "vkQueuePresentKHR", |
| 5195 | VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME); |
| 5196 | VkPresentRegionsKHR *present_regions = (VkPresentRegionsKHR *)pnext; |
| 5197 | if (present_regions->swapchainCount != pPresentInfo->swapchainCount) { |
| 5198 | skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, |
| 5199 | __LINE__, INVALID_USAGE, LayerName, |
| 5200 | "QueuePresentKHR(): pPresentInfo->swapchainCount has a value of %i" |
| 5201 | " but VkPresentRegionsKHR extension swapchainCount is %i. These values must be equal.", |
| 5202 | pPresentInfo->swapchainCount, present_regions->swapchainCount); |
| 5203 | } |
| 5204 | skip |= validate_struct_pnext(my_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->pNext", NULL, |
| 5205 | present_regions->pNext, 0, NULL, GeneratedHeaderVersion); |
| 5206 | skip |= validate_array(my_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->swapchainCount", |
| 5207 | "pCreateInfo->pNext->pRegions", present_regions->swapchainCount, present_regions->pRegions, |
| 5208 | true, false); |
| 5209 | for (uint32_t i = 0; i < present_regions->swapchainCount; ++i) { |
| 5210 | skip |= |
| 5211 | validate_array(my_data->report_data, "QueuePresentKHR", "pCreateInfo->pNext->pRegions[].rectangleCount", |
| 5212 | "pCreateInfo->pNext->pRegions[].pRectangles", present_regions->pRegions[i].rectangleCount, |
| 5213 | present_regions->pRegions[i].pRectangles, true, false); |
| 5214 | } |
| 5215 | } |
| 5216 | pnext = (std_header *)pnext->pNext; |
| 5217 | } |
| 5218 | } |
| 5219 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5220 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5221 | result = my_data->dispatch_table.QueuePresentKHR(queue, pPresentInfo); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5222 | |
| 5223 | validate_result(my_data->report_data, "vkQueuePresentKHR", result); |
| 5224 | } |
| 5225 | |
| 5226 | return result; |
| 5227 | } |
| 5228 | |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5229 | 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] | 5230 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5231 | layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5232 | assert(my_data != NULL); |
| 5233 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5234 | skip |= require_device_extension(my_data, my_data->enables.khr_swapchain_enabled, "vkDestroySwapchainKHR", |
| 5235 | VK_KHR_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5236 | |
| 5237 | /* No generated validation function for this call */ |
| 5238 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5239 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5240 | my_data->dispatch_table.DestroySwapchainKHR(device, swapchain, pAllocator); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5241 | } |
| 5242 | } |
| 5243 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5244 | static bool require_instance_extension(void *instance, bool instance_extension_enables::*flag, char const *function_name, |
| 5245 | char const *extension_name) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5246 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 6be763e | 2016-11-24 12:42:33 +1300 | [diff] [blame] | 5247 | if (!(my_data->extensions.*flag)) { |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5248 | return log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, |
| 5249 | reinterpret_cast<uint64_t>(instance), __LINE__, EXTENSION_NOT_ENABLED, LayerName, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5250 | "%s() called even though the %s extension was not enabled for this VkInstance.", function_name, |
| 5251 | extension_name); |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5252 | } |
| 5253 | |
| 5254 | return false; |
| 5255 | } |
| 5256 | |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5257 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, |
| 5258 | VkSurfaceKHR surface, VkBool32 *pSupported) { |
| 5259 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5260 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5261 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5262 | assert(my_data != NULL); |
| 5263 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5264 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::surface_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5265 | "vkGetPhysicalDeviceSurfaceSupportKHR", VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 8a13e27 | 2016-11-02 17:43:34 +1300 | [diff] [blame] | 5266 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5267 | skip |= parameter_validation_vkGetPhysicalDeviceSurfaceSupportKHR(my_data->report_data, queueFamilyIndex, surface, pSupported); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5268 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5269 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5270 | result = my_data->dispatch_table.GetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5271 | |
| 5272 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfaceSupportKHR", result); |
| 5273 | } |
| 5274 | |
| 5275 | return result; |
| 5276 | } |
| 5277 | |
| 5278 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 5279 | VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) { |
| 5280 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5281 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5282 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5283 | assert(my_data != NULL); |
| 5284 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5285 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::surface_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5286 | "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 8a13e27 | 2016-11-02 17:43:34 +1300 | [diff] [blame] | 5287 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5288 | skip |= parameter_validation_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(my_data->report_data, surface, pSurfaceCapabilities); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5289 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5290 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5291 | result = my_data->dispatch_table.GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, pSurfaceCapabilities); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5292 | |
| 5293 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", result); |
| 5294 | } |
| 5295 | |
| 5296 | return result; |
| 5297 | } |
| 5298 | |
| 5299 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 5300 | uint32_t *pSurfaceFormatCount, |
| 5301 | VkSurfaceFormatKHR *pSurfaceFormats) { |
| 5302 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5303 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5304 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5305 | assert(my_data != NULL); |
| 5306 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5307 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::surface_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5308 | "vkGetPhysicalDeviceSurfaceFormatsKHR", VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 8a13e27 | 2016-11-02 17:43:34 +1300 | [diff] [blame] | 5309 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5310 | skip |= parameter_validation_vkGetPhysicalDeviceSurfaceFormatsKHR(my_data->report_data, surface, pSurfaceFormatCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5311 | pSurfaceFormats); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5312 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5313 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5314 | result = my_data->dispatch_table.GetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, |
| 5315 | pSurfaceFormats); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5316 | |
| 5317 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfaceFormatsKHR", result); |
| 5318 | } |
| 5319 | |
| 5320 | return result; |
| 5321 | } |
| 5322 | |
| 5323 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 5324 | uint32_t *pPresentModeCount, |
| 5325 | VkPresentModeKHR *pPresentModes) { |
| 5326 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5327 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5328 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5329 | assert(my_data != NULL); |
| 5330 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5331 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::surface_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5332 | "vkGetPhysicalDeviceSurfacePresentModesKHR", VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 8a13e27 | 2016-11-02 17:43:34 +1300 | [diff] [blame] | 5333 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5334 | skip |= parameter_validation_vkGetPhysicalDeviceSurfacePresentModesKHR(my_data->report_data, surface, pPresentModeCount, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5335 | pPresentModes); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5336 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5337 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5338 | result = my_data->dispatch_table.GetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, |
| 5339 | pPresentModes); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5340 | |
| 5341 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfacePresentModesKHR", result); |
| 5342 | } |
| 5343 | |
| 5344 | return result; |
| 5345 | } |
| 5346 | |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5347 | 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] | 5348 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5349 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5350 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5351 | skip |= require_instance_extension(instance, &instance_extension_enables::surface_enabled, "vkDestroySurfaceKHR", |
| 5352 | VK_KHR_SURFACE_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5353 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5354 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5355 | my_data->dispatch_table.DestroySurfaceKHR(instance, surface, pAllocator); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5356 | } |
| 5357 | } |
| 5358 | |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5359 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
| 5360 | VKAPI_ATTR VkResult VKAPI_CALL CreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, |
| 5361 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
| 5362 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5363 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5364 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5365 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5366 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5367 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5368 | skip |= require_instance_extension(instance, &instance_extension_enables::win32_enabled, "vkCreateWin32SurfaceKHR", |
| 5369 | VK_KHR_WIN32_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5370 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5371 | skip |= parameter_validation_vkCreateWin32SurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5372 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5373 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5374 | result = my_data->dispatch_table.CreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5375 | } |
| 5376 | |
| 5377 | validate_result(my_data->report_data, "vkCreateWin32SurfaceKHR", result); |
| 5378 | |
| 5379 | return result; |
| 5380 | } |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5381 | |
| 5382 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5383 | uint32_t queueFamilyIndex) { |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5384 | VkBool32 result = false; |
| 5385 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5386 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5387 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5388 | bool skip = false; |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5389 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5390 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::win32_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5391 | "vkGetPhysicalDeviceWin32PresentationSupportKHR", VK_KHR_WIN32_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5392 | |
Chris Forbes | 7281a50 | 2016-11-08 08:45:03 +1300 | [diff] [blame] | 5393 | // TODO: codegen doesn't produce this function? |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5394 | // skip |= parameter_validation_vkGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5395 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5396 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5397 | result = my_data->dispatch_table.GetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5398 | } |
| 5399 | |
| 5400 | return result; |
| 5401 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5402 | #endif // VK_USE_PLATFORM_WIN32_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5403 | |
| 5404 | #ifdef VK_USE_PLATFORM_XCB_KHR |
| 5405 | VKAPI_ATTR VkResult VKAPI_CALL CreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, |
| 5406 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
| 5407 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5408 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5409 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5410 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5411 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5412 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5413 | skip |= require_instance_extension(instance, &instance_extension_enables::xcb_enabled, "vkCreateXcbSurfaceKHR", |
| 5414 | VK_KHR_XCB_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5415 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5416 | skip |= parameter_validation_vkCreateXcbSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5417 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5418 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5419 | result = my_data->dispatch_table.CreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5420 | } |
| 5421 | |
| 5422 | validate_result(my_data->report_data, "vkCreateXcbSurfaceKHR", result); |
| 5423 | |
| 5424 | return result; |
| 5425 | } |
| 5426 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5427 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 5428 | uint32_t queueFamilyIndex, xcb_connection_t *connection, |
| 5429 | xcb_visualid_t visual_id) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5430 | VkBool32 result = false; |
| 5431 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5432 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5433 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5434 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5435 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5436 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::xcb_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5437 | "vkGetPhysicalDeviceXcbPresentationSupportKHR", VK_KHR_XCB_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5438 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5439 | skip |= parameter_validation_vkGetPhysicalDeviceXcbPresentationSupportKHR(my_data->report_data, queueFamilyIndex, connection, |
| 5440 | visual_id); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5441 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5442 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5443 | result = my_data->dispatch_table.GetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection, |
| 5444 | visual_id); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5445 | } |
| 5446 | |
| 5447 | return result; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5448 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5449 | #endif // VK_USE_PLATFORM_XCB_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5450 | |
| 5451 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 5452 | VKAPI_ATTR VkResult VKAPI_CALL CreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5453 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5454 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5455 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5456 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5457 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5458 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5459 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5460 | skip |= require_instance_extension(instance, &instance_extension_enables::xlib_enabled, "vkCreateXlibSurfaceKHR", |
| 5461 | VK_KHR_XLIB_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5462 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5463 | skip |= parameter_validation_vkCreateXlibSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5464 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5465 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5466 | result = my_data->dispatch_table.CreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5467 | } |
| 5468 | |
| 5469 | validate_result(my_data->report_data, "vkCreateXlibSurfaceKHR", result); |
| 5470 | |
| 5471 | return result; |
| 5472 | } |
| 5473 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5474 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 5475 | uint32_t queueFamilyIndex, Display *dpy, |
| 5476 | VisualID visualID) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5477 | VkBool32 result = false; |
| 5478 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5479 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5480 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5481 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5482 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5483 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::xlib_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5484 | "vkGetPhysicalDeviceXlibPresentationSupportKHR", VK_KHR_XLIB_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5485 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5486 | skip |= |
| 5487 | parameter_validation_vkGetPhysicalDeviceXlibPresentationSupportKHR(my_data->report_data, queueFamilyIndex, dpy, visualID); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5488 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5489 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5490 | result = |
| 5491 | my_data->dispatch_table.GetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, queueFamilyIndex, dpy, visualID); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5492 | } |
Karl Schultz | 3a41cae | 2016-09-02 10:17:05 -0600 | [diff] [blame] | 5493 | return result; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5494 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5495 | #endif // VK_USE_PLATFORM_XLIB_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5496 | |
| 5497 | #ifdef VK_USE_PLATFORM_MIR_KHR |
| 5498 | VKAPI_ATTR VkResult VKAPI_CALL CreateMirSurfaceKHR(VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5499 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5500 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5501 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5502 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5503 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5504 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5505 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5506 | skip |= require_instance_extension(instance, &instance_extension_enables::mir_enabled, "vkCreateMirSurfaceKHR", |
| 5507 | VK_KHR_MIR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5508 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5509 | skip |= parameter_validation_vkCreateMirSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5510 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5511 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5512 | result = my_data->dispatch_table.CreateMirSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5513 | } |
| 5514 | |
| 5515 | validate_result(my_data->report_data, "vkCreateMirSurfaceKHR", result); |
| 5516 | |
| 5517 | return result; |
| 5518 | } |
| 5519 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5520 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceMirPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 5521 | uint32_t queueFamilyIndex, MirConnection *connection) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5522 | VkBool32 result = false; |
| 5523 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5524 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5525 | assert(my_data != NULL); |
| 5526 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5527 | bool skip = false; |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5528 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5529 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::mir_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5530 | "vkGetPhysicalDeviceMirPresentationSupportKHR", VK_KHR_MIR_SURFACE_EXTENSION_NAME); |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5531 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5532 | skip |= parameter_validation_vkGetPhysicalDeviceMirPresentationSupportKHR(my_data->report_data, queueFamilyIndex, connection); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5533 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5534 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5535 | result = my_data->dispatch_table.GetPhysicalDeviceMirPresentationSupportKHR(physicalDevice, queueFamilyIndex, connection); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5536 | } |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5537 | return result; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5538 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5539 | #endif // VK_USE_PLATFORM_MIR_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5540 | |
| 5541 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR |
| 5542 | VKAPI_ATTR VkResult VKAPI_CALL CreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5543 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5544 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5545 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5546 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5547 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5548 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5549 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5550 | skip |= require_instance_extension(instance, &instance_extension_enables::wayland_enabled, "vkCreateWaylandSurfaceKHR", |
| 5551 | VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5552 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5553 | skip |= parameter_validation_vkCreateWaylandSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5554 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5555 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5556 | result = my_data->dispatch_table.CreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5557 | } |
| 5558 | |
| 5559 | validate_result(my_data->report_data, "vkCreateWaylandSurfaceKHR", result); |
| 5560 | |
| 5561 | return result; |
| 5562 | } |
| 5563 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5564 | VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, |
| 5565 | uint32_t queueFamilyIndex, |
| 5566 | struct wl_display *display) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5567 | VkBool32 result = false; |
| 5568 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5569 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5570 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5571 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5572 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5573 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::wayland_enabled, |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5574 | "vkGetPhysicalDeviceWaylandPresentationSupportKHR", VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); |
Chris Forbes | 115f98c | 2016-11-03 09:51:48 +1300 | [diff] [blame] | 5575 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 5576 | skip |= parameter_validation_vkGetPhysicalDeviceWaylandPresentationSupportKHR(my_data->report_data, queueFamilyIndex, display); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5577 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5578 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5579 | result = my_data->dispatch_table.GetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, display); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5580 | } |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5581 | |
| 5582 | return result; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5583 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5584 | #endif // VK_USE_PLATFORM_WAYLAND_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5585 | |
| 5586 | #ifdef VK_USE_PLATFORM_ANDROID_KHR |
| 5587 | VKAPI_ATTR VkResult VKAPI_CALL CreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR *pCreateInfo, |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 5588 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5589 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5590 | |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5591 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5592 | assert(my_data != NULL); |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5593 | bool skip = false; |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5594 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5595 | skip |= require_instance_extension(instance, &instance_extension_enables::android_enabled, "vkCreateAndroidSurfaceKHR", |
| 5596 | VK_KHR_ANDROID_SURFACE_EXTENSION_NAME); |
Chris Forbes | 9a083b9 | 2016-11-02 16:58:15 +1300 | [diff] [blame] | 5597 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5598 | skip |= parameter_validation_vkCreateAndroidSurfaceKHR(my_data->report_data, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5599 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5600 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5601 | result = my_data->dispatch_table.CreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5602 | } |
| 5603 | |
| 5604 | validate_result(my_data->report_data, "vkCreateAndroidSurfaceKHR", result); |
| 5605 | |
| 5606 | return result; |
| 5607 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 5608 | #endif // VK_USE_PLATFORM_ANDROID_KHR |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 5609 | |
Mark Young | ead9b93 | 2016-09-08 12:28:38 -0600 | [diff] [blame] | 5610 | VKAPI_ATTR VkResult VKAPI_CALL CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, |
| 5611 | const VkSwapchainCreateInfoKHR *pCreateInfos, |
| 5612 | const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains) { |
| 5613 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5614 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5615 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | ead9b93 | 2016-09-08 12:28:38 -0600 | [diff] [blame] | 5616 | assert(my_data != NULL); |
| 5617 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5618 | skip |= require_device_extension(my_data, my_data->enables.khr_display_swapchain_enabled, "vkCreateSharedSwapchainsKHR", |
| 5619 | VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME); |
Chris Forbes | be5f520 | 2016-11-02 18:34:25 +1300 | [diff] [blame] | 5620 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5621 | skip |= parameter_validation_vkCreateSharedSwapchainsKHR(my_data->report_data, swapchainCount, pCreateInfos, pAllocator, |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5622 | pSwapchains); |
Mark Young | ead9b93 | 2016-09-08 12:28:38 -0600 | [diff] [blame] | 5623 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 5624 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 5625 | result = my_data->dispatch_table.CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains); |
Mark Young | ead9b93 | 2016-09-08 12:28:38 -0600 | [diff] [blame] | 5626 | |
| 5627 | validate_result(my_data->report_data, "vkCreateSharedSwapchainsKHR", result); |
| 5628 | } |
| 5629 | |
| 5630 | return result; |
| 5631 | } |
| 5632 | |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5633 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 5634 | VkDisplayPropertiesKHR *pProperties) { |
| 5635 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5636 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5637 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5638 | assert(my_data != NULL); |
| 5639 | |
| 5640 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::display_enabled, |
| 5641 | "vkGetPhysicalDeviceDisplayPropertiesKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5642 | |
| 5643 | // No parameter validation function for this call? |
| 5644 | |
| 5645 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5646 | result = my_data->dispatch_table.GetPhysicalDeviceDisplayPropertiesKHR(physicalDevice, pPropertyCount, pProperties); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5647 | |
| 5648 | validate_result(my_data->report_data, "vkGetPhysicalDeviceDisplayPropertiesKHR", result); |
| 5649 | } |
| 5650 | |
| 5651 | return result; |
| 5652 | } |
| 5653 | |
| 5654 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, |
| 5655 | VkDisplayPlanePropertiesKHR *pProperties) { |
| 5656 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5657 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5658 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5659 | assert(my_data != NULL); |
| 5660 | |
| 5661 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::display_enabled, |
| 5662 | "vkGetPhysicalDeviceDisplayPlanePropertiesKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5663 | |
| 5664 | // No parameter validation function for this call? |
| 5665 | |
| 5666 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5667 | result = my_data->dispatch_table.GetPhysicalDeviceDisplayPlanePropertiesKHR(physicalDevice, pPropertyCount, pProperties); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5668 | |
| 5669 | validate_result(my_data->report_data, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR", result); |
| 5670 | } |
| 5671 | |
| 5672 | return result; |
| 5673 | } |
| 5674 | |
| 5675 | VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, |
| 5676 | uint32_t *pDisplayCount, VkDisplayKHR *pDisplays) { |
| 5677 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5678 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5679 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5680 | assert(my_data != NULL); |
| 5681 | |
| 5682 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::display_enabled, |
| 5683 | "vkGetDisplayPlaneSupportedDisplaysKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5684 | |
| 5685 | // No parameter validation function for this call? |
| 5686 | |
| 5687 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5688 | result = my_data->dispatch_table.GetDisplayPlaneSupportedDisplaysKHR(physicalDevice, planeIndex, pDisplayCount, pDisplays); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5689 | |
| 5690 | validate_result(my_data->report_data, "vkGetDisplayPlaneSupportedDisplaysKHR", result); |
| 5691 | } |
| 5692 | |
| 5693 | return result; |
| 5694 | } |
| 5695 | |
| 5696 | VKAPI_ATTR VkResult VKAPI_CALL GetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, |
| 5697 | uint32_t *pPropertyCount, VkDisplayModePropertiesKHR *pProperties) { |
| 5698 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5699 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5700 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5701 | assert(my_data != NULL); |
| 5702 | |
| 5703 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::display_enabled, |
| 5704 | "vkGetDisplayModePropertiesKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5705 | |
| 5706 | // No parameter validation function for this call? |
| 5707 | |
| 5708 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5709 | result = my_data->dispatch_table.GetDisplayModePropertiesKHR(physicalDevice, display, pPropertyCount, pProperties); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5710 | |
| 5711 | validate_result(my_data->report_data, "vkGetDisplayModePropertiesKHR", result); |
| 5712 | } |
| 5713 | |
| 5714 | return result; |
| 5715 | } |
| 5716 | |
| 5717 | VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, |
| 5718 | const VkDisplayModeCreateInfoKHR *pCreateInfo, |
| 5719 | const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode) { |
| 5720 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5721 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5722 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5723 | assert(my_data != NULL); |
| 5724 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5725 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::display_enabled, "vkCreateDisplayModeKHR", |
| 5726 | VK_KHR_DISPLAY_EXTENSION_NAME); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5727 | |
| 5728 | // No parameter validation function for this call? |
| 5729 | |
| 5730 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5731 | result = my_data->dispatch_table.CreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5732 | |
| 5733 | validate_result(my_data->report_data, "vkCreateDisplayModeKHR", result); |
| 5734 | } |
| 5735 | |
| 5736 | return result; |
| 5737 | } |
| 5738 | |
| 5739 | VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, |
| 5740 | uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR *pCapabilities) { |
| 5741 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5742 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5743 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5744 | assert(my_data != NULL); |
| 5745 | |
| 5746 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::display_enabled, |
| 5747 | "vkGetDisplayPlaneCapabilitiesKHR", VK_KHR_DISPLAY_EXTENSION_NAME); |
| 5748 | |
| 5749 | // No parameter validation function for this call? |
| 5750 | |
| 5751 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5752 | result = my_data->dispatch_table.GetDisplayPlaneCapabilitiesKHR(physicalDevice, mode, planeIndex, pCapabilities); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5753 | |
| 5754 | validate_result(my_data->report_data, "vkGetDisplayPlaneCapabilitiesKHR", result); |
| 5755 | } |
| 5756 | |
| 5757 | return result; |
| 5758 | } |
| 5759 | |
| 5760 | VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayPlaneSurfaceKHR(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR *pCreateInfo, |
| 5761 | const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { |
| 5762 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5763 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5764 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5765 | assert(my_data != NULL); |
| 5766 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5767 | skip |= require_instance_extension(instance, &instance_extension_enables::display_enabled, "vkCreateDisplayPlaneSurfaceKHR", |
| 5768 | VK_KHR_DISPLAY_EXTENSION_NAME); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5769 | |
| 5770 | // No parameter validation function for this call? |
| 5771 | |
| 5772 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 5773 | result = my_data->dispatch_table.CreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface); |
Chris Forbes | 667a521 | 2016-11-03 10:18:35 +1300 | [diff] [blame] | 5774 | |
| 5775 | validate_result(my_data->report_data, "vkCreateDisplayPlaneSurfaceKHR", result); |
| 5776 | } |
| 5777 | |
| 5778 | return result; |
| 5779 | } |
| 5780 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5781 | // Definitions for the VK_KHR_get_physical_device_properties2 extension |
| 5782 | |
| 5783 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5784 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5785 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5786 | assert(my_data != NULL); |
| 5787 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5788 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khr_get_phys_dev_properties2_enabled, |
| 5789 | "vkGetPhysicalDeviceFeatures2KHR", VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5790 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5791 | skip |= parameter_validation_vkGetPhysicalDeviceFeatures2KHR(my_data->report_data, pFeatures); |
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 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5794 | my_data->dispatch_table.GetPhysicalDeviceFeatures2KHR(physicalDevice, pFeatures); |
| 5795 | } |
| 5796 | } |
| 5797 | |
| 5798 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, |
| 5799 | VkPhysicalDeviceProperties2KHR *pProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5800 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5801 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5802 | assert(my_data != NULL); |
| 5803 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5804 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khr_get_phys_dev_properties2_enabled, |
| 5805 | "vkGetPhysicalDeviceProperties2KHR", VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5806 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5807 | skip |= parameter_validation_vkGetPhysicalDeviceProperties2KHR(my_data->report_data, pProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5808 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5809 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5810 | my_data->dispatch_table.GetPhysicalDeviceProperties2KHR(physicalDevice, pProperties); |
| 5811 | } |
| 5812 | } |
| 5813 | |
| 5814 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, |
| 5815 | VkFormatProperties2KHR *pFormatProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5816 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5817 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5818 | assert(my_data != NULL); |
| 5819 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5820 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khr_get_phys_dev_properties2_enabled, |
| 5821 | "vkGetPhysicalDeviceFormatProperties2KHR", |
| 5822 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5823 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5824 | skip |= parameter_validation_vkGetPhysicalDeviceFormatProperties2KHR(my_data->report_data, format, pFormatProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5825 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5826 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5827 | my_data->dispatch_table.GetPhysicalDeviceFormatProperties2KHR(physicalDevice, format, pFormatProperties); |
| 5828 | } |
| 5829 | } |
| 5830 | |
| 5831 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR( |
| 5832 | VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, |
| 5833 | VkImageFormatProperties2KHR *pImageFormatProperties) { |
| 5834 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5835 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5836 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5837 | assert(my_data != NULL); |
| 5838 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5839 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khr_get_phys_dev_properties2_enabled, |
| 5840 | "vkGetPhysicalDeviceImageFormatProperties2KHR", |
| 5841 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5842 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5843 | skip |= parameter_validation_vkGetPhysicalDeviceImageFormatProperties2KHR(my_data->report_data, pImageFormatInfo, |
| 5844 | pImageFormatProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5845 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5846 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5847 | result = my_data->dispatch_table.GetPhysicalDeviceImageFormatProperties2KHR(physicalDevice, pImageFormatInfo, |
| 5848 | pImageFormatProperties); |
| 5849 | validate_result(my_data->report_data, "vkGetPhysicalDeviceImageFormatProperties2KHR", result); |
| 5850 | } |
| 5851 | |
| 5852 | return result; |
| 5853 | } |
| 5854 | |
| 5855 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, |
| 5856 | uint32_t *pQueueFamilyPropertyCount, |
| 5857 | VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5858 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5859 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5860 | assert(my_data != NULL); |
| 5861 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5862 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khr_get_phys_dev_properties2_enabled, |
| 5863 | "vkGetPhysicalDeviceQueueFamilyProperties2KHR", |
| 5864 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5865 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5866 | skip |= parameter_validation_vkGetPhysicalDeviceQueueFamilyProperties2KHR(my_data->report_data, pQueueFamilyPropertyCount, |
| 5867 | pQueueFamilyProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5868 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5869 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5870 | my_data->dispatch_table.GetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice, pQueueFamilyPropertyCount, |
| 5871 | pQueueFamilyProperties); |
| 5872 | } |
| 5873 | } |
| 5874 | |
| 5875 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, |
| 5876 | VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5877 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5878 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5879 | assert(my_data != NULL); |
| 5880 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5881 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khr_get_phys_dev_properties2_enabled, |
| 5882 | "vkGetPhysicalDeviceMemoryProperties2KHR", |
| 5883 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5884 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5885 | skip |= parameter_validation_vkGetPhysicalDeviceMemoryProperties2KHR(my_data->report_data, pMemoryProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5886 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5887 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5888 | my_data->dispatch_table.GetPhysicalDeviceMemoryProperties2KHR(physicalDevice, pMemoryProperties); |
| 5889 | } |
| 5890 | } |
| 5891 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5892 | static bool PostGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, |
| 5893 | const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, |
| 5894 | uint32_t *pPropertyCount, |
| 5895 | VkSparseImageFormatProperties2KHR *pProperties) { |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5896 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5897 | if (pProperties != nullptr) { |
| 5898 | for (uint32_t i = 0; i < *pPropertyCount; ++i) { |
| 5899 | if ((pProperties[i].properties.aspectMask & (VK_IMAGE_ASPECT_COLOR_BIT | VK_IMAGE_ASPECT_DEPTH_BIT | |
| 5900 | VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_METADATA_BIT)) == 0) { |
| 5901 | log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, |
| 5902 | 1, LayerName, |
| 5903 | "vkGetPhysicalDeviceSparseImageFormatProperties2KHR parameter, VkImageAspect " |
| 5904 | "pProperties[%i].properties.aspectMask, is an " |
| 5905 | "unrecognized enumerator", |
| 5906 | i); |
| 5907 | return false; |
| 5908 | } |
| 5909 | } |
| 5910 | } |
| 5911 | return true; |
| 5912 | } |
| 5913 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5914 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 5915 | VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, |
| 5916 | VkSparseImageFormatProperties2KHR *pProperties) { |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5917 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 5918 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5919 | assert(my_data != NULL); |
| 5920 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5921 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khr_get_phys_dev_properties2_enabled, |
| 5922 | "vkGetPhysicalDeviceSparseImageFormatProperties2KHR", |
| 5923 | VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5924 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5925 | skip |= parameter_validation_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(my_data->report_data, pFormatInfo, |
| 5926 | pPropertyCount, pProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5927 | |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5928 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5929 | my_data->dispatch_table.GetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, |
| 5930 | pProperties); |
Tobin Ehlis | 3da6396 | 2017-02-06 16:44:50 -0700 | [diff] [blame] | 5931 | PostGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice, pFormatInfo, pPropertyCount, pProperties); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5932 | } |
| 5933 | } |
| 5934 | |
| 5935 | // Definitions for the VK_KHR_maintenance1 extension |
| 5936 | |
| 5937 | VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags) { |
| 5938 | bool skip_call = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5939 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 5940 | assert(my_data != NULL); |
| 5941 | |
| 5942 | skip_call |= require_device_extension(my_data, my_data->enables.khr_maintenance1, "vkTrimCommandPoolKHR", |
| 5943 | VK_KHR_MAINTENANCE1_EXTENSION_NAME); |
| 5944 | |
| 5945 | skip_call |= parameter_validation_vkTrimCommandPoolKHR(my_data->report_data, commandPool, flags); |
| 5946 | |
| 5947 | if (!skip_call) { |
| 5948 | my_data->dispatch_table.TrimCommandPoolKHR(device, commandPool, flags); |
| 5949 | } |
| 5950 | } |
| 5951 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 5952 | // Definitions for the VK_KHR_push_descriptor extension |
| 5953 | |
| 5954 | VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, |
| 5955 | VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, |
| 5956 | const VkWriteDescriptorSet *pDescriptorWrites) { |
| 5957 | bool skip_call = false; |
| 5958 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 5959 | assert(my_data != NULL); |
| 5960 | |
| 5961 | skip_call |= require_device_extension(my_data, my_data->enables.khr_push_descriptor, "vkCmdPushDescriptorSetKHR", |
| 5962 | VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); |
| 5963 | |
| 5964 | skip_call |= parameter_validation_vkCmdPushDescriptorSetKHR(my_data->report_data, pipelineBindPoint, layout, set, |
| 5965 | descriptorWriteCount, pDescriptorWrites); |
| 5966 | |
| 5967 | if (!skip_call) { |
| 5968 | my_data->dispatch_table.CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, |
| 5969 | pDescriptorWrites); |
| 5970 | } |
| 5971 | } |
| 5972 | |
| 5973 | // Definitions for the VK_KHR_descriptor_update_template extension |
| 5974 | |
| 5975 | VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR(VkDevice device, |
| 5976 | const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, |
| 5977 | const VkAllocationCallbacks *pAllocator, |
| 5978 | VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) { |
| 5979 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 5980 | bool skip_call = false; |
| 5981 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 5982 | assert(my_data != NULL); |
| 5983 | |
| 5984 | skip_call |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, |
| 5985 | "vkCreateDescriptorUpdateTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); |
| 5986 | |
| 5987 | skip_call |= parameter_validation_vkCreateDescriptorUpdateTemplateKHR(my_data->report_data, pCreateInfo, pAllocator, |
| 5988 | pDescriptorUpdateTemplate); |
| 5989 | |
| 5990 | if (!skip_call) { |
| 5991 | result = |
| 5992 | my_data->dispatch_table.CreateDescriptorUpdateTemplateKHR(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| 5993 | validate_result(my_data->report_data, "vkCreateDescriptorUpdateTemplateKHR", result); |
| 5994 | } |
| 5995 | |
| 5996 | return result; |
| 5997 | } |
| 5998 | |
| 5999 | VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR(VkDevice device, |
| 6000 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, |
| 6001 | const VkAllocationCallbacks *pAllocator) { |
| 6002 | bool skip_call = false; |
| 6003 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6004 | assert(my_data != NULL); |
| 6005 | |
| 6006 | skip_call |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, |
| 6007 | "vkDestroyDescriptorUpdateTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); |
| 6008 | |
| 6009 | #if 0 // Validation not automatically generated |
| 6010 | skip_call |= parameter_validation_vkDestroyDescriptorUpdateTemplateKHR(my_data->report_data, descriptorUpdateTemplate, |
| 6011 | pAllocator); |
| 6012 | #endif |
| 6013 | |
| 6014 | if (!skip_call) { |
| 6015 | my_data->dispatch_table.DestroyDescriptorUpdateTemplateKHR(device, descriptorUpdateTemplate, pAllocator); |
| 6016 | } |
| 6017 | } |
| 6018 | |
| 6019 | VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, |
| 6020 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, |
| 6021 | const void *pData) { |
| 6022 | bool skip_call = false; |
| 6023 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6024 | assert(my_data != NULL); |
| 6025 | |
| 6026 | skip_call |= require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, |
| 6027 | "vkUpdateDescriptorSetWithTemplateKHR", VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); |
| 6028 | |
| 6029 | skip_call |= parameter_validation_vkUpdateDescriptorSetWithTemplateKHR(my_data->report_data, descriptorSet, |
| 6030 | descriptorUpdateTemplate, pData); |
| 6031 | |
| 6032 | if (!skip_call) { |
| 6033 | my_data->dispatch_table.UpdateDescriptorSetWithTemplateKHR(device, descriptorSet, descriptorUpdateTemplate, pData); |
| 6034 | } |
| 6035 | } |
| 6036 | |
| 6037 | VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, |
| 6038 | VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, |
| 6039 | VkPipelineLayout layout, uint32_t set, const void *pData) { |
| 6040 | bool skip_call = false; |
| 6041 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6042 | assert(my_data != NULL); |
| 6043 | |
| 6044 | skip_call |= |
| 6045 | require_device_extension(my_data, my_data->enables.khr_descriptor_update_template, "vkCmdPushDescriptorSetWithTemplateKHR", |
| 6046 | VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME); |
| 6047 | |
| 6048 | skip_call |= parameter_validation_vkCmdPushDescriptorSetWithTemplateKHR(my_data->report_data, descriptorUpdateTemplate, layout, |
| 6049 | set, pData); |
| 6050 | |
| 6051 | if (!skip_call) { |
| 6052 | my_data->dispatch_table.CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, pData); |
| 6053 | } |
| 6054 | } |
| 6055 | |
| 6056 | // Definitions for the VK_KHX_device_group_creation extension |
| 6057 | |
| 6058 | VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHX( |
| 6059 | VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupPropertiesKHX *pPhysicalDeviceGroupProperties) { |
| 6060 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6061 | bool skip_call = false; |
| 6062 | auto my_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
| 6063 | assert(my_data != NULL); |
| 6064 | |
| 6065 | skip_call |= require_instance_extension(instance, &instance_extension_enables::khx_device_group_creation_enabled, |
| 6066 | "vkEnumeratePhysicalDeviceGroupsKHX", VK_KHX_DEVICE_GROUP_CREATION_EXTENSION_NAME); |
| 6067 | |
| 6068 | skip_call |= parameter_validation_vkEnumeratePhysicalDeviceGroupsKHX(my_data->report_data, pPhysicalDeviceGroupCount, |
| 6069 | pPhysicalDeviceGroupProperties); |
| 6070 | |
| 6071 | if (!skip_call) { |
| 6072 | result = my_data->dispatch_table.EnumeratePhysicalDeviceGroupsKHX(instance, pPhysicalDeviceGroupCount, |
| 6073 | pPhysicalDeviceGroupProperties); |
| 6074 | validate_result(my_data->report_data, "vkEnumeratePhysicalDeviceGroupsKHX", result); |
| 6075 | } |
| 6076 | return result; |
| 6077 | } |
| 6078 | |
| 6079 | // Definitions for the VK_KHX_device_group extension |
| 6080 | |
| 6081 | VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeaturesKHX(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, |
| 6082 | uint32_t remoteDeviceIndex, |
| 6083 | VkPeerMemoryFeatureFlagsKHX *pPeerMemoryFeatures) { |
| 6084 | bool skip_call = false; |
| 6085 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6086 | assert(my_data != NULL); |
| 6087 | |
| 6088 | skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupPeerMemoryFeaturesKHX", |
| 6089 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
| 6090 | |
| 6091 | skip_call |= parameter_validation_vkGetDeviceGroupPeerMemoryFeaturesKHX(my_data->report_data, heapIndex, localDeviceIndex, |
| 6092 | remoteDeviceIndex, pPeerMemoryFeatures); |
| 6093 | |
| 6094 | if (!skip_call) { |
| 6095 | my_data->dispatch_table.GetDeviceGroupPeerMemoryFeaturesKHX(device, heapIndex, localDeviceIndex, remoteDeviceIndex, |
| 6096 | pPeerMemoryFeatures); |
| 6097 | } |
| 6098 | } |
| 6099 | |
| 6100 | VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHX(VkDevice device, uint32_t bindInfoCount, |
| 6101 | const VkBindBufferMemoryInfoKHX *pBindInfos) { |
| 6102 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6103 | bool skip_call = false; |
| 6104 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6105 | assert(my_data != NULL); |
| 6106 | |
| 6107 | skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkBindBufferMemory2KHX", |
| 6108 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
| 6109 | |
| 6110 | skip_call |= parameter_validation_vkBindBufferMemory2KHX(my_data->report_data, bindInfoCount, pBindInfos); |
| 6111 | |
| 6112 | if (!skip_call) { |
| 6113 | result = my_data->dispatch_table.BindBufferMemory2KHX(device, bindInfoCount, pBindInfos); |
| 6114 | validate_result(my_data->report_data, "vkBindBufferMemory2KHX", result); |
| 6115 | } |
| 6116 | |
| 6117 | return result; |
| 6118 | } |
| 6119 | |
| 6120 | VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHX(VkDevice device, uint32_t bindInfoCount, |
| 6121 | const VkBindImageMemoryInfoKHX *pBindInfos) { |
| 6122 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6123 | bool skip_call = false; |
| 6124 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6125 | assert(my_data != NULL); |
| 6126 | |
| 6127 | skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkBindImageMemory2KHX", |
| 6128 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
| 6129 | |
| 6130 | skip_call |= parameter_validation_vkBindImageMemory2KHX(my_data->report_data, bindInfoCount, pBindInfos); |
| 6131 | |
| 6132 | if (!skip_call) { |
| 6133 | result = my_data->dispatch_table.BindImageMemory2KHX(device, bindInfoCount, pBindInfos); |
| 6134 | validate_result(my_data->report_data, "vkBindImageMemory2KHX", result); |
| 6135 | } |
| 6136 | |
| 6137 | return result; |
| 6138 | } |
| 6139 | |
| 6140 | VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMaskKHX(VkCommandBuffer commandBuffer, uint32_t deviceMask) { |
| 6141 | bool skip_call = false; |
| 6142 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6143 | assert(my_data != NULL); |
| 6144 | |
| 6145 | skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkCmdSetDeviceMaskKHX", |
| 6146 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
| 6147 | |
| 6148 | #if 0 // Validation not automatically generated |
| 6149 | skip_call |= parameter_validation_vkCmdSetDeviceMaskKHX(my_data->report_data, deviceMask); |
| 6150 | #endif |
| 6151 | |
| 6152 | if (!skip_call) { |
| 6153 | my_data->dispatch_table.CmdSetDeviceMaskKHX(commandBuffer, deviceMask); |
| 6154 | } |
| 6155 | } |
| 6156 | |
| 6157 | VKAPI_ATTR VkResult VKAPI_CALL |
| 6158 | GetDeviceGroupPresentCapabilitiesKHX(VkDevice device, VkDeviceGroupPresentCapabilitiesKHX *pDeviceGroupPresentCapabilities) { |
| 6159 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6160 | bool skip_call = false; |
| 6161 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6162 | assert(my_data != NULL); |
| 6163 | |
| 6164 | skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupPresentCapabilitiesKHX", |
| 6165 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
| 6166 | |
| 6167 | skip_call |= parameter_validation_vkGetDeviceGroupPresentCapabilitiesKHX(my_data->report_data, pDeviceGroupPresentCapabilities); |
| 6168 | |
| 6169 | if (!skip_call) { |
| 6170 | result = my_data->dispatch_table.GetDeviceGroupPresentCapabilitiesKHX(device, pDeviceGroupPresentCapabilities); |
| 6171 | validate_result(my_data->report_data, "vkGetDeviceGroupPresentCapabilitiesKHX", result); |
| 6172 | } |
| 6173 | |
| 6174 | return result; |
| 6175 | } |
| 6176 | |
| 6177 | VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModesKHX(VkDevice device, VkSurfaceKHR surface, |
| 6178 | VkDeviceGroupPresentModeFlagsKHX *pModes) { |
| 6179 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6180 | bool skip_call = false; |
| 6181 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6182 | assert(my_data != NULL); |
| 6183 | |
| 6184 | skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkGetDeviceGroupSurfacePresentModesKHX", |
| 6185 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
| 6186 | |
| 6187 | skip_call |= parameter_validation_vkGetDeviceGroupSurfacePresentModesKHX(my_data->report_data, surface, pModes); |
| 6188 | |
| 6189 | if (!skip_call) { |
| 6190 | result = my_data->dispatch_table.GetDeviceGroupSurfacePresentModesKHX(device, surface, pModes); |
| 6191 | validate_result(my_data->report_data, "vkGetDeviceGroupSurfacePresentModesKHX", result); |
| 6192 | } |
| 6193 | return result; |
| 6194 | } |
| 6195 | |
| 6196 | VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImage2KHX(VkDevice device, const VkAcquireNextImageInfoKHX *pAcquireInfo, |
| 6197 | uint32_t *pImageIndex) { |
| 6198 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6199 | bool skip_call = false; |
| 6200 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6201 | assert(my_data != NULL); |
| 6202 | |
| 6203 | skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkAcquireNextImage2KHX", |
| 6204 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
| 6205 | |
| 6206 | skip_call |= parameter_validation_vkAcquireNextImage2KHX(my_data->report_data, pAcquireInfo, pImageIndex); |
| 6207 | |
| 6208 | if (!skip_call) { |
| 6209 | result = my_data->dispatch_table.AcquireNextImage2KHX(device, pAcquireInfo, pImageIndex); |
| 6210 | validate_result(my_data->report_data, "vkAcquireNextImage2KHX", result); |
| 6211 | } |
| 6212 | return result; |
| 6213 | } |
| 6214 | |
| 6215 | VKAPI_ATTR void VKAPI_CALL CmdDispatchBaseKHX(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, |
| 6216 | uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, |
| 6217 | uint32_t groupCountZ) { |
| 6218 | bool skip_call = false; |
| 6219 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6220 | assert(my_data != NULL); |
| 6221 | |
| 6222 | skip_call |= require_device_extension(my_data, my_data->enables.khx_device_group, "vkCmdDispatchBaseKHX", |
| 6223 | VK_KHX_DEVICE_GROUP_EXTENSION_NAME); |
| 6224 | |
| 6225 | #if 0 // Validation not automatically generated |
| 6226 | skip_call |= parameter_validation_vkCmdDispatchBaseKHX(my_data->report_data, baseGroupX, baseGroupY, baseGroupZ, |
| 6227 | groupCountX, groupCountY, groupCountZ); |
| 6228 | #endif |
| 6229 | |
| 6230 | if (!skip_call) { |
| 6231 | my_data->dispatch_table.CmdDispatchBaseKHX(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, |
| 6232 | groupCountZ); |
| 6233 | } |
| 6234 | } |
| 6235 | |
| 6236 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDevicePresentRectanglesKHX(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 6237 | uint32_t *pRectCount, VkRect2D *pRects) { |
| 6238 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6239 | bool skip = false; |
| 6240 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
| 6241 | assert(my_data != NULL); |
| 6242 | |
| 6243 | skip |= parameter_validation_vkGetPhysicalDevicePresentRectanglesKHX(my_data->report_data, surface, pRectCount, pRects); |
| 6244 | |
| 6245 | if (!skip) { |
| 6246 | result = my_data->dispatch_table.GetPhysicalDevicePresentRectanglesKHX(physicalDevice, surface, pRectCount, pRects); |
| 6247 | |
| 6248 | validate_result(my_data->report_data, "vkGetPhysicalDevicePresentRectanglesKHX", result); |
| 6249 | } |
| 6250 | |
| 6251 | return result; |
| 6252 | } |
| 6253 | |
| 6254 | // Definitions for the VK_KHX_external_memory_capabilities extension |
| 6255 | |
| 6256 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHX( |
| 6257 | VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfoKHX *pExternalBufferInfo, |
| 6258 | VkExternalBufferPropertiesKHX *pExternalBufferProperties) { |
| 6259 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
| 6260 | assert(my_data != NULL); |
| 6261 | bool skip = false; |
| 6262 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khx_external_memory_capabilities_enabled, |
| 6263 | "vkGetPhysicalDeviceExternalBufferPropertiesKHX", |
| 6264 | VK_KHX_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); |
| 6265 | skip |= parameter_validation_vkGetPhysicalDeviceExternalBufferPropertiesKHX(my_data->report_data, pExternalBufferInfo, |
| 6266 | pExternalBufferProperties); |
| 6267 | if (!skip) { |
| 6268 | my_data->dispatch_table.GetPhysicalDeviceExternalBufferPropertiesKHX(physicalDevice, pExternalBufferInfo, |
| 6269 | pExternalBufferProperties); |
| 6270 | } |
| 6271 | } |
| 6272 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6273 | // Definitions for the VK_KHX_external_memory_fd extension |
| 6274 | |
| 6275 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdKHX(VkDevice device, VkDeviceMemory memory, |
| 6276 | VkExternalMemoryHandleTypeFlagBitsKHX handleType, int *pFd) { |
| 6277 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6278 | bool skip_call = false; |
| 6279 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6280 | assert(my_data != NULL); |
| 6281 | |
| 6282 | skip_call |= require_device_extension(my_data, my_data->enables.khx_external_memory_fd, "vkGetMemoryFdKHX", |
| 6283 | VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME); |
| 6284 | |
| 6285 | skip_call |= parameter_validation_vkGetMemoryFdKHX(my_data->report_data, memory, handleType, pFd); |
| 6286 | |
| 6287 | if (!skip_call) { |
| 6288 | result = my_data->dispatch_table.GetMemoryFdKHX(device, memory, handleType, pFd); |
| 6289 | validate_result(my_data->report_data, "vkGetMemoryFdKHX", result); |
| 6290 | } |
| 6291 | |
| 6292 | return result; |
| 6293 | } |
| 6294 | |
| 6295 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdPropertiesKHX(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, int fd, |
| 6296 | VkMemoryFdPropertiesKHX *pMemoryFdProperties) { |
| 6297 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6298 | bool skip_call = false; |
| 6299 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6300 | assert(my_data != NULL); |
| 6301 | |
| 6302 | skip_call |= require_device_extension(my_data, my_data->enables.khx_external_memory_fd, "vkGetMemoryFdPropertiesKHX", |
| 6303 | VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME); |
| 6304 | |
| 6305 | skip_call |= parameter_validation_vkGetMemoryFdPropertiesKHX(my_data->report_data, handleType, fd, pMemoryFdProperties); |
| 6306 | |
| 6307 | if (!skip_call) { |
| 6308 | result = my_data->dispatch_table.GetMemoryFdPropertiesKHX(device, handleType, fd, pMemoryFdProperties); |
| 6309 | validate_result(my_data->report_data, "vkGetMemoryFdPropertiesKHX", result); |
| 6310 | } |
| 6311 | |
| 6312 | return result; |
| 6313 | } |
| 6314 | |
| 6315 | // Definitions for the VK_KHX_external_memory_win32 extension |
| 6316 | |
| 6317 | #ifdef VK_USE_PLATFORM_WIN32_KHX |
| 6318 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleKHX(VkDevice device, VkDeviceMemory memory, |
| 6319 | VkExternalMemoryHandleTypeFlagBitsKHX handleType, HANDLE *pHandle) { |
| 6320 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6321 | bool skip_call = false; |
| 6322 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6323 | assert(my_data != NULL); |
| 6324 | skip_call |= require_device_extension(my_data, my_data->enables.khx_external_memory_win32, "vkGetMemoryWin32HandleKHX", |
| 6325 | VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); |
| 6326 | |
| 6327 | skip_call |= parameter_validation_vkGetMemoryWin32HandleKHX(my_data->report_data, memory, handleType, pHandle); |
| 6328 | |
| 6329 | if (!skip_call) { |
| 6330 | result = my_data->dispatch_table.GetMemoryWin32HandleKHX(device, memory, handleType, pHandle); |
| 6331 | validate_result(my_data->report_data, "vkGetMemoryWin32HandleKHX", result); |
| 6332 | } |
| 6333 | return result; |
| 6334 | } |
| 6335 | |
| 6336 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHX(VkDevice device, VkExternalMemoryHandleTypeFlagBitsKHX handleType, |
| 6337 | HANDLE handle, |
| 6338 | VkMemoryWin32HandlePropertiesKHX *pMemoryWin32HandleProperties) { |
| 6339 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6340 | bool skip_call = false; |
| 6341 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6342 | assert(my_data != NULL); |
| 6343 | skip_call |= require_device_extension(my_data, my_data->enables.khx_external_memory_win32, |
| 6344 | "vkGetMemoryWin32HandlePropertiesKHX", VK_KHX_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); |
| 6345 | |
| 6346 | skip_call |= parameter_validation_vkGetMemoryWin32HandlePropertiesKHX(my_data->report_data, handleType, handle, |
| 6347 | pMemoryWin32HandleProperties); |
| 6348 | |
| 6349 | if (!skip_call) { |
| 6350 | result = |
| 6351 | my_data->dispatch_table.GetMemoryWin32HandlePropertiesKHX(device, handleType, handle, pMemoryWin32HandleProperties); |
| 6352 | validate_result(my_data->report_data, "vkGetMemoryWin32HandlePropertiesKHX", result); |
| 6353 | } |
| 6354 | return result; |
| 6355 | } |
| 6356 | #endif // VK_USE_PLATFORM_WIN32_KHX |
| 6357 | |
| 6358 | // Definitions for the VK_KHX_external_semaphore_capabilities extension |
| 6359 | |
| 6360 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHX( |
| 6361 | VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHX *pExternalSemaphoreInfo, |
| 6362 | VkExternalSemaphorePropertiesKHX *pExternalSemaphoreProperties) { |
| 6363 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
| 6364 | assert(my_data != NULL); |
| 6365 | bool skip = false; |
| 6366 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::khx_external_memory_capabilities_enabled, |
| 6367 | "vkGetPhysicalDeviceExternalSemaphorePropertiesKHX", |
| 6368 | VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME); |
| 6369 | skip |= parameter_validation_vkGetPhysicalDeviceExternalSemaphorePropertiesKHX(my_data->report_data, pExternalSemaphoreInfo, |
| 6370 | pExternalSemaphoreProperties); |
| 6371 | if (!skip) { |
| 6372 | my_data->dispatch_table.GetPhysicalDeviceExternalSemaphorePropertiesKHX(physicalDevice, pExternalSemaphoreInfo, |
| 6373 | pExternalSemaphoreProperties); |
| 6374 | } |
| 6375 | } |
| 6376 | |
| 6377 | // Definitions for the VK_KHX_external_semaphore_fd extension |
| 6378 | |
| 6379 | VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreFdKHX(VkDevice device, const VkImportSemaphoreFdInfoKHX *pImportSemaphoreFdInfo) { |
| 6380 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6381 | bool skip_call = false; |
| 6382 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6383 | assert(my_data != NULL); |
| 6384 | |
| 6385 | skip_call |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_fd, "vkImportSemaphoreFdKHX", |
| 6386 | VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME); |
| 6387 | |
| 6388 | skip_call |= parameter_validation_vkImportSemaphoreFdKHX(my_data->report_data, pImportSemaphoreFdInfo); |
| 6389 | |
| 6390 | if (!skip_call) { |
| 6391 | result = my_data->dispatch_table.ImportSemaphoreFdKHX(device, pImportSemaphoreFdInfo); |
| 6392 | validate_result(my_data->report_data, "vkImportSemaphoreFdKHX", result); |
| 6393 | } |
| 6394 | |
| 6395 | return result; |
| 6396 | } |
| 6397 | |
| 6398 | VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreFdKHX(VkDevice device, VkSemaphore semaphore, |
| 6399 | VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, int *pFd) { |
| 6400 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6401 | bool skip_call = false; |
| 6402 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6403 | assert(my_data != NULL); |
| 6404 | |
| 6405 | skip_call |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_fd, "vkGetSemaphoreFdKHX", |
| 6406 | VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME); |
| 6407 | |
| 6408 | skip_call |= parameter_validation_vkGetSemaphoreFdKHX(my_data->report_data, semaphore, handleType, pFd); |
| 6409 | |
| 6410 | if (!skip_call) { |
| 6411 | result = my_data->dispatch_table.GetSemaphoreFdKHX(device, semaphore, handleType, pFd); |
| 6412 | validate_result(my_data->report_data, "vkGetSemaphoreFdKHX", result); |
| 6413 | } |
| 6414 | |
| 6415 | return result; |
| 6416 | } |
| 6417 | |
| 6418 | // Definitions for the VK_KHX_external_semaphore_win32 extension |
| 6419 | |
| 6420 | #ifdef VK_USE_PLATFORM_WIN32_KHX |
| 6421 | VKAPI_ATTR VkResult VKAPI_CALL |
| 6422 | ImportSemaphoreWin32HandleKHX(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHX *pImportSemaphoreWin32HandleInfo) { |
| 6423 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6424 | bool skip_call = false; |
| 6425 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6426 | assert(my_data != NULL); |
| 6427 | skip_call |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_win32, "vkImportSemaphoreWin32HandleKHX", |
| 6428 | VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); |
| 6429 | |
| 6430 | skip_call |= parameter_validation_vkImportSemaphoreWin32HandleKHX(my_data->report_data, pImportSemaphoreWin32HandleInfo); |
| 6431 | if (!skip_call) { |
| 6432 | result = my_data->dispatch_table.ImportSemaphoreWin32HandleKHX(device, pImportSemaphoreWin32HandleInfo); |
| 6433 | validate_result(my_data->report_data, "vkImportSemaphoreWin32HandleKHX", result); |
| 6434 | } |
| 6435 | return result; |
| 6436 | } |
| 6437 | |
| 6438 | VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreWin32HandleKHX(VkDevice device, VkSemaphore semaphore, |
| 6439 | VkExternalSemaphoreHandleTypeFlagBitsKHX handleType, HANDLE *pHandle) { |
| 6440 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6441 | bool skip_call = false; |
| 6442 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6443 | assert(my_data != NULL); |
| 6444 | skip_call |= require_device_extension(my_data, my_data->enables.khx_external_semaphore_win32, "vkGetSemaphoreWin32HandleKHX", |
| 6445 | VK_KHX_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); |
| 6446 | skip_call |= parameter_validation_vkGetSemaphoreWin32HandleKHX(my_data->report_data, semaphore, handleType, pHandle); |
| 6447 | if (!skip_call) { |
| 6448 | result = my_data->dispatch_table.GetSemaphoreWin32HandleKHX(device, semaphore, handleType, pHandle); |
| 6449 | validate_result(my_data->report_data, "vkGetSemaphoreWin32HandleKHX", result); |
| 6450 | } |
| 6451 | return result; |
| 6452 | } |
| 6453 | #endif // VK_USE_PLATFORM_WIN32_KHX |
| 6454 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6455 | // Definitions for the VK_EXT_acquire_xlib_display extension |
| 6456 | |
| 6457 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT |
| 6458 | VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, VkDisplayKHR display) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6459 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6460 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6461 | assert(my_data != NULL); |
| 6462 | bool skip = false; |
| 6463 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::ext_acquire_xlib_display_enabled, |
| 6464 | "vkAcquireXlibDisplayEXT", VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME); |
| 6465 | skip |= parameter_validation_vkAcquireXlibDisplayEXT(my_data->report_data, dpy, display); |
| 6466 | if (!skip) { |
| 6467 | result = my_data->dispatch_table.AcquireXlibDisplayEXT(physicalDevice, dpy, display); |
| 6468 | validate_result(my_data->report_data, "vkAcquireXlibDisplayEXT", result); |
| 6469 | } |
| 6470 | return result; |
| 6471 | } |
| 6472 | |
| 6473 | VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display *dpy, RROutput rrOutput, |
| 6474 | VkDisplayKHR *pDisplay) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6475 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6476 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6477 | assert(my_data != NULL); |
| 6478 | bool skip = false; |
| 6479 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::ext_acquire_xlib_display_enabled, |
| 6480 | "vkGetRandROutputDisplayEXT", VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME); |
| 6481 | skip |= parameter_validation_vkGetRandROutputDisplayEXT(my_data->report_data, dpy, rrOutput, pDisplay); |
| 6482 | if (!skip) { |
| 6483 | result = my_data->dispatch_table.GetRandROutputDisplayEXT(physicalDevice, dpy, rrOutput, pDisplay); |
| 6484 | validate_result(my_data->report_data, "vkGetRandROutputDisplayEXT", result); |
| 6485 | } |
| 6486 | return result; |
| 6487 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6488 | #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6489 | |
| 6490 | // Definitions for the VK_EXT_debug_marker Extension |
| 6491 | |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6492 | VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT(VkDevice device, VkDebugMarkerObjectTagInfoEXT *pTagInfo) { |
| 6493 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6494 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6495 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6496 | assert(my_data != NULL); |
| 6497 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6498 | skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkDebugMarkerSetObjectTagEXT", |
| 6499 | VK_EXT_DEBUG_MARKER_EXTENSION_NAME); |
| 6500 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6501 | skip |= parameter_validation_vkDebugMarkerSetObjectTagEXT(my_data->report_data, pTagInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6502 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6503 | if (!skip) { |
Tobin Ehlis | 8ad4193 | 2016-12-01 09:37:56 -0700 | [diff] [blame] | 6504 | if (my_data->dispatch_table.DebugMarkerSetObjectTagEXT) { |
| 6505 | result = my_data->dispatch_table.DebugMarkerSetObjectTagEXT(device, pTagInfo); |
| 6506 | validate_result(my_data->report_data, "vkDebugMarkerSetObjectTagEXT", result); |
| 6507 | } else { |
| 6508 | result = VK_SUCCESS; |
| 6509 | } |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6510 | } |
| 6511 | |
| 6512 | return result; |
| 6513 | } |
| 6514 | |
| 6515 | VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT *pNameInfo) { |
| 6516 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6517 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6518 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6519 | assert(my_data != NULL); |
| 6520 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6521 | skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkDebugMarkerSetObjectNameEXT", |
| 6522 | VK_EXT_DEBUG_MARKER_EXTENSION_NAME); |
| 6523 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6524 | skip |= parameter_validation_vkDebugMarkerSetObjectNameEXT(my_data->report_data, pNameInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6525 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6526 | if (!skip) { |
Tobin Ehlis | 8ad4193 | 2016-12-01 09:37:56 -0700 | [diff] [blame] | 6527 | if (my_data->dispatch_table.DebugMarkerSetObjectNameEXT) { |
| 6528 | result = my_data->dispatch_table.DebugMarkerSetObjectNameEXT(device, pNameInfo); |
| 6529 | validate_result(my_data->report_data, "vkDebugMarkerSetObjectNameEXT", result); |
| 6530 | } else { |
| 6531 | result = VK_SUCCESS; |
| 6532 | } |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6533 | } |
| 6534 | |
| 6535 | return result; |
| 6536 | } |
| 6537 | |
| 6538 | VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6539 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6540 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6541 | assert(my_data != NULL); |
| 6542 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6543 | skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkCmdDebugMarkerBeginEXT", |
| 6544 | VK_EXT_DEBUG_MARKER_EXTENSION_NAME); |
| 6545 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6546 | skip |= parameter_validation_vkCmdDebugMarkerBeginEXT(my_data->report_data, pMarkerInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6547 | |
Tobin Ehlis | 8ad4193 | 2016-12-01 09:37:56 -0700 | [diff] [blame] | 6548 | if (!skip && my_data->dispatch_table.CmdDebugMarkerBeginEXT) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 6549 | my_data->dispatch_table.CmdDebugMarkerBeginEXT(commandBuffer, pMarkerInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6550 | } |
| 6551 | } |
| 6552 | |
| 6553 | VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, VkDebugMarkerMarkerInfoEXT *pMarkerInfo) { |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6554 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6555 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6556 | assert(my_data != NULL); |
| 6557 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6558 | skip |= require_device_extension(my_data, my_data->enables.ext_debug_marker, "vkCmdDebugMarkerInsertEXT", |
| 6559 | VK_EXT_DEBUG_MARKER_EXTENSION_NAME); |
| 6560 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6561 | skip |= parameter_validation_vkCmdDebugMarkerInsertEXT(my_data->report_data, pMarkerInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6562 | |
Tobin Ehlis | 8ad4193 | 2016-12-01 09:37:56 -0700 | [diff] [blame] | 6563 | if (!skip && my_data->dispatch_table.CmdDebugMarkerInsertEXT) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 6564 | my_data->dispatch_table.CmdDebugMarkerInsertEXT(commandBuffer, pMarkerInfo); |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6565 | } |
| 6566 | } |
| 6567 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6568 | // Definitions for the VK_EXT_direct_mode_display extension |
| 6569 | |
| 6570 | VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6571 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6572 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6573 | assert(my_data != NULL); |
| 6574 | bool skip = false; |
| 6575 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::ext_direct_mode_display_enabled, |
| 6576 | "vkReleaseDisplayEXT", VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME); |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6577 | #if 0 // Validation not automatically generated |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6578 | skip |= parameter_validation_vkReleaseDisplayEXT(my_data->report_data, display); |
| 6579 | #endif |
| 6580 | if (!skip) { |
| 6581 | result = my_data->dispatch_table.ReleaseDisplayEXT(physicalDevice, display); |
| 6582 | validate_result(my_data->report_data, "vkGetRandROutputDisplayEXT", result); |
| 6583 | } |
| 6584 | return result; |
| 6585 | } |
| 6586 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6587 | // Definitions for the VK_EXT_discard_rectangles extension |
| 6588 | |
| 6589 | VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, |
| 6590 | uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) { |
| 6591 | bool skip = false; |
| 6592 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6593 | assert(my_data != NULL); |
| 6594 | |
| 6595 | skip |= require_device_extension(my_data, my_data->enables.ext_discard_rectangles, "vkCmdSetDiscardRectangleEXT", |
| 6596 | VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME); |
| 6597 | |
| 6598 | skip |= parameter_validation_vkCmdSetDiscardRectangleEXT(my_data->report_data, firstDiscardRectangle, |
| 6599 | discardRectangleCount, pDiscardRectangles); |
| 6600 | |
| 6601 | if (!skip && my_data->dispatch_table.CmdSetDiscardRectangleEXT) { |
| 6602 | my_data->dispatch_table.CmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, |
| 6603 | pDiscardRectangles); |
| 6604 | } |
| 6605 | } |
| 6606 | |
| 6607 | // Definitions for the VK_EXT_display_control extension |
| 6608 | |
| 6609 | VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, |
| 6610 | const VkDisplayPowerInfoEXT *pDisplayPowerInfo) { |
| 6611 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6612 | bool skip = false; |
| 6613 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6614 | assert(my_data != NULL); |
| 6615 | |
| 6616 | skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkDisplayPowerControlEXT", |
| 6617 | VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); |
| 6618 | |
| 6619 | skip |= parameter_validation_vkDisplayPowerControlEXT(my_data->report_data, display, pDisplayPowerInfo); |
| 6620 | |
| 6621 | if (!skip) { |
| 6622 | if (my_data->dispatch_table.DisplayPowerControlEXT) { |
| 6623 | result = my_data->dispatch_table.DisplayPowerControlEXT(device, display, pDisplayPowerInfo); |
| 6624 | validate_result(my_data->report_data, "vkDisplayPowerControlEXT", result); |
| 6625 | } else { |
| 6626 | result = VK_SUCCESS; |
| 6627 | } |
| 6628 | } |
| 6629 | |
| 6630 | return result; |
| 6631 | } |
| 6632 | |
| 6633 | VKAPI_ATTR VkResult VKAPI_CALL RegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT *pDeviceEventInfo, |
| 6634 | const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
| 6635 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6636 | bool skip = false; |
| 6637 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6638 | assert(my_data != NULL); |
| 6639 | |
| 6640 | skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkRegisterDeviceEventEXT", |
| 6641 | VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); |
| 6642 | |
| 6643 | skip |= parameter_validation_vkRegisterDeviceEventEXT(my_data->report_data, pDeviceEventInfo, pAllocator, pFence); |
| 6644 | |
| 6645 | if (!skip) { |
| 6646 | if (my_data->dispatch_table.RegisterDeviceEventEXT) { |
| 6647 | result = my_data->dispatch_table.RegisterDeviceEventEXT(device, pDeviceEventInfo, pAllocator, pFence); |
| 6648 | validate_result(my_data->report_data, "vkRegisterDeviceEventEXT", result); |
| 6649 | } else { |
| 6650 | result = VK_SUCCESS; |
| 6651 | } |
| 6652 | } |
| 6653 | |
| 6654 | return result; |
| 6655 | } |
| 6656 | |
| 6657 | VKAPI_ATTR VkResult VKAPI_CALL RegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display, |
| 6658 | const VkDisplayEventInfoEXT *pDisplayEventInfo, |
| 6659 | const VkAllocationCallbacks *pAllocator, VkFence *pFence) { |
| 6660 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6661 | bool skip = false; |
| 6662 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6663 | assert(my_data != NULL); |
| 6664 | |
| 6665 | skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkRegisterDisplayEventEXT", |
| 6666 | VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); |
| 6667 | |
| 6668 | skip |= parameter_validation_vkRegisterDisplayEventEXT(my_data->report_data, display, pDisplayEventInfo, pAllocator, pFence); |
| 6669 | |
| 6670 | if (!skip) { |
| 6671 | if (my_data->dispatch_table.RegisterDisplayEventEXT) { |
| 6672 | result = my_data->dispatch_table.RegisterDisplayEventEXT(device, display, pDisplayEventInfo, pAllocator, pFence); |
| 6673 | validate_result(my_data->report_data, "vkRegisterDisplayEventEXT", result); |
| 6674 | } else { |
| 6675 | result = VK_SUCCESS; |
| 6676 | } |
| 6677 | } |
| 6678 | |
| 6679 | return result; |
| 6680 | } |
| 6681 | |
| 6682 | VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain, |
| 6683 | VkSurfaceCounterFlagBitsEXT counter, uint64_t *pCounterValue) { |
| 6684 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6685 | bool skip = false; |
| 6686 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6687 | assert(my_data != NULL); |
| 6688 | |
| 6689 | skip |= require_device_extension(my_data, my_data->enables.ext_display_control, "vkGetSwapchainCounterEXT", |
| 6690 | VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME); |
| 6691 | |
| 6692 | skip |= parameter_validation_vkGetSwapchainCounterEXT(my_data->report_data, swapchain, counter, pCounterValue); |
| 6693 | |
| 6694 | if (!skip) { |
| 6695 | if (my_data->dispatch_table.GetSwapchainCounterEXT) { |
| 6696 | result = my_data->dispatch_table.GetSwapchainCounterEXT(device, swapchain, counter, pCounterValue); |
| 6697 | validate_result(my_data->report_data, "vkGetSwapchainCounterEXT", result); |
| 6698 | } else { |
| 6699 | result = VK_SUCCESS; |
| 6700 | } |
| 6701 | } |
| 6702 | |
| 6703 | return result; |
| 6704 | } |
| 6705 | |
| 6706 | // Definitions for the VK_AMD_draw_indirect_count extension |
| 6707 | |
| 6708 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 6709 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 6710 | uint32_t stride) { |
| 6711 | bool skip = false; |
| 6712 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6713 | assert(my_data != NULL); |
| 6714 | skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdDrawIndirectCountAMD", |
| 6715 | VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME); |
| 6716 | skip |= parameter_validation_vkCmdDrawIndirectCountAMD(my_data->report_data, buffer, offset, countBuffer, countBufferOffset, |
| 6717 | maxDrawCount, stride); |
| 6718 | if (!skip) { |
| 6719 | my_data->dispatch_table.CmdDrawIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, |
| 6720 | stride); |
| 6721 | } |
| 6722 | } |
| 6723 | |
| 6724 | VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 6725 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
| 6726 | uint32_t maxDrawCount, uint32_t stride) { |
| 6727 | bool skip = false; |
| 6728 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6729 | assert(my_data != NULL); |
| 6730 | skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdDrawIndexedIndirectCountAMD", |
| 6731 | VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME); |
| 6732 | skip |= parameter_validation_vkCmdDrawIndexedIndirectCountAMD(my_data->report_data, buffer, offset, countBuffer, |
| 6733 | countBufferOffset, maxDrawCount, stride); |
| 6734 | if (!skip) { |
| 6735 | my_data->dispatch_table.CmdDrawIndexedIndirectCountAMD(commandBuffer, buffer, offset, countBuffer, countBufferOffset, |
| 6736 | maxDrawCount, stride); |
| 6737 | } |
| 6738 | } |
| 6739 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6740 | // Definitions for the VK_EXT_display_surface_counter extension |
| 6741 | |
| 6742 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, |
| 6743 | VkSurfaceCapabilities2EXT *pSurfaceCapabilities) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6744 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6745 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6746 | assert(my_data != NULL); |
| 6747 | bool skip = false; |
| 6748 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::ext_display_surface_counter_enabled, |
| 6749 | "vkGetPhysicalDeviceSurfaceCapabilities2EXT", VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME); |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 6750 | skip |= parameter_validation_vkGetPhysicalDeviceSurfaceCapabilities2EXT(my_data->report_data, surface, pSurfaceCapabilities); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6751 | if (!skip) { |
| 6752 | result = my_data->dispatch_table.GetPhysicalDeviceSurfaceCapabilities2EXT(physicalDevice, surface, pSurfaceCapabilities); |
| 6753 | validate_result(my_data->report_data, "vkGetPhysicalDeviceSurfaceCapabilities2EXT", result); |
| 6754 | } |
| 6755 | return result; |
| 6756 | } |
| 6757 | |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6758 | // Definitions for the VK_NV_clip_space_w_scaling Extension |
| 6759 | |
| 6760 | VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, |
| 6761 | const VkViewportWScalingNV *pViewportWScalings) { |
| 6762 | bool skip = false; |
| 6763 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
| 6764 | assert(my_data != NULL); |
| 6765 | skip |= require_device_extension(my_data, my_data->enables.amd_draw_indirect_count, "vkCmdSetViewportWScalingNV", |
| 6766 | VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME); |
| 6767 | #if 0 // Validation not automatically generated |
| 6768 | skip |= parameter_validation_vkCmdSetViewportWScalingNV(my_data->report_data, firstViewport, viewportCount, pViewportWScalings); |
| 6769 | #endif |
| 6770 | if (!skip) { |
| 6771 | my_data->dispatch_table.CmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings); |
| 6772 | } |
| 6773 | } |
| 6774 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6775 | // Definitions for the VK_NV_external_memory_capabilities Extension |
| 6776 | |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6777 | VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 6778 | VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, |
| 6779 | VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 6780 | VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6781 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6782 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6783 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6784 | assert(my_data != NULL); |
| 6785 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6786 | skip |= require_instance_extension(physicalDevice, &instance_extension_enables::nv_external_memory_capabilities_enabled, |
| 6787 | "vkGetPhysicalDeviceExternalImageFormatPropertiesNV", |
| 6788 | VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); |
| 6789 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6790 | skip |= parameter_validation_vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6791 | my_data->report_data, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties); |
| 6792 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6793 | if (!skip) { |
Chris Forbes | 6444bba | 2016-11-24 14:15:23 +1300 | [diff] [blame] | 6794 | result = my_data->dispatch_table.GetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 6795 | physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties); |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6796 | |
| 6797 | validate_result(my_data->report_data, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV", result); |
| 6798 | } |
| 6799 | |
| 6800 | return result; |
| 6801 | } |
| 6802 | |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6803 | // VK_NV_external_memory_win32 Extension |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6804 | |
| 6805 | #ifdef VK_USE_PLATFORM_WIN32_KHR |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6806 | VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, |
| 6807 | VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE *pHandle) { |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6808 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6809 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6810 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6811 | assert(my_data != NULL); |
| 6812 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6813 | skip |= require_device_extension(my_data, my_data->enables.nv_external_memory_win32, "vkGetMemoryWin32HandleNV", |
| 6814 | VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); |
| 6815 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6816 | skip |= parameter_validation_vkGetMemoryWin32HandleNV(my_data->report_data, memory, handleType, pHandle); |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6817 | |
Chris Forbes | 04b61da | 2016-11-03 09:53:59 +1300 | [diff] [blame] | 6818 | if (!skip) { |
Chris Forbes | e58c9fe | 2016-11-24 14:44:17 +1300 | [diff] [blame] | 6819 | result = my_data->dispatch_table.GetMemoryWin32HandleNV(device, memory, handleType, pHandle); |
Mark Lobodzinski | d5c4e62 | 2016-09-29 15:01:28 -0600 | [diff] [blame] | 6820 | } |
| 6821 | |
| 6822 | return result; |
| 6823 | } |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6824 | #endif // VK_USE_PLATFORM_WIN32_KHR |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6825 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6826 | // VK_NVX_device_generated_commands Extension |
Mark Lobodzinski | b3c6828 | 2016-09-28 14:04:29 -0600 | [diff] [blame] | 6827 | |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6828 | VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX(VkCommandBuffer commandBuffer, |
| 6829 | const VkCmdProcessCommandsInfoNVX *pProcessCommandsInfo) { |
| 6830 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6831 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6832 | assert(my_data != NULL); |
| 6833 | 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] | 6834 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6835 | skip |= parameter_validation_vkCmdProcessCommandsNVX(my_data->report_data, pProcessCommandsInfo); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6836 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6837 | my_data->dispatch_table.CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6838 | } |
| 6839 | } |
| 6840 | |
| 6841 | VKAPI_ATTR void VKAPI_CALL CmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer, |
| 6842 | const VkCmdReserveSpaceForCommandsInfoNVX *pReserveSpaceInfo) { |
| 6843 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6844 | auto my_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6845 | assert(my_data != NULL); |
| 6846 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCmdReserveSpaceForCommandsNVX", |
| 6847 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
| 6848 | skip |= parameter_validation_vkCmdReserveSpaceForCommandsNVX(my_data->report_data, pReserveSpaceInfo); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6849 | if (!skip) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6850 | my_data->dispatch_table.CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6851 | } |
| 6852 | } |
| 6853 | |
| 6854 | VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX(VkDevice device, |
| 6855 | const VkIndirectCommandsLayoutCreateInfoNVX *pCreateInfo, |
| 6856 | const VkAllocationCallbacks *pAllocator, |
| 6857 | VkIndirectCommandsLayoutNVX *pIndirectCommandsLayout) { |
| 6858 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6859 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6860 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6861 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6862 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkCreateIndirectCommandsLayoutNVX", |
| 6863 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6864 | skip |= parameter_validation_vkCreateIndirectCommandsLayoutNVX(my_data->report_data, pCreateInfo, pAllocator, |
| 6865 | pIndirectCommandsLayout); |
| 6866 | if (!skip) { |
| 6867 | result = my_data->dispatch_table.CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6868 | validate_result(my_data->report_data, "vkCreateIndirectCommandsLayoutNVX", result); |
| 6869 | } |
| 6870 | return result; |
| 6871 | } |
| 6872 | |
| 6873 | VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 6874 | const VkAllocationCallbacks *pAllocator) { |
| 6875 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6876 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6877 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6878 | skip |= require_device_extension(my_data, my_data->enables.nvx_device_generated_commands, "vkDestroyIndirectCommandsLayoutNVX", |
| 6879 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6880 | #if 0 // Validation not automatically generated |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6881 | skip |= parameter_validation_vkDestroyIndirectCommandsLayoutNVX(my_data->report_data, indirectCommandsLayout, pAllocator); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6882 | #endif |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6883 | if (!skip) { |
| 6884 | my_data->dispatch_table.DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); |
| 6885 | } |
| 6886 | } |
| 6887 | |
| 6888 | VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX(VkDevice device, const VkObjectTableCreateInfoNVX *pCreateInfo, |
| 6889 | const VkAllocationCallbacks *pAllocator, VkObjectTableNVX *pObjectTable) { |
| 6890 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6891 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6892 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6893 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6894 | 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] | 6895 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
| 6896 | skip |= parameter_validation_vkCreateObjectTableNVX(my_data->report_data, pCreateInfo, pAllocator, pObjectTable); |
| 6897 | if (!skip) { |
| 6898 | result = my_data->dispatch_table.CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6899 | validate_result(my_data->report_data, "vkCreateObjectTableNVX", result); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6900 | } |
| 6901 | return result; |
| 6902 | } |
| 6903 | |
| 6904 | VKAPI_ATTR void VKAPI_CALL DestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, |
| 6905 | const VkAllocationCallbacks *pAllocator) { |
| 6906 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6907 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6908 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6909 | 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] | 6910 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 6911 | #if 0 // Validation not automatically generated |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6912 | skip |= parameter_validation_vkDestroyObjectTableNVX(my_data->report_data, objectTable, pAllocator); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6913 | #endif |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6914 | if (!skip) { |
| 6915 | my_data->dispatch_table.DestroyObjectTableNVX(device, objectTable, pAllocator); |
| 6916 | } |
| 6917 | } |
| 6918 | |
| 6919 | VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, |
| 6920 | const VkObjectTableEntryNVX *const *ppObjectTableEntries, |
| 6921 | const uint32_t *pObjectIndices) { |
| 6922 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6923 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6924 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6925 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6926 | 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] | 6927 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
| 6928 | skip |= parameter_validation_vkRegisterObjectsNVX(my_data->report_data, objectTable, objectCount, ppObjectTableEntries, |
| 6929 | pObjectIndices); |
| 6930 | if (!skip) { |
| 6931 | result = my_data->dispatch_table.RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6932 | validate_result(my_data->report_data, "vkRegisterObjectsNVX", result); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6933 | } |
| 6934 | return result; |
| 6935 | } |
| 6936 | |
| 6937 | VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, |
| 6938 | const VkObjectEntryTypeNVX *pObjectEntryTypes, const uint32_t *pObjectIndices) { |
| 6939 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6940 | bool skip = false; |
Mark Young | 0f183a8 | 2017-02-28 09:58:04 -0700 | [diff] [blame] | 6941 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6942 | assert(my_data != NULL); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6943 | 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] | 6944 | VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME); |
| 6945 | skip |= parameter_validation_vkUnregisterObjectsNVX(my_data->report_data, objectTable, objectCount, pObjectEntryTypes, |
| 6946 | pObjectIndices); |
| 6947 | if (!skip) { |
| 6948 | result = my_data->dispatch_table.UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 6949 | validate_result(my_data->report_data, "vkUnregisterObjectsNVX", result); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6950 | } |
| 6951 | return result; |
| 6952 | } |
| 6953 | |
| 6954 | VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX(VkPhysicalDevice physicalDevice, |
| 6955 | VkDeviceGeneratedCommandsFeaturesNVX *pFeatures, |
| 6956 | VkDeviceGeneratedCommandsLimitsNVX *pLimits) { |
| 6957 | bool skip = false; |
Tobin Ehlis | 8d6acde | 2017-02-08 07:40:40 -0700 | [diff] [blame] | 6958 | auto my_data = GetLayerDataPtr(get_dispatch_key(physicalDevice), instance_layer_data_map); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6959 | assert(my_data != NULL); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6960 | skip |= parameter_validation_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(my_data->report_data, pFeatures, pLimits); |
Mark Young | fa55278 | 2016-12-12 16:14:55 -0700 | [diff] [blame] | 6961 | if (!skip) { |
| 6962 | my_data->dispatch_table.GetPhysicalDeviceGeneratedCommandsPropertiesNVX(physicalDevice, pFeatures, pLimits); |
| 6963 | } |
| 6964 | } |
Mark Lobodzinski | 620a913 | 2016-09-28 13:51:51 -0600 | [diff] [blame] | 6965 | |
Mark Lobodzinski | 1d218cc | 2017-03-14 10:12:43 -0600 | [diff] [blame] | 6966 | VKAPI_ATTR VkResult VKAPI_CALL GetPastPresentationTimingGOOGLE(VkDevice device, VkSwapchainKHR swapchain, |
| 6967 | uint32_t *pPresentationTimingCount, |
| 6968 | VkPastPresentationTimingGOOGLE *pPresentationTimings) { |
| 6969 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6970 | bool skip = false; |
| 6971 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6972 | assert(my_data != NULL); |
| 6973 | skip |= parameter_validation_vkGetPastPresentationTimingGOOGLE(my_data->report_data, swapchain, pPresentationTimingCount, |
| 6974 | pPresentationTimings); |
| 6975 | if (!skip) { |
| 6976 | result = my_data->dispatch_table.GetPastPresentationTimingGOOGLE(device, swapchain, pPresentationTimingCount, |
| 6977 | pPresentationTimings); |
| 6978 | } |
| 6979 | return result; |
| 6980 | } |
| 6981 | |
| 6982 | VKAPI_ATTR VkResult VKAPI_CALL GetRefreshCycleDurationGOOGLE(VkDevice device, VkSwapchainKHR swapchain, |
| 6983 | VkRefreshCycleDurationGOOGLE *pDisplayTimingProperties) { |
| 6984 | VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; |
| 6985 | bool skip = false; |
| 6986 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6987 | assert(my_data != NULL); |
| 6988 | skip |= parameter_validation_vkGetRefreshCycleDurationGOOGLE(my_data->report_data, swapchain, pDisplayTimingProperties); |
| 6989 | if (!skip) { |
| 6990 | result = my_data->dispatch_table.GetRefreshCycleDurationGOOGLE(device, swapchain, pDisplayTimingProperties); |
| 6991 | } |
| 6992 | return result; |
| 6993 | } |
| 6994 | |
| 6995 | VKAPI_ATTR void VKAPI_CALL SetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, |
| 6996 | const VkHdrMetadataEXT *pMetadata) { |
| 6997 | bool skip = false; |
| 6998 | auto my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
| 6999 | assert(my_data != NULL); |
| 7000 | skip |= parameter_validation_vkSetHdrMetadataEXT(my_data->report_data, swapchainCount, pSwapchains, pMetadata); |
| 7001 | if (!skip) { |
| 7002 | my_data->dispatch_table.SetHdrMetadataEXT(device, swapchainCount, pSwapchains, pMetadata); |
| 7003 | } |
| 7004 | } |
| 7005 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7006 | static inline PFN_vkVoidFunction layer_intercept_proc(const char *name) { |
| 7007 | for (unsigned int i = 0; i < sizeof(procmap) / sizeof(procmap[0]); i++) { |
| 7008 | if (!strcmp(name, procmap[i].name)) return procmap[i].pFunc; |
| 7009 | } |
| 7010 | return NULL; |
| 7011 | } |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 7012 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 7013 | 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] | 7014 | assert(device); |
| 7015 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7016 | PFN_vkVoidFunction addr = layer_intercept_proc(funcName); |
| 7017 | if (addr) return addr; |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 7018 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7019 | layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 7020 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7021 | if (!dev_data->dispatch_table.GetDeviceProcAddr) return nullptr; |
| 7022 | return dev_data->dispatch_table.GetDeviceProcAddr(device, funcName); |
Jeremy Hayes | a8b1a8d | 2015-04-06 13:46:11 -0600 | [diff] [blame] | 7023 | } |
| 7024 | |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 7025 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr(VkInstance instance, const char *funcName) { |
Mark Lobodzinski | af00fa8 | 2016-08-09 10:44:38 -0600 | [diff] [blame] | 7026 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7027 | PFN_vkVoidFunction addr = layer_intercept_proc(funcName); |
| 7028 | if (addr) return addr; |
Courtney Goeltzenleuchter | 500b89b | 2015-06-01 14:45:27 -0600 | [diff] [blame] | 7029 | |
Chia-I Wu | 617f2a4 | 2016-05-16 07:41:17 +0800 | [diff] [blame] | 7030 | assert(instance); |
Courtney Goeltzenleuchter | 00150eb | 2016-01-08 12:18:43 -0700 | [diff] [blame] | 7031 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7032 | auto instance_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Lobodzinski | 9a1c7b7 | 2016-01-12 11:52:05 -0700 | [diff] [blame] | 7033 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7034 | if (!instance_data->dispatch_table.GetInstanceProcAddr) return nullptr; |
| 7035 | return instance_data->dispatch_table.GetInstanceProcAddr(instance, funcName); |
Jon Ashburn | f6b33db | 2015-05-05 14:22:52 -0600 | [diff] [blame] | 7036 | } |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 7037 | |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 7038 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetPhysicalDeviceProcAddr(VkInstance instance, const char *funcName) { |
| 7039 | assert(instance); |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7040 | auto pdev_data = GetLayerDataPtr(get_dispatch_key(instance), instance_layer_data_map); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 7041 | |
Mark Young | 4e423c0 | 2017-03-07 13:09:00 -0700 | [diff] [blame] | 7042 | if (!pdev_data->dispatch_table.GetPhysicalDeviceProcAddr) return nullptr; |
| 7043 | return pdev_data->dispatch_table.GetPhysicalDeviceProcAddr(instance, funcName); |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 7044 | } |
| 7045 | |
Mark Lobodzinski | 64318ba | 2017-01-26 13:34:13 -0700 | [diff] [blame] | 7046 | } // namespace parameter_validation |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 7047 | |
| 7048 | // vk_layer_logging.h expects these to be defined |
| 7049 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 7050 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugReportCallbackEXT(VkInstance instance, |
| 7051 | const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, |
| 7052 | const VkAllocationCallbacks *pAllocator, |
| 7053 | VkDebugReportCallbackEXT *pMsgCallback) { |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 7054 | return parameter_validation::CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pMsgCallback); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 7055 | } |
| 7056 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 7057 | VKAPI_ATTR void VKAPI_CALL vkDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT msgCallback, |
| 7058 | const VkAllocationCallbacks *pAllocator) { |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 7059 | parameter_validation::DestroyDebugReportCallbackEXT(instance, msgCallback, pAllocator); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 7060 | } |
| 7061 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 7062 | VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, |
| 7063 | VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location, |
| 7064 | int32_t msgCode, const char *pLayerPrefix, const char *pMsg) { |
Chia-I Wu | 01ca237 | 2016-05-13 14:37:49 +0800 | [diff] [blame] | 7065 | parameter_validation::DebugReportMessageEXT(instance, flags, objType, object, location, msgCode, pLayerPrefix, pMsg); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 7066 | } |
| 7067 | |
| 7068 | // loader-layer interface v0 |
| 7069 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 7070 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, |
| 7071 | VkExtensionProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 7072 | return parameter_validation::EnumerateInstanceExtensionProperties(pLayerName, pCount, pProperties); |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 7073 | } |
| 7074 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 7075 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pCount, |
| 7076 | VkLayerProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 7077 | return parameter_validation::EnumerateInstanceLayerProperties(pCount, pProperties); |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 7078 | } |
| 7079 | |
Mark Lobodzinski | 72ecd91 | 2016-08-11 13:25:38 -0600 | [diff] [blame] | 7080 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, |
| 7081 | VkLayerProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 7082 | // the layer command handles VK_NULL_HANDLE just fine internally |
| 7083 | assert(physicalDevice == VK_NULL_HANDLE); |
| 7084 | return parameter_validation::EnumerateDeviceLayerProperties(VK_NULL_HANDLE, pCount, pProperties); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 7085 | } |
| 7086 | |
| 7087 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, |
| 7088 | const char *pLayerName, uint32_t *pCount, |
| 7089 | VkExtensionProperties *pProperties) { |
Chia-I Wu | b02600c | 2016-05-20 07:11:22 +0800 | [diff] [blame] | 7090 | // the layer command handles VK_NULL_HANDLE just fine internally |
| 7091 | assert(physicalDevice == VK_NULL_HANDLE); |
Chia-I Wu | 76a3466 | 2016-05-16 07:34:09 +0800 | [diff] [blame] | 7092 | return parameter_validation::EnumerateDeviceExtensionProperties(VK_NULL_HANDLE, pLayerName, pCount, pProperties); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 7093 | } |
| 7094 | |
| 7095 | 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] | 7096 | return parameter_validation::GetDeviceProcAddr(dev, funcName); |
Chia-I Wu | 1a6b193 | 2016-05-13 14:07:36 +0800 | [diff] [blame] | 7097 | } |
| 7098 | |
| 7099 | 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] | 7100 | return parameter_validation::GetInstanceProcAddr(instance, funcName); |
Chia-I Wu | 99f701c | 2016-05-13 14:06:08 +0800 | [diff] [blame] | 7101 | } |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 7102 | |
Mark Lobodzinski | 729a8d3 | 2017-01-26 12:16:30 -0700 | [diff] [blame] | 7103 | VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_layerGetPhysicalDeviceProcAddr(VkInstance instance, |
| 7104 | const char *funcName) { |
Mark Young | 3938987 | 2017-01-19 21:10:49 -0700 | [diff] [blame] | 7105 | return parameter_validation::GetPhysicalDeviceProcAddr(instance, funcName); |
| 7106 | } |
| 7107 | |
| 7108 | VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct) { |
| 7109 | assert(pVersionStruct != NULL); |
| 7110 | assert(pVersionStruct->sType == LAYER_NEGOTIATE_INTERFACE_STRUCT); |
| 7111 | |
| 7112 | // Fill in the function pointers if our version is at least capable of having the structure contain them. |
| 7113 | if (pVersionStruct->loaderLayerInterfaceVersion >= 2) { |
| 7114 | pVersionStruct->pfnGetInstanceProcAddr = vkGetInstanceProcAddr; |
| 7115 | pVersionStruct->pfnGetDeviceProcAddr = vkGetDeviceProcAddr; |
| 7116 | pVersionStruct->pfnGetPhysicalDeviceProcAddr = vk_layerGetPhysicalDeviceProcAddr; |
| 7117 | } |
| 7118 | |
| 7119 | if (pVersionStruct->loaderLayerInterfaceVersion < CURRENT_LOADER_LAYER_INTERFACE_VERSION) { |
| 7120 | parameter_validation::loader_layer_if_version = pVersionStruct->loaderLayerInterfaceVersion; |
| 7121 | } else if (pVersionStruct->loaderLayerInterfaceVersion > CURRENT_LOADER_LAYER_INTERFACE_VERSION) { |
| 7122 | pVersionStruct->loaderLayerInterfaceVersion = CURRENT_LOADER_LAYER_INTERFACE_VERSION; |
| 7123 | } |
| 7124 | |
| 7125 | return VK_SUCCESS; |
| 7126 | } |