Tony-LunarG | 7371999 | 2020-01-15 10:20:28 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2015-2020 The Khronos Group Inc. |
| 2 | * Copyright (c) 2015-2020 Valve Corporation |
| 3 | * Copyright (c) 2015-2020 LunarG, Inc. |
| 4 | * Copyright (C) 2015-2020 Google Inc. |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 5 | * Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | * |
| 19 | * Author: Cody Northrop <cnorthrop@google.com> |
| 20 | * Author: Michael Lentine <mlentine@google.com> |
| 21 | * Author: Tobin Ehlis <tobine@google.com> |
| 22 | * Author: Chia-I Wu <olv@google.com> |
| 23 | * Author: Chris Forbes <chrisf@ijw.co.nz> |
| 24 | * Author: Mark Lobodzinski <mark@lunarg.com> |
| 25 | * Author: Ian Elliott <ianelliott@google.com> |
| 26 | * Author: Dave Houlton <daveh@lunarg.com> |
| 27 | * Author: Dustin Graves <dustin@lunarg.com> |
| 28 | * Author: Jeremy Hayes <jeremy@lunarg.com> |
| 29 | * Author: Jon Ashburn <jon@lunarg.com> |
| 30 | * Author: Karl Schultz <karl@lunarg.com> |
| 31 | * Author: Mark Young <marky@lunarg.com> |
| 32 | * Author: Mike Schuchardt <mikes@lunarg.com> |
| 33 | * Author: Mike Weiblen <mikew@lunarg.com> |
| 34 | * Author: Tony Barbour <tony@LunarG.com> |
| 35 | * Author: John Zulauf <jzulauf@lunarg.com> |
| 36 | * Author: Shannon McPherson <shannon@lunarg.com> |
Jeremy Kniager | e682743 | 2020-04-01 09:05:56 -0600 | [diff] [blame] | 37 | * Author: Jeremy Kniager <jeremyk@lunarg.com> |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 38 | * Author: Nathaniel Cesario <nathaniel@lunarg.com> |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 39 | * Author: Tobias Hector <tobias.hector@amd.com> |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 40 | */ |
| 41 | |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 42 | #include "chassis.h" |
| 43 | #include "core_validation.h" |
| 44 | |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 45 | // clang-format off |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 46 | struct DispatchVuidsCmdDraw : DrawDispatchVuid { |
| 47 | DispatchVuidsCmdDraw() : DrawDispatchVuid() { |
| 48 | queue_flag = "VUID-vkCmdDraw-commandBuffer-cmdpool"; |
| 49 | inside_renderpass = "VUID-vkCmdDraw-renderpass"; |
| 50 | pipeline_bound = "VUID-vkCmdDraw-None-02700"; |
| 51 | dynamic_state = "VUID-vkCmdDraw-commandBuffer-02701"; |
| 52 | vertex_binding = "VUID-vkCmdDraw-None-04007"; |
| 53 | vertex_binding_null = "VUID-vkCmdDraw-None-04008"; |
| 54 | compatible_pipeline = "VUID-vkCmdDraw-None-02697"; |
| 55 | render_pass_compatible = "VUID-vkCmdDraw-renderPass-02684"; |
| 56 | subpass_index = "VUID-vkCmdDraw-subpass-02685"; |
| 57 | sample_location = "VUID-vkCmdDraw-sampleLocationsEnable-02689"; |
| 58 | linear_sampler = "VUID-vkCmdDraw-magFilter-04553"; |
| 59 | cubic_sampler = "VUID-vkCmdDraw-None-02692"; |
| 60 | viewport_count = "VUID-vkCmdDraw-viewportCount-03417"; |
| 61 | scissor_count = "VUID-vkCmdDraw-scissorCount-03418"; |
| 62 | viewport_scissor_count = "VUID-vkCmdDraw-viewportCount-03419"; |
| 63 | primitive_topology = "VUID-vkCmdDraw-primitiveTopology-03420"; |
| 64 | corner_sampled_address_mode = "VUID-vkCmdDraw-flags-02696"; |
| 65 | subpass_input = "VUID-vkCmdDraw-None-02686"; |
| 66 | imageview_atomic = "VUID-vkCmdDraw-None-02691"; |
| 67 | push_constants_set = "VUID-vkCmdDraw-None-02698"; |
| 68 | image_subresources = "VUID-vkCmdDraw-None-04584"; |
| 69 | descriptor_valid = "VUID-vkCmdDraw-None-02699"; |
| 70 | sampler_imageview_type = "VUID-vkCmdDraw-None-02702"; |
| 71 | sampler_implicitLod_dref_proj = "VUID-vkCmdDraw-None-02703"; |
| 72 | sampler_bias_offset = "VUID-vkCmdDraw-None-02704"; |
| 73 | vertex_binding_attribute = "VUID-vkCmdDraw-None-02721"; |
| 74 | dynamic_state_setting_commands = "VUID-vkCmdDraw-None-02859"; |
| 75 | unprotected_command_buffer = "VUID-vkCmdDraw-commandBuffer-02707"; |
| 76 | protected_command_buffer = "VUID-vkCmdDraw-commandBuffer-02712"; |
| 77 | max_multiview_instance_index = "VUID-vkCmdDraw-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 78 | img_filter_cubic = "VUID-vkCmdDraw-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 79 | filter_cubic = "VUID-vkCmdDraw-filterCubic-02694"; |
| 80 | filter_cubic_min_max = "VUID-vkCmdDraw-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 81 | viewport_count_primitive_shading_rate = "VUID-vkCmdDraw-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 82 | } |
| 83 | }; |
| 84 | |
| 85 | struct DispatchVuidsCmdDrawIndexed : DrawDispatchVuid { |
| 86 | DispatchVuidsCmdDrawIndexed() : DrawDispatchVuid() { |
| 87 | queue_flag = "VUID-vkCmdDrawIndexed-commandBuffer-cmdpool"; |
| 88 | inside_renderpass = "VUID-vkCmdDrawIndexed-renderpass"; |
| 89 | pipeline_bound = "VUID-vkCmdDrawIndexed-None-02700"; |
| 90 | dynamic_state = "VUID-vkCmdDrawIndexed-commandBuffer-02701"; |
| 91 | vertex_binding = "VUID-vkCmdDrawIndexed-None-04007"; |
| 92 | vertex_binding_null = "VUID-vkCmdDrawIndexed-None-04008"; |
| 93 | compatible_pipeline = "VUID-vkCmdDrawIndexed-None-02697"; |
| 94 | render_pass_compatible = "VUID-vkCmdDrawIndexed-renderPass-02684"; |
| 95 | subpass_index = "VUID-vkCmdDrawIndexed-subpass-02685"; |
| 96 | sample_location = "VUID-vkCmdDrawIndexed-sampleLocationsEnable-02689"; |
| 97 | linear_sampler = "VUID-vkCmdDrawIndexed-magFilter-04553"; |
| 98 | cubic_sampler = "VUID-vkCmdDrawIndexed-None-02692"; |
| 99 | viewport_count = "VUID-vkCmdDrawIndexed-viewportCount-03417"; |
| 100 | scissor_count = "VUID-vkCmdDrawIndexed-scissorCount-03418"; |
| 101 | viewport_scissor_count = "VUID-vkCmdDrawIndexed-viewportCount-03419"; |
| 102 | primitive_topology = "VUID-vkCmdDrawIndexed-primitiveTopology-03420"; |
| 103 | corner_sampled_address_mode = "VUID-vkCmdDrawIndexed-flags-02696"; |
| 104 | subpass_input = "VUID-vkCmdDrawIndexed-None-02686"; |
| 105 | imageview_atomic = "VUID-vkCmdDrawIndexed-None-02691"; |
| 106 | push_constants_set = "VUID-vkCmdDrawIndexed-None-02698"; |
| 107 | image_subresources = "VUID-vkCmdDrawIndexed-None-04584"; |
| 108 | descriptor_valid = "VUID-vkCmdDrawIndexed-None-02699"; |
| 109 | sampler_imageview_type = "VUID-vkCmdDrawIndexed-None-02702"; |
| 110 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawIndexed-None-02703"; |
| 111 | sampler_bias_offset = "VUID-vkCmdDrawIndexed-None-02704"; |
| 112 | vertex_binding_attribute = "VUID-vkCmdDrawIndexed-None-02721"; |
| 113 | dynamic_state_setting_commands = "VUID-vkCmdDrawIndexed-None-02859"; |
| 114 | unprotected_command_buffer = "VUID-vkCmdDrawIndexed-commandBuffer-02707"; |
| 115 | protected_command_buffer = "VUID-vkCmdDrawIndexed-commandBuffer-02712"; |
| 116 | max_multiview_instance_index = "VUID-vkCmdDrawIndexed-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 117 | img_filter_cubic = "VUID-vkCmdDrawIndexed-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 118 | filter_cubic = "VUID-vkCmdDrawIndexed-filterCubic-02694"; |
| 119 | filter_cubic_min_max = "VUID-vkCmdDrawIndexed-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 120 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawIndexed-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 121 | } |
| 122 | }; |
| 123 | |
| 124 | struct DispatchVuidsCmdDrawIndirect : DrawDispatchVuid { |
| 125 | DispatchVuidsCmdDrawIndirect() : DrawDispatchVuid() { |
| 126 | queue_flag = "VUID-vkCmdDrawIndirect-commandBuffer-cmdpool"; |
| 127 | inside_renderpass = "VUID-vkCmdDrawIndirect-renderpass"; |
| 128 | pipeline_bound = "VUID-vkCmdDrawIndirect-None-02700"; |
| 129 | dynamic_state = "VUID-vkCmdDrawIndirect-commandBuffer-02701"; |
| 130 | vertex_binding = "VUID-vkCmdDrawIndirect-None-04007"; |
| 131 | vertex_binding_null = "VUID-vkCmdDrawIndirect-None-04008"; |
| 132 | compatible_pipeline = "VUID-vkCmdDrawIndirect-None-02697"; |
| 133 | render_pass_compatible = "VUID-vkCmdDrawIndirect-renderPass-02684"; |
| 134 | subpass_index = "VUID-vkCmdDrawIndirect-subpass-02685"; |
| 135 | sample_location = "VUID-vkCmdDrawIndirect-sampleLocationsEnable-02689"; |
| 136 | linear_sampler = "VUID-vkCmdDrawIndirect-magFilter-04553"; |
| 137 | cubic_sampler = "VUID-vkCmdDrawIndirect-None-02692"; |
| 138 | indirect_protected_cb = "VUID-vkCmdDrawIndirect-commandBuffer-02711"; |
| 139 | indirect_contiguous_memory = "VUID-vkCmdDrawIndirect-buffer-02708"; |
| 140 | indirect_buffer_bit = "VUID-vkCmdDrawIndirect-buffer-02709"; |
| 141 | viewport_count = "VUID-vkCmdDrawIndirect-viewportCount-03417"; |
| 142 | scissor_count = "VUID-vkCmdDrawIndirect-scissorCount-03418"; |
| 143 | viewport_scissor_count = "VUID-vkCmdDrawIndirect-viewportCount-03419"; |
| 144 | primitive_topology = "VUID-vkCmdDrawIndirect-primitiveTopology-03420"; |
| 145 | corner_sampled_address_mode = "VUID-vkCmdDrawIndirect-flags-02696"; |
| 146 | subpass_input = "VUID-vkCmdDrawIndirect-None-02686"; |
| 147 | imageview_atomic = "VUID-vkCmdDrawIndirect-None-02691"; |
| 148 | push_constants_set = "VUID-vkCmdDrawIndirect-None-02698"; |
| 149 | image_subresources = "VUID-vkCmdDrawIndirect-None-04584"; |
| 150 | descriptor_valid = "VUID-vkCmdDrawIndirect-None-02699"; |
| 151 | sampler_imageview_type = "VUID-vkCmdDrawIndirect-None-02702"; |
| 152 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawIndirect-None-02703"; |
| 153 | sampler_bias_offset = "VUID-vkCmdDrawIndirect-None-02704"; |
| 154 | vertex_binding_attribute = "VUID-vkCmdDrawIndirect-None-02721"; |
| 155 | dynamic_state_setting_commands = "VUID-vkCmdDrawIndirect-None-02859"; |
| 156 | unprotected_command_buffer = "VUID-vkCmdDrawIndirect-commandBuffer-02707"; |
| 157 | max_multiview_instance_index = "VUID-vkCmdDrawIndirect-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 158 | img_filter_cubic = "VUID-vkCmdDrawIndirect-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 159 | filter_cubic = "VUID-vkCmdDrawIndirect-filterCubic-02694"; |
| 160 | filter_cubic_min_max = "VUID-vkCmdDrawIndirect-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 161 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawIndirect-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 162 | } |
| 163 | }; |
| 164 | |
| 165 | struct DispatchVuidsCmdDrawIndexedIndirect : DrawDispatchVuid { |
| 166 | DispatchVuidsCmdDrawIndexedIndirect() : DrawDispatchVuid() { |
| 167 | queue_flag = "VUID-vkCmdDrawIndexedIndirect-commandBuffer-cmdpool"; |
| 168 | inside_renderpass = "VUID-vkCmdDrawIndexedIndirect-renderpass"; |
| 169 | pipeline_bound = "VUID-vkCmdDrawIndexedIndirect-None-02700"; |
| 170 | dynamic_state = "VUID-vkCmdDrawIndexedIndirect-commandBuffer-02701"; |
| 171 | vertex_binding = "VUID-vkCmdDrawIndexedIndirect-None-04007"; |
| 172 | vertex_binding_null = "VUID-vkCmdDrawIndexedIndirect-None-04008"; |
| 173 | compatible_pipeline = "VUID-vkCmdDrawIndexedIndirect-None-02697"; |
| 174 | render_pass_compatible = "VUID-vkCmdDrawIndexedIndirect-renderPass-02684"; |
| 175 | subpass_index = "VUID-vkCmdDrawIndexedIndirect-subpass-02685"; |
| 176 | sample_location = "VUID-vkCmdDrawIndexedIndirect-sampleLocationsEnable-02689"; |
| 177 | linear_sampler = "VUID-vkCmdDrawIndexedIndirect-magFilter-04553"; |
| 178 | cubic_sampler = "VUID-vkCmdDrawIndexedIndirect-None-02692"; |
| 179 | indirect_protected_cb = "VUID-vkCmdDrawIndexedIndirect-commandBuffer-02711"; |
| 180 | indirect_contiguous_memory = "VUID-vkCmdDrawIndexedIndirect-buffer-02708"; |
| 181 | indirect_buffer_bit = "VUID-vkCmdDrawIndexedIndirect-buffer-02709"; |
| 182 | viewport_count = "VUID-vkCmdDrawIndexedIndirect-viewportCount-03417"; |
| 183 | scissor_count = "VUID-vkCmdDrawIndexedIndirect-scissorCount-03418"; |
| 184 | viewport_scissor_count = "VUID-vkCmdDrawIndexedIndirect-viewportCount-03419"; |
| 185 | primitive_topology = "VUID-vkCmdDrawIndexedIndirect-primitiveTopology-03420"; |
| 186 | corner_sampled_address_mode = "VUID-vkCmdDrawIndexedIndirect-flags-02696"; |
| 187 | subpass_input = "VUID-vkCmdDrawIndexedIndirect-None-02686"; |
| 188 | imageview_atomic = "VUID-vkCmdDrawIndexedIndirect-None-02691"; |
| 189 | push_constants_set = "VUID-vkCmdDrawIndexedIndirect-None-02698"; |
| 190 | image_subresources = "VUID-vkCmdDrawIndexedIndirect-None-04584"; |
| 191 | descriptor_valid = "VUID-vkCmdDrawIndexedIndirect-None-02699"; |
| 192 | sampler_imageview_type = "VUID-vkCmdDrawIndexedIndirect-None-02702"; |
| 193 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawIndexedIndirect-None-02703"; |
| 194 | sampler_bias_offset = "VUID-vkCmdDrawIndexedIndirect-None-02704"; |
| 195 | vertex_binding_attribute = "VUID-vkCmdDrawIndexedIndirect-None-02721"; |
| 196 | dynamic_state_setting_commands = "VUID-vkCmdDrawIndexedIndirect-None-02859"; |
| 197 | unprotected_command_buffer = "VUID-vkCmdDrawIndexedIndirect-commandBuffer-02707"; |
| 198 | max_multiview_instance_index = "VUID-vkCmdDrawIndexedIndirect-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 199 | img_filter_cubic = "VUID-vkCmdDrawIndexedIndirect-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 200 | filter_cubic = "VUID-vkCmdDrawIndexedIndirect-filterCubic-02694"; |
| 201 | filter_cubic_min_max = "VUID-vkCmdDrawIndexedIndirect-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 202 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawIndexedIndirect-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 203 | } |
| 204 | }; |
| 205 | |
| 206 | struct DispatchVuidsCmdDispatch : DrawDispatchVuid { |
| 207 | DispatchVuidsCmdDispatch() : DrawDispatchVuid() { |
| 208 | queue_flag = "VUID-vkCmdDispatch-commandBuffer-cmdpool"; |
| 209 | inside_renderpass = "VUID-vkCmdDispatch-renderpass"; |
| 210 | pipeline_bound = "VUID-vkCmdDispatch-None-02700"; |
| 211 | compatible_pipeline = "VUID-vkCmdDispatch-None-02697"; |
| 212 | linear_sampler = "VUID-vkCmdDispatch-magFilter-04553"; |
| 213 | cubic_sampler = "VUID-vkCmdDispatch-None-02692"; |
| 214 | corner_sampled_address_mode = "VUID-vkCmdDispatch-flags-02696"; |
| 215 | imageview_atomic = "VUID-vkCmdDispatch-None-02691"; |
| 216 | push_constants_set = "VUID-vkCmdDispatch-None-02698"; |
| 217 | descriptor_valid = "VUID-vkCmdDispatch-None-02699"; |
| 218 | sampler_imageview_type = "VUID-vkCmdDispatch-None-02702"; |
| 219 | sampler_implicitLod_dref_proj = "VUID-vkCmdDispatch-None-02703"; |
| 220 | sampler_bias_offset = "VUID-vkCmdDispatch-None-02704"; |
| 221 | dynamic_state_setting_commands = "VUID-vkCmdDispatch-None-02859"; |
| 222 | unprotected_command_buffer = "VUID-vkCmdDispatch-commandBuffer-02707"; |
| 223 | protected_command_buffer = "VUID-vkCmdDispatch-commandBuffer-02712"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 224 | img_filter_cubic = "VUID-vkCmdDispatch-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 225 | filter_cubic = "VUID-vkCmdDispatch-filterCubic-02694"; |
| 226 | filter_cubic_min_max = "VUID-vkCmdDispatch-filterCubicMinmax-02695"; |
| 227 | } |
| 228 | }; |
| 229 | |
| 230 | struct DispatchVuidsCmdDispatchIndirect : DrawDispatchVuid { |
| 231 | DispatchVuidsCmdDispatchIndirect() : DrawDispatchVuid() { |
| 232 | queue_flag = "VUID-vkCmdDispatchIndirect-commandBuffer-cmdpool"; |
| 233 | inside_renderpass = "VUID-vkCmdDispatchIndirect-renderpass"; |
| 234 | pipeline_bound = "VUID-vkCmdDispatchIndirect-None-02700"; |
| 235 | compatible_pipeline = "VUID-vkCmdDispatchIndirect-None-02697"; |
| 236 | linear_sampler = "VUID-vkCmdDispatchIndirect-magFilter-04553"; |
| 237 | cubic_sampler = "VUID-vkCmdDispatchIndirect-None-02692"; |
| 238 | indirect_protected_cb = "VUID-vkCmdDispatchIndirect-commandBuffer-02711"; |
| 239 | indirect_contiguous_memory = "VUID-vkCmdDispatchIndirect-buffer-02708"; |
| 240 | indirect_buffer_bit = "VUID-vkCmdDispatchIndirect-buffer-02709"; |
| 241 | corner_sampled_address_mode = "VUID-vkCmdDispatchIndirect-flags-02696"; |
| 242 | imageview_atomic = "VUID-vkCmdDispatchIndirect-None-02691"; |
| 243 | push_constants_set = "VUID-vkCmdDispatchIndirect-None-02698"; |
| 244 | descriptor_valid = "VUID-vkCmdDispatchIndirect-None-02699"; |
| 245 | sampler_imageview_type = "VUID-vkCmdDispatchIndirect-None-02702"; |
| 246 | sampler_implicitLod_dref_proj = "VUID-vkCmdDispatchIndirect-None-02703"; |
| 247 | sampler_bias_offset = "VUID-vkCmdDispatchIndirect-None-02704"; |
| 248 | dynamic_state_setting_commands = "VUID-vkCmdDispatchIndirect-None-02859"; |
| 249 | unprotected_command_buffer = "VUID-vkCmdDispatchIndirect-commandBuffer-02707"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 250 | img_filter_cubic = "VUID-vkCmdDispatchIndirect-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 251 | filter_cubic = "VUID-vkCmdDispatchIndirect-filterCubic-02694"; |
| 252 | filter_cubic_min_max = "VUID-vkCmdDispatchIndirect-filterCubicMinmax-02695"; |
| 253 | } |
| 254 | }; |
| 255 | |
| 256 | struct DispatchVuidsCmdDrawIndirectCount : DrawDispatchVuid { |
| 257 | DispatchVuidsCmdDrawIndirectCount() : DrawDispatchVuid() { |
| 258 | queue_flag = "VUID-vkCmdDrawIndirectCount-commandBuffer-cmdpool"; |
| 259 | inside_renderpass = "VUID-vkCmdDrawIndirectCount-renderpass"; |
| 260 | pipeline_bound = "VUID-vkCmdDrawIndirectCount-None-02700"; |
| 261 | dynamic_state = "VUID-vkCmdDrawIndirectCount-commandBuffer-02701"; |
| 262 | vertex_binding = "VUID-vkCmdDrawIndirectCount-None-04007"; |
| 263 | vertex_binding_null = "VUID-vkCmdDrawIndirectCount-None-04008"; |
| 264 | compatible_pipeline = "VUID-vkCmdDrawIndirectCount-None-02697"; |
| 265 | render_pass_compatible = "VUID-vkCmdDrawIndirectCount-renderPass-02684"; |
| 266 | subpass_index = "VUID-vkCmdDrawIndirectCount-subpass-02685"; |
| 267 | sample_location = "VUID-vkCmdDrawIndirectCount-sampleLocationsEnable-02689"; |
| 268 | linear_sampler = "VUID-vkCmdDrawIndirectCount-magFilter-04553"; |
| 269 | cubic_sampler = "VUID-vkCmdDrawIndirectCount-None-02692"; |
| 270 | indirect_protected_cb = "VUID-vkCmdDrawIndirectCount-commandBuffer-02711"; |
| 271 | indirect_contiguous_memory = "VUID-vkCmdDrawIndirectCount-buffer-02708"; |
| 272 | indirect_buffer_bit = "VUID-vkCmdDrawIndirectCount-buffer-02709"; |
| 273 | viewport_count = "VUID-vkCmdDrawIndirectCount-viewportCount-03417"; |
| 274 | scissor_count = "VUID-vkCmdDrawIndirectCount-scissorCount-03418"; |
| 275 | viewport_scissor_count = "VUID-vkCmdDrawIndirectCount-viewportCount-03419"; |
| 276 | primitive_topology = "VUID-vkCmdDrawIndirectCount-primitiveTopology-03420"; |
| 277 | corner_sampled_address_mode = "VUID-vkCmdDrawIndirectCount-flags-02696"; |
| 278 | subpass_input = "VUID-vkCmdDrawIndirectCount-None-02686"; |
| 279 | imageview_atomic = "VUID-vkCmdDrawIndirectCount-None-02691"; |
| 280 | push_constants_set = "VUID-vkCmdDrawIndirectCount-None-02698"; |
| 281 | image_subresources = "VUID-vkCmdDrawIndirectCount-None-04584"; |
| 282 | descriptor_valid = "VUID-vkCmdDrawIndirectCount-None-02699"; |
| 283 | sampler_imageview_type = "VUID-vkCmdDrawIndirectCount-None-02702"; |
| 284 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawIndirectCount-None-02703"; |
| 285 | sampler_bias_offset = "VUID-vkCmdDrawIndirectCount-None-02704"; |
| 286 | vertex_binding_attribute = "VUID-vkCmdDrawIndirectCount-None-02721"; |
| 287 | dynamic_state_setting_commands = "VUID-vkCmdDrawIndirectCount-None-02859"; |
| 288 | unprotected_command_buffer = "VUID-vkCmdDrawIndirectCount-commandBuffer-02707"; |
| 289 | max_multiview_instance_index = "VUID-vkCmdDrawIndirectCount-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 290 | img_filter_cubic = "VUID-vkCmdDrawIndirectCount-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 291 | filter_cubic = "VUID-vkCmdDrawIndirectCount-filterCubic-02694"; |
| 292 | filter_cubic_min_max = "VUID-vkCmdDrawIndirectCount-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 293 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawIndirectCount-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 294 | } |
| 295 | }; |
| 296 | |
| 297 | struct DispatchVuidsCmdDrawIndexedIndirectCount : DrawDispatchVuid { |
| 298 | DispatchVuidsCmdDrawIndexedIndirectCount() : DrawDispatchVuid() { |
| 299 | queue_flag = "VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-cmdpool"; |
| 300 | inside_renderpass = "VUID-vkCmdDrawIndexedIndirectCount-renderpass"; |
| 301 | pipeline_bound = "VUID-vkCmdDrawIndexedIndirectCount-None-02700"; |
| 302 | dynamic_state = "VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-02701"; |
| 303 | vertex_binding = "VUID-vkCmdDrawIndexedIndirectCount-None-04007"; |
| 304 | vertex_binding_null = "VUID-vkCmdDrawIndexedIndirectCount-None-04008"; |
| 305 | compatible_pipeline = "VUID-vkCmdDrawIndexedIndirectCount-None-02697"; |
| 306 | render_pass_compatible = "VUID-vkCmdDrawIndexedIndirectCount-renderPass-02684"; |
| 307 | subpass_index = "VUID-vkCmdDrawIndexedIndirectCount-subpass-02685"; |
| 308 | sample_location = "VUID-vkCmdDrawIndexedIndirectCount-sampleLocationsEnable-02689"; |
| 309 | linear_sampler = "VUID-vkCmdDrawIndexedIndirectCount-magFilter-04553"; |
| 310 | cubic_sampler = "VUID-vkCmdDrawIndexedIndirectCount-None-02692"; |
| 311 | indirect_protected_cb = "VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-02711"; |
| 312 | indirect_contiguous_memory = "VUID-vkCmdDrawIndexedIndirectCount-buffer-02708"; |
| 313 | indirect_buffer_bit = "VUID-vkCmdDrawIndexedIndirectCount-buffer-02709"; |
| 314 | viewport_count = "VUID-vkCmdDrawIndexedIndirectCount-viewportCount-03417"; |
| 315 | scissor_count = "VUID-vkCmdDrawIndexedIndirectCount-scissorCount-03418"; |
| 316 | viewport_scissor_count = "VUID-vkCmdDrawIndexedIndirectCount-viewportCount-03419"; |
| 317 | primitive_topology = "VUID-vkCmdDrawIndexedIndirectCount-primitiveTopology-03420"; |
| 318 | corner_sampled_address_mode = "VUID-vkCmdDrawIndexedIndirectCount-flags-02696"; |
| 319 | subpass_input = "VUID-vkCmdDrawIndexedIndirectCount-None-02686"; |
| 320 | imageview_atomic = "VUID-vkCmdDrawIndexedIndirectCount-None-02691"; |
| 321 | push_constants_set = "VUID-vkCmdDrawIndexedIndirectCount-None-02698"; |
| 322 | image_subresources = "VUID-vkCmdDrawIndexedIndirectCount-None-04584"; |
| 323 | descriptor_valid = "VUID-vkCmdDrawIndexedIndirectCount-None-02699"; |
| 324 | sampler_imageview_type = "VUID-vkCmdDrawIndexedIndirectCount-None-02702"; |
| 325 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawIndexedIndirectCount-None-02703"; |
| 326 | sampler_bias_offset = "VUID-vkCmdDrawIndexedIndirectCount-None-02704"; |
| 327 | vertex_binding_attribute = "VUID-vkCmdDrawIndexedIndirectCount-None-02721"; |
| 328 | dynamic_state_setting_commands = "VUID-vkCmdDrawIndexedIndirectCount-None-02859"; |
| 329 | unprotected_command_buffer = "VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-02707"; |
| 330 | max_multiview_instance_index = "VUID-vkCmdDrawIndexedIndirectCount-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 331 | img_filter_cubic = "VUID-vkCmdDrawIndexedIndirectCount-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 332 | filter_cubic = "VUID-vkCmdDrawIndexedIndirectCount-filterCubic-02694"; |
| 333 | filter_cubic_min_max = "VUID-vkCmdDrawIndexedIndirectCount-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 334 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawIndexedIndirectCount-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 335 | } |
| 336 | }; |
| 337 | |
| 338 | struct DispatchVuidsCmdTraceRaysNV: DrawDispatchVuid { |
| 339 | DispatchVuidsCmdTraceRaysNV() : DrawDispatchVuid() { |
| 340 | queue_flag = "VUID-vkCmdTraceRaysNV-commandBuffer-cmdpool"; |
| 341 | inside_renderpass = "VUID-vkCmdTraceRaysNV-renderpass"; |
| 342 | pipeline_bound = "VUID-vkCmdTraceRaysNV-None-02700"; |
| 343 | dynamic_state = "VUID-vkCmdTraceRaysNV-commandBuffer-02701"; |
| 344 | compatible_pipeline = "VUID-vkCmdTraceRaysNV-None-02697"; |
| 345 | linear_sampler = "VUID-vkCmdTraceRaysNV-magFilter-04553"; |
| 346 | cubic_sampler = "VUID-vkCmdTraceRaysNV-None-02692"; |
| 347 | corner_sampled_address_mode = "VUID-vkCmdTraceRaysNV-flags-02696"; |
| 348 | imageview_atomic = "VUID-vkCmdTraceRaysNV-None-02691"; |
| 349 | push_constants_set = "VUID-vkCmdTraceRaysNV-None-02698"; |
| 350 | descriptor_valid = "VUID-vkCmdTraceRaysNV-None-02699"; |
| 351 | sampler_imageview_type = "VUID-vkCmdTraceRaysNV-None-02702"; |
| 352 | sampler_implicitLod_dref_proj = "VUID-vkCmdTraceRaysNV-None-02703"; |
| 353 | sampler_bias_offset = "VUID-vkCmdTraceRaysNV-None-02704"; |
| 354 | dynamic_state_setting_commands = "VUID-vkCmdTraceRaysNV-None-02859"; |
| 355 | unprotected_command_buffer = "VUID-vkCmdTraceRaysNV-commandBuffer-02707"; |
| 356 | protected_command_buffer = "VUID-vkCmdTraceRaysNV-commandBuffer-02712"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 357 | img_filter_cubic = "VUID-vkCmdTraceRaysNV-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 358 | filter_cubic = "VUID-vkCmdTraceRaysNV-filterCubic-02694"; |
| 359 | filter_cubic_min_max = "VUID-vkCmdTraceRaysNV-filterCubicMinmax-02695"; |
| 360 | } |
| 361 | }; |
| 362 | |
| 363 | struct DispatchVuidsCmdTraceRaysKHR: DrawDispatchVuid { |
| 364 | DispatchVuidsCmdTraceRaysKHR() : DrawDispatchVuid() { |
| 365 | queue_flag = "VUID-vkCmdTraceRaysKHR-commandBuffer-cmdpool"; |
| 366 | inside_renderpass = "VUID-vkCmdTraceRaysKHR-renderpass"; |
| 367 | pipeline_bound = "VUID-vkCmdTraceRaysKHR-None-02700"; |
| 368 | dynamic_state = "VUID-vkCmdTraceRaysKHR-commandBuffer-02701"; |
| 369 | compatible_pipeline = "VUID-vkCmdTraceRaysKHR-None-02697"; |
| 370 | linear_sampler = "VUID-vkCmdTraceRaysKHR-magFilter-04553"; |
| 371 | cubic_sampler = "VUID-vkCmdTraceRaysKHR-None-02692"; |
| 372 | corner_sampled_address_mode = "VUID-vkCmdTraceRaysKHR-flags-02696"; |
| 373 | imageview_atomic = "VUID-vkCmdTraceRaysKHR-None-02691"; |
| 374 | push_constants_set = "VUID-vkCmdTraceRaysKHR-None-02698"; |
| 375 | descriptor_valid = "VUID-vkCmdTraceRaysKHR-None-02699"; |
| 376 | sampler_imageview_type = "VUID-vkCmdTraceRaysKHR-None-02702"; |
| 377 | sampler_implicitLod_dref_proj = "VUID-vkCmdTraceRaysKHR-None-02703"; |
| 378 | sampler_bias_offset = "VUID-vkCmdTraceRaysKHR-None-02704"; |
| 379 | dynamic_state_setting_commands = "VUID-vkCmdTraceRaysKHR-None-02859"; |
| 380 | unprotected_command_buffer = "VUID-vkCmdTraceRaysKHR-commandBuffer-02707"; |
| 381 | protected_command_buffer = "VUID-vkCmdTraceRaysKHR-commandBuffer-02712"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 382 | img_filter_cubic = "VUID-vkCmdTraceRaysKHR-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 383 | filter_cubic = "VUID-vkCmdTraceRaysKHR-filterCubic-02694"; |
| 384 | filter_cubic_min_max = "VUID-vkCmdTraceRaysKHR-filterCubicMinmax-02695"; |
| 385 | } |
| 386 | }; |
| 387 | |
| 388 | struct DispatchVuidsCmdTraceRaysIndirectKHR: DrawDispatchVuid { |
| 389 | DispatchVuidsCmdTraceRaysIndirectKHR() : DrawDispatchVuid() { |
| 390 | queue_flag = "VUID-vkCmdTraceRaysIndirectKHR-commandBuffer-cmdpool"; |
| 391 | inside_renderpass = "VUID-vkCmdTraceRaysIndirectKHR-renderpass"; |
| 392 | pipeline_bound = "VUID-vkCmdTraceRaysIndirectKHR-None-02700"; |
| 393 | dynamic_state = "VUID-vkCmdTraceRaysIndirectKHR-commandBuffer-02701"; |
| 394 | compatible_pipeline = "VUID-vkCmdTraceRaysIndirectKHR-None-02697"; |
| 395 | linear_sampler = "VUID-vkCmdTraceRaysIndirectKHR-magFilter-04553"; |
| 396 | cubic_sampler = "VUID-vkCmdTraceRaysIndirectKHR-None-02692"; |
| 397 | indirect_protected_cb = "VUID-vkCmdTraceRaysIndirectKHR-commandBuffer-02711"; |
| 398 | indirect_contiguous_memory = "VUID-vkCmdTraceRaysIndirectKHR-buffer-02708"; |
| 399 | indirect_buffer_bit = "VUID-vkCmdTraceRaysIndirectKHR-buffer-02709"; |
| 400 | corner_sampled_address_mode = "VUID-vkCmdTraceRaysIndirectKHR-flags-02696"; |
| 401 | imageview_atomic = "VUID-vkCmdTraceRaysIndirectKHR-None-02691"; |
| 402 | push_constants_set = "VUID-vkCmdTraceRaysIndirectKHR-None-02698"; |
| 403 | descriptor_valid = "VUID-vkCmdTraceRaysIndirectKHR-None-02699"; |
| 404 | sampler_imageview_type = "VUID-vkCmdTraceRaysIndirectKHR-None-02702"; |
| 405 | sampler_implicitLod_dref_proj = "VUID-vkCmdTraceRaysIndirectKHR-None-02703"; |
| 406 | sampler_bias_offset = "VUID-vkCmdTraceRaysIndirectKHR-None-02704"; |
| 407 | dynamic_state_setting_commands = "VUID-vkCmdTraceRaysIndirectKHR-None-02859"; |
| 408 | unprotected_command_buffer = "VUID-vkCmdTraceRaysIndirectKHR-commandBuffer-02707"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 409 | img_filter_cubic = "VUID-vkCmdTraceRaysIndirectKHR-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 410 | filter_cubic = "VUID-vkCmdTraceRaysIndirectKHR-filterCubic-02694"; |
| 411 | filter_cubic_min_max = "VUID-vkCmdTraceRaysIndirectKHR-filterCubicMinmax-02695"; |
| 412 | } |
| 413 | }; |
| 414 | |
| 415 | struct DispatchVuidsCmdDrawMeshTasksNV: DrawDispatchVuid { |
| 416 | DispatchVuidsCmdDrawMeshTasksNV() : DrawDispatchVuid() { |
| 417 | queue_flag = "VUID-vkCmdDrawMeshTasksNV-commandBuffer-cmdpool"; |
| 418 | inside_renderpass = "VUID-vkCmdDrawMeshTasksNV-renderpass"; |
| 419 | pipeline_bound = "VUID-vkCmdDrawMeshTasksNV-None-02700"; |
| 420 | dynamic_state = "VUID-vkCmdDrawMeshTasksNV-commandBuffer-02701"; |
| 421 | compatible_pipeline = "VUID-vkCmdDrawMeshTasksNV-None-02697"; |
| 422 | render_pass_compatible = "VUID-vkCmdDrawMeshTasksNV-renderPass-02684"; |
| 423 | subpass_index = "VUID-vkCmdDrawMeshTasksNV-subpass-02685"; |
| 424 | sample_location = "VUID-vkCmdDrawMeshTasksNV-sampleLocationsEnable-02689"; |
| 425 | linear_sampler = "VUID-vkCmdDrawMeshTasksNV-magFilter-04553"; |
| 426 | cubic_sampler = "VUID-vkCmdDrawMeshTasksNV-None-02692"; |
| 427 | viewport_count = "VUID-vkCmdDrawMeshTasksNV-viewportCount-03417"; |
| 428 | scissor_count = "VUID-vkCmdDrawMeshTasksNV-scissorCount-03418"; |
| 429 | viewport_scissor_count = "VUID-vkCmdDrawMeshTasksNV-viewportCount-03419"; |
| 430 | primitive_topology = "VUID-vkCmdDrawMeshTasksNV-primitiveTopology-03420"; |
| 431 | corner_sampled_address_mode = "VUID-vkCmdDrawMeshTasksNV-flags-02696"; |
| 432 | subpass_input = "VUID-vkCmdDrawMeshTasksNV-None-02686"; |
| 433 | imageview_atomic = "VUID-vkCmdDrawMeshTasksNV-None-02691"; |
| 434 | push_constants_set = "VUID-vkCmdDrawMeshTasksNV-None-02698"; |
| 435 | image_subresources = "VUID-vkCmdDrawMeshTasksNV-None-04584"; |
| 436 | descriptor_valid = "VUID-vkCmdDrawMeshTasksNV-None-02699"; |
| 437 | sampler_imageview_type = "VUID-vkCmdDrawMeshTasksNV-None-02702"; |
| 438 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawMeshTasksNV-None-02703"; |
| 439 | sampler_bias_offset = "VUID-vkCmdDrawMeshTasksNV-None-02704"; |
| 440 | dynamic_state_setting_commands = "VUID-vkCmdDrawMeshTasksNV-None-02859"; |
| 441 | unprotected_command_buffer = "VUID-vkCmdDrawMeshTasksNV-commandBuffer-02707"; |
| 442 | max_multiview_instance_index = "VUID-vkCmdDrawMeshTasksNV-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 443 | img_filter_cubic = "VUID-vkCmdDrawMeshTasksNV-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 444 | filter_cubic = "VUID-vkCmdDrawMeshTasksNV-filterCubic-02694"; |
| 445 | filter_cubic_min_max = "VUID-vkCmdDrawMeshTasksNV-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 446 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawMeshTasksNV-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 447 | } |
| 448 | }; |
| 449 | |
| 450 | struct DispatchVuidsCmdDrawMeshTasksIndirectNV: DrawDispatchVuid { |
| 451 | DispatchVuidsCmdDrawMeshTasksIndirectNV() : DrawDispatchVuid() { |
| 452 | queue_flag = "VUID-vkCmdDrawMeshTasksIndirectNV-commandBuffer-cmdpool"; |
| 453 | inside_renderpass = "VUID-vkCmdDrawMeshTasksIndirectNV-renderpass"; |
| 454 | pipeline_bound = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02700"; |
| 455 | dynamic_state = "VUID-vkCmdDrawMeshTasksIndirectNV-commandBuffer-02701"; |
| 456 | compatible_pipeline = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02697"; |
| 457 | render_pass_compatible = "VUID-vkCmdDrawMeshTasksIndirectNV-renderPass-02684"; |
| 458 | subpass_index = "VUID-vkCmdDrawMeshTasksIndirectNV-subpass-02685"; |
| 459 | sample_location = "VUID-vkCmdDrawMeshTasksIndirectNV-sampleLocationsEnable-02689"; |
| 460 | linear_sampler = "VUID-vkCmdDrawMeshTasksIndirectNV-magFilter-04553"; |
| 461 | cubic_sampler = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02692"; |
| 462 | indirect_protected_cb = "VUID-vkCmdDrawMeshTasksIndirectNV-commandBuffer-02711"; |
| 463 | indirect_contiguous_memory = "VUID-vkCmdDrawMeshTasksIndirectNV-buffer-02708"; |
| 464 | indirect_buffer_bit = "VUID-vkCmdDrawMeshTasksIndirectNV-buffer-02709"; |
| 465 | viewport_count = "VUID-vkCmdDrawMeshTasksIndirectNV-viewportCount-03417"; |
| 466 | scissor_count = "VUID-vkCmdDrawMeshTasksIndirectNV-scissorCount-03418"; |
| 467 | viewport_scissor_count = "VUID-vkCmdDrawMeshTasksIndirectNV-viewportCount-03419"; |
| 468 | primitive_topology = "VUID-vkCmdDrawMeshTasksIndirectNV-primitiveTopology-03420"; |
| 469 | corner_sampled_address_mode = "VUID-vkCmdDrawMeshTasksIndirectNV-flags-02696"; |
| 470 | subpass_input = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02686"; |
| 471 | imageview_atomic = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02691"; |
| 472 | push_constants_set = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02698"; |
| 473 | image_subresources = "VUID-vkCmdDrawMeshTasksIndirectNV-None-04584"; |
| 474 | descriptor_valid = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02699"; |
| 475 | sampler_imageview_type = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02702"; |
| 476 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02703"; |
| 477 | sampler_bias_offset = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02704"; |
| 478 | dynamic_state_setting_commands = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02859"; |
| 479 | unprotected_command_buffer = "VUID-vkCmdDrawMeshTasksIndirectNV-commandBuffer-02707"; |
| 480 | max_multiview_instance_index = "VUID-vkCmdDrawMeshTasksIndirectNV-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 481 | img_filter_cubic = "VUID-vkCmdDrawMeshTasksIndirectNV-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 482 | filter_cubic = "VUID-vkCmdDrawMeshTasksIndirectNV-filterCubic-02694"; |
| 483 | filter_cubic_min_max = "VUID-vkCmdDrawMeshTasksIndirectNV-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 484 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawMeshTasksIndirectNV-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 485 | } |
| 486 | }; |
| 487 | |
| 488 | struct DispatchVuidsCmdDrawMeshTasksIndirectCountNV : DrawDispatchVuid { |
| 489 | DispatchVuidsCmdDrawMeshTasksIndirectCountNV() : DrawDispatchVuid() { |
| 490 | queue_flag = "VUID-vkCmdDrawMeshTasksIndirectCountNV-commandBuffer-cmdpool"; |
| 491 | inside_renderpass = "VUID-vkCmdDrawMeshTasksIndirectCountNV-renderpass"; |
| 492 | pipeline_bound = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02700"; |
| 493 | dynamic_state = "VUID-vkCmdDrawMeshTasksIndirectCountNV-commandBuffer-02701"; |
| 494 | compatible_pipeline = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02697"; |
| 495 | render_pass_compatible = "VUID-vkCmdDrawMeshTasksIndirectCountNV-renderPass-02684"; |
| 496 | subpass_index = "VUID-vkCmdDrawMeshTasksIndirectCountNV-subpass-02685"; |
| 497 | sample_location = "VUID-vkCmdDrawMeshTasksIndirectCountNV-sampleLocationsEnable-02689"; |
| 498 | linear_sampler = "VUID-vkCmdDrawMeshTasksIndirectCountNV-magFilter-04553"; |
| 499 | cubic_sampler = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02692"; |
| 500 | indirect_protected_cb = "VUID-vkCmdDrawMeshTasksIndirectCountNV-commandBuffer-02711"; |
| 501 | indirect_contiguous_memory = "VUID-vkCmdDrawMeshTasksIndirectCountNV-buffer-02708"; |
| 502 | indirect_buffer_bit = "VUID-vkCmdDrawMeshTasksIndirectCountNV-buffer-02709"; |
| 503 | viewport_count = "VUID-vkCmdDrawMeshTasksIndirectCountNV-viewportCount-03417"; |
| 504 | scissor_count = "VUID-vkCmdDrawMeshTasksIndirectCountNV-scissorCount-03418"; |
| 505 | viewport_scissor_count = "VUID-vkCmdDrawMeshTasksIndirectCountNV-viewportCount-03419"; |
| 506 | primitive_topology = "VUID-vkCmdDrawMeshTasksIndirectCountNV-primitiveTopology-03420"; |
| 507 | corner_sampled_address_mode = "VUID-vkCmdDrawMeshTasksIndirectCountNV-flags-02696"; |
| 508 | subpass_input = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02686"; |
| 509 | imageview_atomic = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02691"; |
| 510 | push_constants_set = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02698"; |
| 511 | image_subresources = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-04584"; |
| 512 | descriptor_valid = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02699"; |
| 513 | sampler_imageview_type = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02702"; |
| 514 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02703"; |
| 515 | sampler_bias_offset = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02704"; |
| 516 | dynamic_state_setting_commands = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02859"; |
| 517 | unprotected_command_buffer = "VUID-vkCmdDrawMeshTasksIndirectCountNV-commandBuffer-02707"; |
| 518 | max_multiview_instance_index = "VUID-vkCmdDrawMeshTasksIndirectCountNV-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 519 | img_filter_cubic = "VUID-vkCmdDrawMeshTasksIndirectCountNV-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 520 | filter_cubic = "VUID-vkCmdDrawMeshTasksIndirectCountNV-filterCubic-02694"; |
| 521 | filter_cubic_min_max = "VUID-vkCmdDrawMeshTasksIndirectCountNV-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 522 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawMeshTasksIndirectCountNV-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 523 | } |
| 524 | }; |
| 525 | |
| 526 | struct DispatchVuidsCmdDrawIndirectByteCountEXT: DrawDispatchVuid { |
| 527 | DispatchVuidsCmdDrawIndirectByteCountEXT() : DrawDispatchVuid() { |
| 528 | queue_flag = "VUID-vkCmdDrawIndirectByteCountEXT-commandBuffer-cmdpool"; |
| 529 | inside_renderpass = "VUID-vkCmdDrawIndirectByteCountEXT-renderpass"; |
| 530 | pipeline_bound = "VUID-vkCmdDrawIndirectByteCountEXT-None-02700"; |
| 531 | dynamic_state = "VUID-vkCmdDrawIndirectByteCountEXT-commandBuffer-02701"; |
| 532 | vertex_binding = "VUID-vkCmdDrawIndirectByteCountEXT-None-04007"; |
| 533 | vertex_binding_null = "VUID-vkCmdDrawIndirectByteCountEXT-None-04008"; |
| 534 | compatible_pipeline = "VUID-vkCmdDrawIndirectByteCountEXT-None-02697"; |
| 535 | render_pass_compatible = "VUID-vkCmdDrawIndirectByteCountEXT-renderPass-02684"; |
| 536 | subpass_index = "VUID-vkCmdDrawIndirectByteCountEXT-subpass-02685"; |
| 537 | sample_location = "VUID-vkCmdDrawIndirectByteCountEXT-sampleLocationsEnable-02689"; |
| 538 | linear_sampler = "VUID-vkCmdDrawIndirectByteCountEXT-magFilter-04553"; |
| 539 | cubic_sampler = "VUID-vkCmdDrawIndirectByteCountEXT-None-02692"; |
| 540 | indirect_protected_cb = "VUID-vkCmdDrawIndirectByteCountEXT-commandBuffer-02646"; |
| 541 | indirect_contiguous_memory = "UNASSIGNED-vkCmdDrawIndirectByteCountEXT-buffer", // TODO - Update when header are updated |
| 542 | indirect_buffer_bit = "VUID-vkCmdDrawIndirectByteCountEXT-counterBuffer-02290"; |
| 543 | viewport_count = "VUID-vkCmdDrawIndirectByteCountEXT-viewportCount-03417"; |
| 544 | scissor_count = "VUID-vkCmdDrawIndirectByteCountEXT-scissorCount-03418"; |
| 545 | viewport_scissor_count = "VUID-vkCmdDrawIndirectByteCountEXT-viewportCount-03419"; |
| 546 | primitive_topology = "VUID-vkCmdDrawIndirectByteCountEXT-primitiveTopology-03420"; |
| 547 | corner_sampled_address_mode = "VUID-vkCmdDrawIndirectByteCountEXT-flags-02696"; |
| 548 | subpass_input = "VUID-vkCmdDrawIndirectByteCountEXT-None-02686"; |
| 549 | imageview_atomic = "VUID-vkCmdDrawIndirectByteCountEXT-None-02691"; |
| 550 | push_constants_set = "VUID-vkCmdDrawIndirectByteCountEXT-None-02698"; |
| 551 | image_subresources = "VUID-vkCmdDrawIndirectByteCountEXT-None-04584"; |
| 552 | descriptor_valid = "VUID-vkCmdDrawIndirectByteCountEXT-None-02699"; |
| 553 | sampler_imageview_type = "VUID-vkCmdDrawIndirectByteCountEXT-None-02702"; |
| 554 | sampler_implicitLod_dref_proj = "VUID-vkCmdDrawIndirectByteCountEXT-None-02703"; |
| 555 | sampler_bias_offset = "VUID-vkCmdDrawIndirectByteCountEXT-None-02704"; |
| 556 | vertex_binding_attribute = "VUID-vkCmdDrawIndirectByteCountEXT-None-02721"; |
| 557 | dynamic_state_setting_commands = "VUID-vkCmdDrawIndirectByteCountEXT-None-02859"; |
| 558 | unprotected_command_buffer = "VUID-vkCmdDrawIndirectByteCountEXT-commandBuffer-02707"; |
| 559 | max_multiview_instance_index = "VUID-vkCmdDrawIndirectByteCountEXT-maxMultiviewInstanceIndex-02688"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 560 | img_filter_cubic = "VUID-vkCmdDrawIndirectByteCountEXT-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 561 | filter_cubic = "VUID-vkCmdDrawIndirectByteCountEXT-filterCubic-02694"; |
| 562 | filter_cubic_min_max = "VUID-vkCmdDrawIndirectByteCountEXT-filterCubicMinmax-02695"; |
Tobias Hector | 6663c9b | 2020-11-05 10:18:02 +0000 | [diff] [blame] | 563 | viewport_count_primitive_shading_rate = "VUID-vkCmdDrawIndirectByteCountEXT-primitiveFragmentShadingRateWithMultipleViewports-04552"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 564 | } |
| 565 | }; |
| 566 | |
| 567 | struct DispatchVuidsCmdDispatchBase: DrawDispatchVuid { |
| 568 | DispatchVuidsCmdDispatchBase() : DrawDispatchVuid() { |
| 569 | queue_flag = "VUID-vkCmdDispatchBase-commandBuffer-cmdpool"; |
| 570 | inside_renderpass = "VUID-vkCmdDispatchBase-renderpass"; |
| 571 | pipeline_bound = "VUID-vkCmdDispatchBase-None-02700"; |
| 572 | compatible_pipeline = "VUID-vkCmdDispatchBase-None-02697"; |
| 573 | linear_sampler = "VUID-vkCmdDispatchBase-magFilter-04553"; |
| 574 | cubic_sampler = "VUID-vkCmdDispatchBase-None-02692"; |
| 575 | corner_sampled_address_mode = "VUID-vkCmdDispatchBase-flags-02696"; |
| 576 | imageview_atomic = "VUID-vkCmdDispatchBase-None-02691"; |
| 577 | push_constants_set = "VUID-vkCmdDispatchBase-None-02698"; |
| 578 | descriptor_valid = "VUID-vkCmdDispatchBase-None-02699"; |
| 579 | sampler_imageview_type = "VUID-vkCmdDispatchBase-None-02702"; |
| 580 | sampler_implicitLod_dref_proj = "VUID-vkCmdDispatchBase-None-02703"; |
| 581 | sampler_bias_offset = "VUID-vkCmdDispatchBase-None-02704"; |
| 582 | dynamic_state_setting_commands = "VUID-vkCmdDispatchBase-None-02859"; |
| 583 | unprotected_command_buffer = "VUID-vkCmdDispatchBase-commandBuffer-02707"; |
Mark Lobodzinski | f786b41 | 2020-11-30 12:16:17 -0700 | [diff] [blame] | 584 | img_filter_cubic = "VUID-vkCmdDispatchBase-None-02693"; |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 585 | filter_cubic = "VUID-vkCmdDispatchBase-filterCubic-02694"; |
| 586 | filter_cubic_min_max = "VUID-vkCmdDispatchBase-filterCubicMinmax-02695"; |
| 587 | } |
| 588 | }; |
| 589 | |
| 590 | // This LUT is created to allow a static listing of each VUID that is covered by drawdispatch commands |
Nathaniel Cesario | ce9b481 | 2020-12-17 08:55:28 -0700 | [diff] [blame] | 591 | static const std::map<CMD_TYPE, DrawDispatchVuid> kDrawdispatchVuid = { |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 592 | {CMD_DRAW, DispatchVuidsCmdDraw()}, |
| 593 | {CMD_DRAWINDEXED, DispatchVuidsCmdDrawIndexed()}, |
| 594 | {CMD_DRAWINDIRECT, DispatchVuidsCmdDrawIndirect()}, |
| 595 | {CMD_DRAWINDEXEDINDIRECT, DispatchVuidsCmdDrawIndexedIndirect()}, |
| 596 | {CMD_DISPATCH, DispatchVuidsCmdDispatch()}, |
| 597 | {CMD_DISPATCHINDIRECT, DispatchVuidsCmdDispatchIndirect()}, |
| 598 | {CMD_DRAWINDIRECTCOUNT, DispatchVuidsCmdDrawIndirectCount()}, |
| 599 | {CMD_DRAWINDEXEDINDIRECTCOUNT, DispatchVuidsCmdDrawIndexedIndirectCount()}, |
| 600 | {CMD_TRACERAYSNV, DispatchVuidsCmdTraceRaysNV()}, |
| 601 | {CMD_TRACERAYSKHR, DispatchVuidsCmdTraceRaysKHR()}, |
| 602 | {CMD_TRACERAYSINDIRECTKHR, DispatchVuidsCmdTraceRaysIndirectKHR()}, |
| 603 | {CMD_DRAWMESHTASKSNV, DispatchVuidsCmdDrawMeshTasksNV()}, |
| 604 | {CMD_DRAWMESHTASKSINDIRECTNV, DispatchVuidsCmdDrawMeshTasksIndirectNV()}, |
| 605 | {CMD_DRAWMESHTASKSINDIRECTCOUNTNV, DispatchVuidsCmdDrawMeshTasksIndirectCountNV()}, |
| 606 | {CMD_DRAWINDIRECTBYTECOUNTEXT, DispatchVuidsCmdDrawIndirectByteCountEXT()}, |
| 607 | {CMD_DISPATCHBASE, DispatchVuidsCmdDispatchBase()}, |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 608 | // Used if invalid cmd_type is used |
Mark Lobodzinski | ddf4361 | 2020-11-17 11:28:02 -0700 | [diff] [blame] | 609 | {CMD_NONE, DrawDispatchVuid()} |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 610 | }; |
| 611 | // clang-format on |
| 612 | |
| 613 | // Getter function to provide kVUIDUndefined in case an invalid cmd_type is passed in |
| 614 | const DrawDispatchVuid &CoreChecks::GetDrawDispatchVuid(CMD_TYPE cmd_type) const { |
Nathaniel Cesario | ce9b481 | 2020-12-17 08:55:28 -0700 | [diff] [blame] | 615 | if (kDrawdispatchVuid.find(cmd_type) != kDrawdispatchVuid.cend()) { |
| 616 | return kDrawdispatchVuid.at(cmd_type); |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 617 | } else { |
Nathaniel Cesario | ce9b481 | 2020-12-17 08:55:28 -0700 | [diff] [blame] | 618 | return kDrawdispatchVuid.at(CMD_NONE); |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 619 | } |
| 620 | } |
| 621 | |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 622 | // Generic function to handle validation for all CmdDraw* type functions |
| 623 | bool CoreChecks::ValidateCmdDrawType(VkCommandBuffer cmd_buffer, bool indexed, VkPipelineBindPoint bind_point, CMD_TYPE cmd_type, |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 624 | const char *caller, VkQueueFlags queue_flags) const { |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 625 | bool skip = false; |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 626 | const DrawDispatchVuid vuid = GetDrawDispatchVuid(cmd_type); |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 627 | const CMD_BUFFER_STATE *cb_state = GetCBState(cmd_buffer); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 628 | if (cb_state) { |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 629 | skip |= ValidateCmdQueueFlags(cb_state, caller, queue_flags, vuid.queue_flag); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 630 | skip |= ValidateCmd(cb_state, cmd_type, caller); |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 631 | skip |= ValidateCmdBufDrawState(cb_state, cmd_type, indexed, bind_point, caller); |
| 632 | skip |= (VK_PIPELINE_BIND_POINT_GRAPHICS == bind_point) ? OutsideRenderPass(cb_state, caller, vuid.inside_renderpass) |
| 633 | : InsideRenderPass(cb_state, caller, vuid.inside_renderpass); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 634 | } |
| 635 | return skip; |
| 636 | } |
| 637 | |
locke-lunarg | 3fa463a | 2020-10-23 16:39:04 -0600 | [diff] [blame] | 638 | bool CoreChecks::ValidateCmdDrawInstance(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, |
| 639 | CMD_TYPE cmd_type, const char *caller) const { |
| 640 | bool skip = false; |
| 641 | const DrawDispatchVuid vuid = GetDrawDispatchVuid(cmd_type); |
| 642 | const auto *cb_node = Get<CMD_BUFFER_STATE>(commandBuffer); |
| 643 | if (!cb_node) return skip; |
| 644 | |
| 645 | // Verify maxMultiviewInstanceIndex |
| 646 | if (cb_node->activeRenderPass && cb_node->activeRenderPass->renderPass && enabled_features.multiview_features.multiview && |
| 647 | ((instanceCount + firstInstance) > phys_dev_ext_props.multiview_props.maxMultiviewInstanceIndex)) { |
| 648 | LogObjectList objlist(commandBuffer); |
| 649 | objlist.add(cb_node->activeRenderPass->renderPass); |
| 650 | skip |= LogError(objlist, vuid.max_multiview_instance_index, |
| 651 | "%s: multiview is enabled, and maxMultiviewInstanceIndex: %" PRIu32 ", but instanceCount: %" PRIu32 |
| 652 | "and firstInstance: %" PRIu32 ".", |
| 653 | caller, report_data->FormatHandle(cb_node->activeRenderPass->renderPass).c_str(), |
| 654 | phys_dev_ext_props.multiview_props.maxMultiviewInstanceIndex, instanceCount, firstInstance); |
| 655 | } |
| 656 | return skip; |
| 657 | } |
| 658 | |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 659 | bool CoreChecks::PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 660 | uint32_t firstVertex, uint32_t firstInstance) const { |
locke-lunarg | 3fa463a | 2020-10-23 16:39:04 -0600 | [diff] [blame] | 661 | bool skip = false; |
| 662 | skip |= ValidateCmdDrawInstance(commandBuffer, instanceCount, firstInstance, CMD_DRAW, "vkCmdDraw()"); |
| 663 | skip |= |
| 664 | ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAW, "vkCmdDraw()", VK_QUEUE_GRAPHICS_BIT); |
| 665 | return skip; |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 666 | } |
| 667 | |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 668 | bool CoreChecks::PreCallValidateCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 669 | uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) const { |
locke-lunarg | 3fa463a | 2020-10-23 16:39:04 -0600 | [diff] [blame] | 670 | bool skip = false; |
| 671 | skip |= ValidateCmdDrawInstance(commandBuffer, instanceCount, firstInstance, CMD_DRAWINDEXED, "vkCmdDrawIndexed()"); |
| 672 | skip |= ValidateCmdDrawType(commandBuffer, true, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWINDEXED, "vkCmdDrawIndexed()", |
| 673 | VK_QUEUE_GRAPHICS_BIT); |
Jeff Bolz | 46c0ea0 | 2019-10-09 13:06:29 -0500 | [diff] [blame] | 674 | const CMD_BUFFER_STATE *cb_state = GetCBState(commandBuffer); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 675 | if (!skip && (cb_state->status & CBSTATUS_INDEX_BUFFER_BOUND)) { |
| 676 | unsigned int index_size = 0; |
| 677 | const auto &index_buffer_binding = cb_state->index_buffer_binding; |
| 678 | if (index_buffer_binding.index_type == VK_INDEX_TYPE_UINT16) { |
| 679 | index_size = 2; |
| 680 | } else if (index_buffer_binding.index_type == VK_INDEX_TYPE_UINT32) { |
| 681 | index_size = 4; |
Piers Daniell | 5070e3e | 2019-08-20 13:39:35 -0600 | [diff] [blame] | 682 | } else if (index_buffer_binding.index_type == VK_INDEX_TYPE_UINT8_EXT) { |
| 683 | index_size = 1; |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 684 | } |
Nathaniel Cesario | ce9b481 | 2020-12-17 08:55:28 -0700 | [diff] [blame] | 685 | VkDeviceSize end_offset = (index_size * (static_cast<VkDeviceSize>(firstIndex) + indexCount)) + index_buffer_binding.offset; |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 686 | if (end_offset > index_buffer_binding.size) { |
Mark Lobodzinski | cf0e6d3 | 2020-01-30 12:12:58 -0700 | [diff] [blame] | 687 | skip |= |
locke-lunarg | 1ae57d6 | 2020-11-18 10:49:19 -0700 | [diff] [blame] | 688 | LogError(index_buffer_binding.buffer_state->buffer, "VUID-vkCmdDrawIndexed-indexSize-00463", |
Mark Lobodzinski | cf0e6d3 | 2020-01-30 12:12:58 -0700 | [diff] [blame] | 689 | "vkCmdDrawIndexed() index size (%d) * (firstIndex (%d) + indexCount (%d)) " |
| 690 | "+ binding offset (%" PRIuLEAST64 ") = an ending offset of %" PRIuLEAST64 |
| 691 | " bytes, which is greater than the index buffer size (%" PRIuLEAST64 ").", |
| 692 | index_size, firstIndex, indexCount, index_buffer_binding.offset, end_offset, index_buffer_binding.size); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 693 | } |
| 694 | } |
| 695 | return skip; |
| 696 | } |
| 697 | |
Tony-LunarG | c0c3df5 | 2020-11-20 13:47:10 -0700 | [diff] [blame] | 698 | bool CoreChecks::PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 699 | uint32_t drawCount, uint32_t stride) const { |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 700 | bool skip = ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWINDIRECT, "vkCmdDrawIndirect()", |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 701 | VK_QUEUE_GRAPHICS_BIT); |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 702 | const BUFFER_STATE *buffer_state = GetBufferState(buffer); |
sfricke-samsung | 0c45edc | 2020-07-01 22:19:53 -0700 | [diff] [blame] | 703 | skip |= ValidateIndirectCmd(commandBuffer, buffer, CMD_DRAWINDIRECT, "vkCmdDrawIndirect()"); |
Tony-LunarG | c0c3df5 | 2020-11-20 13:47:10 -0700 | [diff] [blame] | 704 | if (drawCount > 1) { |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 705 | skip |= ValidateCmdDrawStrideWithStruct(commandBuffer, "VUID-vkCmdDrawIndirect-drawCount-00476", stride, |
| 706 | "VkDrawIndirectCommand", sizeof(VkDrawIndirectCommand)); |
Tony-LunarG | c0c3df5 | 2020-11-20 13:47:10 -0700 | [diff] [blame] | 707 | skip |= ValidateCmdDrawStrideWithBuffer(commandBuffer, "VUID-vkCmdDrawIndirect-drawCount-00488", stride, |
| 708 | "VkDrawIndirectCommand", sizeof(VkDrawIndirectCommand), drawCount, offset, |
| 709 | buffer_state); |
| 710 | } else if ((drawCount == 1) && (offset + sizeof(VkDrawIndirectCommand)) > buffer_state->createInfo.size) { |
| 711 | skip |= LogError(commandBuffer, "VUID-vkCmdDrawIndirect-drawCount-00487", |
| 712 | "CmdDrawIndirect: drawCount equals 1 and (offset + sizeof(VkDrawIndirectCommand)) (%u) is not less than " |
| 713 | "or equal to the size of buffer (%u).", |
| 714 | (offset + sizeof(VkDrawIndirectCommand)), buffer_state->createInfo.size); |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 715 | } |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 716 | // TODO: If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the |
| 717 | // VkDrawIndirectCommand structures accessed by this command must be 0, which will require access to the contents of 'buffer'. |
| 718 | return skip; |
| 719 | } |
| 720 | |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 721 | bool CoreChecks::PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
Tony-LunarG | c0c3df5 | 2020-11-20 13:47:10 -0700 | [diff] [blame] | 722 | uint32_t drawCount, uint32_t stride) const { |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 723 | bool skip = ValidateCmdDrawType(commandBuffer, true, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWINDEXEDINDIRECT, |
| 724 | "vkCmdDrawIndexedIndirect()", VK_QUEUE_GRAPHICS_BIT); |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 725 | const BUFFER_STATE *buffer_state = GetBufferState(buffer); |
sfricke-samsung | 0c45edc | 2020-07-01 22:19:53 -0700 | [diff] [blame] | 726 | skip |= ValidateIndirectCmd(commandBuffer, buffer, CMD_DRAWINDEXEDINDIRECT, "vkCmdDrawIndexedIndirect()"); |
Tony-LunarG | c0c3df5 | 2020-11-20 13:47:10 -0700 | [diff] [blame] | 727 | if (drawCount > 1) { |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 728 | skip |= ValidateCmdDrawStrideWithStruct(commandBuffer, "VUID-vkCmdDrawIndexedIndirect-drawCount-00528", stride, |
| 729 | "VkDrawIndexedIndirectCommand", sizeof(VkDrawIndexedIndirectCommand)); |
| 730 | skip |= ValidateCmdDrawStrideWithBuffer(commandBuffer, "VUID-vkCmdDrawIndexedIndirect-drawCount-00540", stride, |
Tony-LunarG | c0c3df5 | 2020-11-20 13:47:10 -0700 | [diff] [blame] | 731 | "VkDrawIndexedIndirectCommand", sizeof(VkDrawIndexedIndirectCommand), drawCount, |
| 732 | offset, buffer_state); |
| 733 | } else if ((drawCount == 1) && (offset + sizeof(VkDrawIndexedIndirectCommand)) > buffer_state->createInfo.size) { |
| 734 | skip |= LogError( |
| 735 | commandBuffer, "VUID-vkCmdDrawIndexedIndirect-drawCount-00539", |
| 736 | "CmdDrawIndexedIndirect: drawCount equals 1 and (offset + sizeof(VkDrawIndexedIndirectCommand)) (%u) is not less than " |
| 737 | "or equal to the size of buffer (%u).", |
| 738 | (offset + sizeof(VkDrawIndexedIndirectCommand)), buffer_state->createInfo.size); |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 739 | } |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 740 | // TODO: If the drawIndirectFirstInstance feature is not enabled, all the firstInstance members of the |
| 741 | // VkDrawIndexedIndirectCommand structures accessed by this command must be 0, which will require access to the contents of |
| 742 | // 'buffer'. |
| 743 | return skip; |
| 744 | } |
| 745 | |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 746 | bool CoreChecks::PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t x, uint32_t y, uint32_t z) const { |
Locke | f39c077 | 2019-04-03 14:40:02 -0600 | [diff] [blame] | 747 | bool skip = false; |
Locke | f39c077 | 2019-04-03 14:40:02 -0600 | [diff] [blame] | 748 | skip |= ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_COMPUTE, CMD_DISPATCH, "vkCmdDispatch()", |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 749 | VK_QUEUE_COMPUTE_BIT); |
Locke | f39c077 | 2019-04-03 14:40:02 -0600 | [diff] [blame] | 750 | return skip; |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 751 | } |
| 752 | |
Tony-LunarG | f825e6d | 2020-12-16 13:05:17 -0700 | [diff] [blame^] | 753 | bool CoreChecks::ValidateBaseGroups(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, |
| 754 | const char *apiName) const { |
| 755 | bool skip = false; |
| 756 | if (baseGroupX || baseGroupY || baseGroupZ) { |
| 757 | const CMD_BUFFER_STATE *cb_state = GetCBState(commandBuffer); |
| 758 | const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_COMPUTE); |
| 759 | const PIPELINE_STATE *pipeline_state = cb_state->lastBound[lv_bind_point].pipeline_state; |
| 760 | if (pipeline_state && !(pipeline_state->computePipelineCI.flags & VK_PIPELINE_CREATE_DISPATCH_BASE)) { |
| 761 | skip |= LogError(commandBuffer, "VUID-vkCmdDispatchBase-baseGroupX-00427", |
| 762 | "%s(): If any of baseGroupX, baseGroupY, or baseGroupZ are not zero, then the bound compute pipeline " |
| 763 | "must have been created with the VK_PIPELINE_CREATE_DISPATCH_BASE flag", |
| 764 | apiName); |
| 765 | } |
| 766 | } |
| 767 | return skip; |
| 768 | } |
| 769 | |
locke-lunarg | 25b6c35 | 2020-08-06 17:44:18 -0600 | [diff] [blame] | 770 | bool CoreChecks::PreCallValidateCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, |
| 771 | uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, |
| 772 | uint32_t groupCountZ) const { |
| 773 | bool skip = false; |
| 774 | skip |= ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_COMPUTE, CMD_DISPATCHBASE, "vkCmdDispatchBase()", |
| 775 | VK_QUEUE_COMPUTE_BIT); |
Tony-LunarG | f825e6d | 2020-12-16 13:05:17 -0700 | [diff] [blame^] | 776 | skip |= ValidateBaseGroups(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, "vkCmdDispatchBase()"); |
locke-lunarg | 25b6c35 | 2020-08-06 17:44:18 -0600 | [diff] [blame] | 777 | return skip; |
| 778 | } |
| 779 | |
| 780 | bool CoreChecks::PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, |
| 781 | uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, |
| 782 | uint32_t groupCountZ) const { |
| 783 | bool skip = false; |
| 784 | skip |= ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_COMPUTE, CMD_DISPATCHBASE, "vkCmdDispatchBaseKHR()", |
| 785 | VK_QUEUE_COMPUTE_BIT); |
Tony-LunarG | f825e6d | 2020-12-16 13:05:17 -0700 | [diff] [blame^] | 786 | skip |= ValidateBaseGroups(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, "vkCmdDispatchBaseKHR()"); |
locke-lunarg | 25b6c35 | 2020-08-06 17:44:18 -0600 | [diff] [blame] | 787 | return skip; |
| 788 | } |
| 789 | |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 790 | bool CoreChecks::PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) const { |
Mark Lobodzinski | 708aae7 | 2019-12-20 11:57:46 -0700 | [diff] [blame] | 791 | bool skip = ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_COMPUTE, CMD_DISPATCHINDIRECT, |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 792 | "vkCmdDispatchIndirect()", VK_QUEUE_COMPUTE_BIT); |
sfricke-samsung | 0c45edc | 2020-07-01 22:19:53 -0700 | [diff] [blame] | 793 | skip |= ValidateIndirectCmd(commandBuffer, buffer, CMD_DISPATCHINDIRECT, "vkCmdDispatchIndirect()"); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 794 | return skip; |
| 795 | } |
Tony-LunarG | a74d3fe | 2019-11-22 15:43:20 -0700 | [diff] [blame] | 796 | bool CoreChecks::ValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 797 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
Tony-LunarG | 83544c7 | 2020-01-17 12:30:19 -0700 | [diff] [blame] | 798 | uint32_t stride, const char *apiName) const { |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 799 | bool skip = false; |
sfricke-samsung | 27c7072 | 2020-05-02 08:42:39 -0700 | [diff] [blame] | 800 | if ((api_version >= VK_API_VERSION_1_2) && (enabled_features.core12.drawIndirectCount == VK_FALSE)) { |
Shannon McPherson | 2c793ba | 2020-08-28 12:13:24 -0600 | [diff] [blame] | 801 | skip |= LogError(commandBuffer, "VUID-vkCmdDrawIndirectCount-None-04445", |
sfricke-samsung | 27c7072 | 2020-05-02 08:42:39 -0700 | [diff] [blame] | 802 | "%s(): Starting in Vulkan 1.2 the VkPhysicalDeviceVulkan12Features::drawIndirectCount must be enabled to " |
| 803 | "call this command.", |
| 804 | apiName); |
| 805 | } |
Tony-LunarG | 83544c7 | 2020-01-17 12:30:19 -0700 | [diff] [blame] | 806 | skip |= ValidateCmdDrawStrideWithStruct(commandBuffer, "VUID-vkCmdDrawIndirectCount-stride-03110", stride, apiName, |
| 807 | sizeof(VkDrawIndirectCommand)); |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 808 | if (maxDrawCount > 1) { |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 809 | const BUFFER_STATE *buffer_state = GetBufferState(buffer); |
Tony-LunarG | 83544c7 | 2020-01-17 12:30:19 -0700 | [diff] [blame] | 810 | skip |= ValidateCmdDrawStrideWithBuffer(commandBuffer, "VUID-vkCmdDrawIndirectCount-maxDrawCount-03111", stride, apiName, |
| 811 | sizeof(VkDrawIndirectCommand), maxDrawCount, offset, buffer_state); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 812 | } |
| 813 | |
Tony-LunarG | 83544c7 | 2020-01-17 12:30:19 -0700 | [diff] [blame] | 814 | skip |= ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWINDIRECTCOUNT, apiName, |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 815 | VK_QUEUE_GRAPHICS_BIT); |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 816 | const BUFFER_STATE *count_buffer_state = GetBufferState(countBuffer); |
sfricke-samsung | 0c45edc | 2020-07-01 22:19:53 -0700 | [diff] [blame] | 817 | skip |= ValidateIndirectCmd(commandBuffer, buffer, CMD_DRAWINDIRECTCOUNT, apiName); |
Tony-LunarG | 83544c7 | 2020-01-17 12:30:19 -0700 | [diff] [blame] | 818 | skip |= ValidateMemoryIsBoundToBuffer(count_buffer_state, apiName, "VUID-vkCmdDrawIndirectCount-countBuffer-02714"); |
Tony-LunarG | 83544c7 | 2020-01-17 12:30:19 -0700 | [diff] [blame] | 819 | skip |= |
| 820 | ValidateBufferUsageFlags(count_buffer_state, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, true, |
| 821 | "VUID-vkCmdDrawIndirectCount-countBuffer-02715", apiName, "VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 822 | return skip; |
| 823 | } |
| 824 | |
Tony-LunarG | a74d3fe | 2019-11-22 15:43:20 -0700 | [diff] [blame] | 825 | bool CoreChecks::PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 826 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 827 | uint32_t stride) const { |
Tony-LunarG | 83544c7 | 2020-01-17 12:30:19 -0700 | [diff] [blame] | 828 | return ValidateCmdDrawIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride, |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 829 | "vkCmdDrawIndirectCountKHR"); |
Tony-LunarG | a74d3fe | 2019-11-22 15:43:20 -0700 | [diff] [blame] | 830 | } |
| 831 | |
| 832 | bool CoreChecks::PreCallValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 833 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
| 834 | uint32_t stride) const { |
Tony-LunarG | 83544c7 | 2020-01-17 12:30:19 -0700 | [diff] [blame] | 835 | return ValidateCmdDrawIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride, |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 836 | "vkCmdDrawIndirectCount"); |
Tony-LunarG | a74d3fe | 2019-11-22 15:43:20 -0700 | [diff] [blame] | 837 | } |
| 838 | |
| 839 | bool CoreChecks::ValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 840 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 841 | uint32_t stride, const char *apiName) const { |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 842 | bool skip = false; |
sfricke-samsung | 27c7072 | 2020-05-02 08:42:39 -0700 | [diff] [blame] | 843 | if ((api_version >= VK_API_VERSION_1_2) && (enabled_features.core12.drawIndirectCount == VK_FALSE)) { |
Shannon McPherson | 2c793ba | 2020-08-28 12:13:24 -0600 | [diff] [blame] | 844 | skip |= LogError(commandBuffer, "VUID-vkCmdDrawIndexedIndirectCount-None-04445", |
sfricke-samsung | 27c7072 | 2020-05-02 08:42:39 -0700 | [diff] [blame] | 845 | "%s(): Starting in Vulkan 1.2 the VkPhysicalDeviceVulkan12Features::drawIndirectCount must be enabled to " |
| 846 | "call this command.", |
| 847 | apiName); |
| 848 | } |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 849 | skip |= ValidateCmdDrawStrideWithStruct(commandBuffer, "VUID-vkCmdDrawIndexedIndirectCount-stride-03142", stride, apiName, |
| 850 | sizeof(VkDrawIndexedIndirectCommand)); |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 851 | if (maxDrawCount > 1) { |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 852 | const BUFFER_STATE *buffer_state = GetBufferState(buffer); |
Mike Schuchardt | 65847d9 | 2019-12-20 13:50:47 -0800 | [diff] [blame] | 853 | skip |= ValidateCmdDrawStrideWithBuffer(commandBuffer, "VUID-vkCmdDrawIndexedIndirectCount-maxDrawCount-03143", stride, |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 854 | apiName, sizeof(VkDrawIndexedIndirectCommand), maxDrawCount, offset, buffer_state); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 855 | } |
| 856 | |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 857 | skip |= ValidateCmdDrawType(commandBuffer, true, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWINDEXEDINDIRECTCOUNT, apiName, |
| 858 | VK_QUEUE_GRAPHICS_BIT); |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 859 | const BUFFER_STATE *count_buffer_state = GetBufferState(countBuffer); |
sfricke-samsung | 0c45edc | 2020-07-01 22:19:53 -0700 | [diff] [blame] | 860 | skip |= ValidateIndirectCmd(commandBuffer, buffer, CMD_DRAWINDEXEDINDIRECTCOUNT, apiName); |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 861 | skip |= ValidateMemoryIsBoundToBuffer(count_buffer_state, apiName, "VUID-vkCmdDrawIndexedIndirectCount-countBuffer-02714"); |
Jasper St. Pierre | bf08046 | 2019-04-11 12:54:38 -0700 | [diff] [blame] | 862 | skip |= ValidateBufferUsageFlags(count_buffer_state, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, true, |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 863 | "VUID-vkCmdDrawIndexedIndirectCount-countBuffer-02715", apiName, |
Mike Schuchardt | 65847d9 | 2019-12-20 13:50:47 -0800 | [diff] [blame] | 864 | "VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 865 | return skip; |
| 866 | } |
| 867 | |
Tony-LunarG | a74d3fe | 2019-11-22 15:43:20 -0700 | [diff] [blame] | 868 | bool CoreChecks::PreCallValidateCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 869 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
| 870 | uint32_t maxDrawCount, uint32_t stride) const { |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 871 | return ValidateCmdDrawIndexedIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride, |
| 872 | "vkCmdDrawIndexedIndirectCountKHR"); |
Tony-LunarG | a74d3fe | 2019-11-22 15:43:20 -0700 | [diff] [blame] | 873 | } |
| 874 | |
| 875 | bool CoreChecks::PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 876 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
| 877 | uint32_t maxDrawCount, uint32_t stride) const { |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 878 | return ValidateCmdDrawIndexedIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride, |
| 879 | "vkCmdDrawIndexedIndirectCount"); |
Tony-LunarG | a74d3fe | 2019-11-22 15:43:20 -0700 | [diff] [blame] | 880 | } |
| 881 | |
locke-lunarg | 9a16ebb | 2020-07-30 16:56:33 -0600 | [diff] [blame] | 882 | bool CoreChecks::PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, |
| 883 | uint32_t firstInstance, VkBuffer counterBuffer, |
| 884 | VkDeviceSize counterBufferOffset, uint32_t counterOffset, |
| 885 | uint32_t vertexStride) const { |
sfricke-samsung | d5e9adb | 2020-10-26 03:59:29 -0700 | [diff] [blame] | 886 | bool skip = false; |
Tony-LunarG | 2c94ba8 | 2020-11-05 14:21:40 -0700 | [diff] [blame] | 887 | if (!enabled_features.transform_feedback_features.transformFeedback) { |
| 888 | skip |= LogError(commandBuffer, "VUID-vkCmdDrawIndirectByteCountEXT-transformFeedback-02287", |
| 889 | "%s: transformFeedback feature is not enabled.", "vkCmdDrawIndirectByteCountEXT()"); |
| 890 | } |
| 891 | if (device_extensions.vk_ext_transform_feedback && !phys_dev_ext_props.transform_feedback_props.transformFeedbackDraw) { |
sfricke-samsung | ba459bd | 2020-12-06 23:20:04 -0800 | [diff] [blame] | 892 | skip |= LogError(commandBuffer, "VUID-vkCmdDrawIndirectByteCountEXT-transformFeedbackDraw-02288", |
Tony-LunarG | 2c94ba8 | 2020-11-05 14:21:40 -0700 | [diff] [blame] | 893 | "%s: VkPhysicalDeviceTransformFeedbackPropertiesEXT::transformFeedbackDraw is not supported", |
| 894 | "vkCmdDrawIndirectByteCountEXT()"); |
| 895 | } |
locke-lunarg | 3fa463a | 2020-10-23 16:39:04 -0600 | [diff] [blame] | 896 | skip |= ValidateCmdDrawInstance(commandBuffer, instanceCount, firstInstance, CMD_DRAWINDIRECTBYTECOUNTEXT, |
| 897 | "vkCmdDrawIndirectByteCountEXT()"); |
sfricke-samsung | d5e9adb | 2020-10-26 03:59:29 -0700 | [diff] [blame] | 898 | skip |= ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWINDIRECTBYTECOUNTEXT, |
| 899 | "vkCmdDrawIndirectByteCountEXT()", VK_QUEUE_GRAPHICS_BIT); |
| 900 | skip |= ValidateIndirectCmd(commandBuffer, counterBuffer, CMD_DRAWINDIRECTBYTECOUNTEXT, "vkCmdDrawIndirectByteCountEXT()"); |
| 901 | return skip; |
locke-lunarg | 9a16ebb | 2020-07-30 16:56:33 -0600 | [diff] [blame] | 902 | } |
| 903 | |
Jeff Bolz | f6e872c | 2019-10-22 12:17:28 -0500 | [diff] [blame] | 904 | bool CoreChecks::PreCallValidateCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, |
| 905 | VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, |
| 906 | VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, |
| 907 | VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, |
| 908 | VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, |
| 909 | VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, |
| 910 | uint32_t width, uint32_t height, uint32_t depth) const { |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 911 | bool skip = ValidateCmdDrawType(commandBuffer, true, VK_PIPELINE_BIND_POINT_RAY_TRACING_NV, CMD_TRACERAYSNV, |
| 912 | "vkCmdTraceRaysNV()", VK_QUEUE_COMPUTE_BIT); |
sourav parmar | d152180 | 2020-06-07 21:49:02 -0700 | [diff] [blame] | 913 | const CMD_BUFFER_STATE *cb_state = GetCBState(commandBuffer); |
| 914 | skip |= InsideRenderPass(cb_state, "vkCmdTraceRaysNV()", "VUID-vkCmdTraceRaysNV-renderpass"); |
Nathaniel Cesario | ce9b481 | 2020-12-17 08:55:28 -0700 | [diff] [blame] | 915 | auto callable_shader_buffer_state = const_cast<BUFFER_STATE *>(GetBufferState(callableShaderBindingTableBuffer)); |
sourav parmar | d152180 | 2020-06-07 21:49:02 -0700 | [diff] [blame] | 916 | if (callable_shader_buffer_state && callableShaderBindingOffset >= callable_shader_buffer_state->createInfo.size) { |
| 917 | skip |= LogError(commandBuffer, "VUID-vkCmdTraceRaysNV-callableShaderBindingOffset-02461", |
| 918 | "vkCmdTraceRaysNV: callableShaderBindingOffset %" PRIu64 |
| 919 | " must be less than the size of callableShaderBindingTableBuffer %" PRIu64 " .", |
| 920 | callableShaderBindingOffset, callable_shader_buffer_state->createInfo.size); |
| 921 | } |
Nathaniel Cesario | ce9b481 | 2020-12-17 08:55:28 -0700 | [diff] [blame] | 922 | auto hit_shader_buffer_state = const_cast<BUFFER_STATE *>(GetBufferState(hitShaderBindingTableBuffer)); |
sourav parmar | d152180 | 2020-06-07 21:49:02 -0700 | [diff] [blame] | 923 | if (hit_shader_buffer_state && hitShaderBindingOffset >= hit_shader_buffer_state->createInfo.size) { |
| 924 | skip |= LogError(commandBuffer, "VUID-vkCmdTraceRaysNV-hitShaderBindingOffset-02459", |
| 925 | "vkCmdTraceRaysNV: hitShaderBindingOffset %" PRIu64 |
| 926 | " must be less than the size of hitShaderBindingTableBuffer %" PRIu64 " .", |
| 927 | hitShaderBindingOffset, hit_shader_buffer_state->createInfo.size); |
| 928 | } |
Nathaniel Cesario | ce9b481 | 2020-12-17 08:55:28 -0700 | [diff] [blame] | 929 | auto miss_shader_buffer_state = const_cast<BUFFER_STATE *>(GetBufferState(missShaderBindingTableBuffer)); |
sourav parmar | d152180 | 2020-06-07 21:49:02 -0700 | [diff] [blame] | 930 | if (miss_shader_buffer_state && missShaderBindingOffset >= miss_shader_buffer_state->createInfo.size) { |
| 931 | skip |= LogError(commandBuffer, "VUID-vkCmdTraceRaysNV-missShaderBindingOffset-02457", |
| 932 | "vkCmdTraceRaysNV: missShaderBindingOffset %" PRIu64 |
baldurk | 751594b | 2020-09-09 09:41:02 +0100 | [diff] [blame] | 933 | " must be less than the size of missShaderBindingTableBuffer %" PRIu64 " .", |
sourav parmar | d152180 | 2020-06-07 21:49:02 -0700 | [diff] [blame] | 934 | missShaderBindingOffset, miss_shader_buffer_state->createInfo.size); |
| 935 | } |
Nathaniel Cesario | ce9b481 | 2020-12-17 08:55:28 -0700 | [diff] [blame] | 936 | auto raygen_shader_buffer_state = const_cast<BUFFER_STATE *>(GetBufferState(raygenShaderBindingTableBuffer)); |
sourav parmar | d152180 | 2020-06-07 21:49:02 -0700 | [diff] [blame] | 937 | if (raygenShaderBindingOffset >= raygen_shader_buffer_state->createInfo.size) { |
| 938 | skip |= LogError(commandBuffer, "VUID-vkCmdTraceRaysNV-raygenShaderBindingOffset-02455", |
| 939 | "vkCmdTraceRaysNV: raygenShaderBindingOffset %" PRIu64 |
baldurk | 751594b | 2020-09-09 09:41:02 +0100 | [diff] [blame] | 940 | " must be less than the size of raygenShaderBindingTableBuffer %" PRIu64 " .", |
sourav parmar | d152180 | 2020-06-07 21:49:02 -0700 | [diff] [blame] | 941 | raygenShaderBindingOffset, raygen_shader_buffer_state->createInfo.size); |
| 942 | } |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 943 | |
sourav parmar | 30e1939 | 2020-12-02 16:57:21 -0800 | [diff] [blame] | 944 | const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_RAY_TRACING_NV); |
| 945 | const PIPELINE_STATE *pipeline_state = cb_state->lastBound[lv_bind_point].pipeline_state; |
| 946 | if (!pipeline_state || (pipeline_state && !pipeline_state->pipeline)) { |
| 947 | skip |= LogError(device, "VUID-vkCmdTraceRaysNV-None-02700", |
| 948 | "vkCmdTraceRaysKHR: A valid pipeline must be bound to the pipeline bind point used by this command."); |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 949 | } |
Jeff Bolz | f6e872c | 2019-10-22 12:17:28 -0500 | [diff] [blame] | 950 | return skip; |
| 951 | } |
| 952 | |
Jason Macnak | 67407e7 | 2019-07-11 11:05:09 -0700 | [diff] [blame] | 953 | void CoreChecks::PostCallRecordCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, |
| 954 | VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, |
| 955 | VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, |
| 956 | VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, |
| 957 | VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, |
| 958 | VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, |
| 959 | uint32_t width, uint32_t height, uint32_t depth) { |
| 960 | CMD_BUFFER_STATE *cb_state = GetCBState(commandBuffer); |
locke-lunarg | 540b225 | 2020-08-03 13:23:36 -0600 | [diff] [blame] | 961 | UpdateStateCmdDrawDispatchType(cb_state, CMD_TRACERAYSNV, VK_PIPELINE_BIND_POINT_RAY_TRACING_NV, "vkCmdTraceRaysNV()"); |
Jason Macnak | 67407e7 | 2019-07-11 11:05:09 -0700 | [diff] [blame] | 962 | cb_state->hasTraceRaysCmd = true; |
| 963 | } |
| 964 | |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 965 | bool CoreChecks::PreCallValidateCmdTraceRaysKHR(VkCommandBuffer commandBuffer, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 966 | const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, |
| 967 | const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, |
| 968 | const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, |
| 969 | const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 970 | uint32_t height, uint32_t depth) const { |
| 971 | bool skip = ValidateCmdDrawType(commandBuffer, true, VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, CMD_TRACERAYSKHR, |
| 972 | "vkCmdTraceRaysKHR()", VK_QUEUE_COMPUTE_BIT); |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 973 | const CMD_BUFFER_STATE *cb_state = GetCBState(commandBuffer); |
Shannon McPherson | 9caca05 | 2020-11-25 11:34:38 -0700 | [diff] [blame] | 974 | const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR); |
| 975 | const PIPELINE_STATE *pipeline_state = cb_state->lastBound[lv_bind_point].pipeline_state; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 976 | if (!pipeline_state || (pipeline_state && !pipeline_state->pipeline)) { |
| 977 | skip |= LogError(device, "VUID-vkCmdTraceRaysKHR-None-02700", |
| 978 | "vkCmdTraceRaysKHR: A valid pipeline must be bound to the pipeline bind point used by this command."); |
| 979 | } else { // bound to valid RT pipeline |
| 980 | if (pipeline_state->raytracingPipelineCI.flags & VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR) { |
| 981 | if (!pHitShaderBindingTable->deviceAddress) { |
| 982 | skip |= LogError(device, "VUID-vkCmdTraceRaysKHR-flags-03697", |
| 983 | "vkCmdTraceRaysKHR: If the currently bound ray tracing pipeline was created with flags " |
| 984 | "that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR, the " |
| 985 | "deviceAddress member of pHitShaderBindingTable must not be zero."); |
| 986 | } |
| 987 | if (!pHitShaderBindingTable || pHitShaderBindingTable->size == 0 || pHitShaderBindingTable->stride == 0) { |
| 988 | skip |= LogError(device, "VUID-vkCmdTraceRaysKHR-flags-03514", |
| 989 | "vkCmdTraceRaysKHR: If the currently bound ray tracing pipeline was created with " |
| 990 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR, " |
| 991 | "entries in pHitShaderBindingTable accessed as a result of this command in order to " |
| 992 | "execute an intersection shader must not be set to zero."); |
| 993 | } |
| 994 | } |
| 995 | if (pipeline_state->raytracingPipelineCI.flags & VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR) { |
| 996 | if (!pHitShaderBindingTable->deviceAddress) { |
| 997 | skip |= LogError(device, "VUID-vkCmdTraceRaysKHR-flags-03696", |
| 998 | "vkCmdTraceRaysKHR: If the currently bound ray tracing pipeline was created with flags " |
| 999 | "that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR, the " |
| 1000 | "deviceAddress member of pHitShaderBindingTable must not be zero."); |
| 1001 | } |
| 1002 | if (!pHitShaderBindingTable || pHitShaderBindingTable->size == 0 || pHitShaderBindingTable->stride == 0) { |
| 1003 | skip |= LogError(device, "VUID-vkCmdTraceRaysKHR-flags-03513", |
| 1004 | "vkCmdTraceRaysKHR: If the currently bound ray tracing pipeline was created with " |
| 1005 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR, " |
| 1006 | "entries in pHitShaderBindingTable accessed as a result of this command in order to " |
| 1007 | "execute a closest hit shader must not be set to zero."); |
| 1008 | } |
| 1009 | } |
| 1010 | if (pipeline_state->raytracingPipelineCI.flags & VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR) { |
| 1011 | if (!pHitShaderBindingTable->deviceAddress) { |
| 1012 | skip |= LogError(device, "VUID-vkCmdTraceRaysKHR-flags-03695", |
| 1013 | "vkCmdTraceRaysKHR: If the currently bound ray tracing pipeline was created with flags " |
| 1014 | "that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR, the " |
| 1015 | "deviceAddress member of pHitShaderBindingTable must not be zero."); |
| 1016 | } |
| 1017 | if (!pHitShaderBindingTable || pHitShaderBindingTable->size == 0 || pHitShaderBindingTable->stride == 0) { |
| 1018 | skip |= LogError(device, "VUID-vkCmdTraceRaysKHR-flags-03512", |
| 1019 | "vkCmdTraceRaysKHR: If the currently bound ray tracing pipeline was created with " |
| 1020 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR, " |
| 1021 | "entries in pHitShaderBindingTable accessed as a result of this command in order to " |
| 1022 | "execute an any hit shader must not be set to zero."); |
| 1023 | } |
| 1024 | } |
| 1025 | } |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1026 | return skip; |
| 1027 | } |
| 1028 | |
| 1029 | void CoreChecks::PostCallRecordCmdTraceRaysKHR(VkCommandBuffer commandBuffer, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1030 | const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, |
| 1031 | const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, |
| 1032 | const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, |
| 1033 | const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1034 | uint32_t height, uint32_t depth) { |
| 1035 | CMD_BUFFER_STATE *cb_state = GetCBState(commandBuffer); |
locke-lunarg | 540b225 | 2020-08-03 13:23:36 -0600 | [diff] [blame] | 1036 | UpdateStateCmdDrawDispatchType(cb_state, CMD_TRACERAYSKHR, VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, "vkCmdTraceRaysKHR()"); |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1037 | cb_state->hasTraceRaysCmd = true; |
| 1038 | } |
| 1039 | |
| 1040 | bool CoreChecks::PreCallValidateCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1041 | const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, |
| 1042 | const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, |
| 1043 | const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, |
| 1044 | const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, |
| 1045 | VkDeviceAddress indirectDeviceAddress) const { |
sfricke-samsung | 0c45edc | 2020-07-01 22:19:53 -0700 | [diff] [blame] | 1046 | bool skip = ValidateCmdDrawType(commandBuffer, true, VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, CMD_TRACERAYSINDIRECTKHR, |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1047 | "vkCmdTraceRaysIndirectKHR()", VK_QUEUE_COMPUTE_BIT); |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1048 | const CMD_BUFFER_STATE *cb_state = GetCBState(commandBuffer); |
Shannon McPherson | 9caca05 | 2020-11-25 11:34:38 -0700 | [diff] [blame] | 1049 | const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR); |
| 1050 | const PIPELINE_STATE *pipeline_state = cb_state->lastBound[lv_bind_point].pipeline_state; |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1051 | if (!pipeline_state || (pipeline_state && !pipeline_state->pipeline)) { |
| 1052 | skip |= |
| 1053 | LogError(device, "VUID-vkCmdTraceRaysIndirectKHR-None-02700", |
| 1054 | "vkCmdTraceRaysIndirectKHR: A valid pipeline must be bound to the pipeline bind point used by this command."); |
| 1055 | } else { // valid bind point |
| 1056 | if (pipeline_state->raytracingPipelineCI.flags & VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR) { |
| 1057 | if (!pHitShaderBindingTable || pHitShaderBindingTable->deviceAddress == 0) { |
| 1058 | skip |= LogError(device, "VUID-vkCmdTraceRaysIndirectKHR-flags-03697", |
| 1059 | "vkCmdTraceRaysIndirectKHR: If the currently bound ray tracing pipeline was created with " |
| 1060 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR, the " |
| 1061 | "deviceAddress member of pHitShaderBindingTable must not be zero."); |
| 1062 | } |
| 1063 | if (!pHitShaderBindingTable || pHitShaderBindingTable->size == 0 || pHitShaderBindingTable->stride == 0) { |
| 1064 | skip |= LogError(device, "VUID-vkCmdTraceRaysIndirectKHR-flags-03514", |
| 1065 | "vkCmdTraceRaysIndirectKHR: If the currently bound ray tracing pipeline was created with " |
| 1066 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR, " |
| 1067 | "entries in pHitShaderBindingTable accessed as a result of this command in order to " |
| 1068 | "execute an intersection shader must not be set to zero."); |
| 1069 | } |
| 1070 | } |
| 1071 | if (pipeline_state->raytracingPipelineCI.flags & VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR) { |
| 1072 | if (!pHitShaderBindingTable || pHitShaderBindingTable->deviceAddress == 0) { |
| 1073 | skip |= LogError(device, "VUID-vkCmdTraceRaysIndirectKHR-flags-03696", |
| 1074 | "vkCmdTraceRaysIndirectKHR:If the currently bound ray tracing pipeline was created with " |
| 1075 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR, " |
| 1076 | "the deviceAddress member of pHitShaderBindingTable must not be zero."); |
| 1077 | } |
| 1078 | if (!pHitShaderBindingTable || pHitShaderBindingTable->size == 0 || pHitShaderBindingTable->stride == 0) { |
| 1079 | skip |= LogError(device, "VUID-vkCmdTraceRaysIndirectKHR-flags-03513", |
| 1080 | "vkCmdTraceRaysIndirectKHR: If the currently bound ray tracing pipeline was created with " |
| 1081 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR, " |
| 1082 | "entries in pHitShaderBindingTable accessed as a result of this command in order to " |
| 1083 | "execute a closest hit shader must not be set to zero."); |
| 1084 | } |
| 1085 | } |
| 1086 | if (pipeline_state->raytracingPipelineCI.flags & VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR) { |
| 1087 | if (!pHitShaderBindingTable || pHitShaderBindingTable->deviceAddress == 0) { |
| 1088 | skip |= LogError(device, "VUID-vkCmdTraceRaysIndirectKHR-flags-03695", |
| 1089 | "vkCmdTraceRaysIndirectKHR: If the currently bound ray tracing pipeline was created with " |
| 1090 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR, the " |
| 1091 | "deviceAddress member of pHitShaderBindingTable must not be zero."); |
| 1092 | } |
| 1093 | if (!pHitShaderBindingTable || pHitShaderBindingTable->size == 0 || pHitShaderBindingTable->stride == 0) { |
| 1094 | skip |= LogError(device, "VUID-vkCmdTraceRaysIndirectKHR-flags-03512", |
| 1095 | "vkCmdTraceRaysIndirectKHR: If the currently bound ray tracing pipeline was created with " |
| 1096 | "flags that included VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR, " |
| 1097 | "entries in pHitShaderBindingTable accessed as a result of this command in order to " |
| 1098 | "execute an any hit shader must not be set to zero."); |
| 1099 | } |
| 1100 | } |
| 1101 | } |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1102 | return skip; |
| 1103 | } |
| 1104 | |
| 1105 | void CoreChecks::PostCallRecordCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, |
sourav parmar | cd5fb18 | 2020-07-17 12:58:44 -0700 | [diff] [blame] | 1106 | const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, |
| 1107 | const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, |
| 1108 | const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, |
| 1109 | const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, |
Shannon McPherson | 54e1f89 | 2020-11-27 11:04:19 -0700 | [diff] [blame] | 1110 | VkDeviceAddress indirectDeviceAddress) { |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1111 | CMD_BUFFER_STATE *cb_state = GetCBState(commandBuffer); |
locke-lunarg | 540b225 | 2020-08-03 13:23:36 -0600 | [diff] [blame] | 1112 | UpdateStateCmdDrawDispatchType(cb_state, CMD_TRACERAYSINDIRECTKHR, VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, |
| 1113 | "vkCmdTraceRaysIndirectKHR()"); |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1114 | cb_state->hasTraceRaysCmd = true; |
Jeff Bolz | 443c2ca | 2020-03-19 12:11:51 -0500 | [diff] [blame] | 1115 | } |
| 1116 | |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1117 | bool CoreChecks::PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) const { |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 1118 | bool skip = ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWMESHTASKSNV, |
| 1119 | "vkCmdDrawMeshTasksNV()", VK_QUEUE_GRAPHICS_BIT); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 1120 | return skip; |
| 1121 | } |
| 1122 | |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 1123 | bool CoreChecks::PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1124 | uint32_t drawCount, uint32_t stride) const { |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 1125 | bool skip = ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWMESHTASKSINDIRECTNV, |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 1126 | "vkCmdDrawMeshTasksIndirectNV()", VK_QUEUE_GRAPHICS_BIT); |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 1127 | const BUFFER_STATE *buffer_state = GetBufferState(buffer); |
sfricke-samsung | 0c45edc | 2020-07-01 22:19:53 -0700 | [diff] [blame] | 1128 | skip |= ValidateIndirectCmd(commandBuffer, buffer, CMD_DRAWMESHTASKSINDIRECTNV, "vkCmdDrawMeshTasksIndirectNV()"); |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 1129 | if (drawCount > 1) { |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 1130 | skip |= ValidateCmdDrawStrideWithBuffer(commandBuffer, "VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02157", stride, |
| 1131 | "VkDrawMeshTasksIndirectCommandNV", sizeof(VkDrawMeshTasksIndirectCommandNV), |
| 1132 | drawCount, offset, buffer_state); |
| 1133 | } |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 1134 | return skip; |
| 1135 | } |
| 1136 | |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 1137 | bool CoreChecks::PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, |
| 1138 | VkBuffer countBuffer, VkDeviceSize countBufferOffset, |
Jeff Bolz | 5c801d1 | 2019-10-09 10:38:45 -0500 | [diff] [blame] | 1139 | uint32_t maxDrawCount, uint32_t stride) const { |
Mark Lobodzinski | 708aae7 | 2019-12-20 11:57:46 -0700 | [diff] [blame] | 1140 | bool skip = ValidateCmdDrawType(commandBuffer, false, VK_PIPELINE_BIND_POINT_GRAPHICS, CMD_DRAWMESHTASKSINDIRECTCOUNTNV, |
Spencer Fricke | 507600b | 2020-03-22 13:23:06 -0700 | [diff] [blame] | 1141 | "vkCmdDrawMeshTasksIndirectCountNV()", VK_QUEUE_GRAPHICS_BIT); |
John Zulauf | fbf3c20 | 2019-07-17 14:57:14 -0600 | [diff] [blame] | 1142 | const BUFFER_STATE *buffer_state = GetBufferState(buffer); |
| 1143 | const BUFFER_STATE *count_buffer_state = GetBufferState(countBuffer); |
sfricke-samsung | 0c45edc | 2020-07-01 22:19:53 -0700 | [diff] [blame] | 1144 | skip |= ValidateIndirectCmd(commandBuffer, buffer, CMD_DRAWMESHTASKSINDIRECTCOUNTNV, "vkCmdDrawMeshTasksIndirectCountNV()"); |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 1145 | skip |= ValidateMemoryIsBoundToBuffer(count_buffer_state, "vkCmdDrawMeshTasksIndirectCountNV()", |
Shannon McPherson | de3eeba | 2019-04-30 16:53:59 -0600 | [diff] [blame] | 1146 | "VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02714"); |
Jasper St. Pierre | bf08046 | 2019-04-11 12:54:38 -0700 | [diff] [blame] | 1147 | skip |= ValidateBufferUsageFlags(count_buffer_state, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, true, |
sfricke-samsung | f692b97 | 2020-05-02 08:00:45 -0700 | [diff] [blame] | 1148 | "VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02715", |
| 1149 | "vkCmdDrawMeshTasksIndirectCountNV()", "VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT"); |
Locke | e68ac65 | 2019-05-06 10:17:33 -0600 | [diff] [blame] | 1150 | skip |= ValidateCmdDrawStrideWithStruct(commandBuffer, "VUID-vkCmdDrawMeshTasksIndirectCountNV-stride-02182", stride, |
| 1151 | "VkDrawMeshTasksIndirectCommandNV", sizeof(VkDrawMeshTasksIndirectCommandNV)); |
| 1152 | if (maxDrawCount > 1) { |
| 1153 | skip |= ValidateCmdDrawStrideWithBuffer(commandBuffer, "VUID-vkCmdDrawMeshTasksIndirectCountNV-maxDrawCount-02183", stride, |
| 1154 | "VkDrawMeshTasksIndirectCommandNV", sizeof(VkDrawMeshTasksIndirectCommandNV), |
| 1155 | maxDrawCount, offset, buffer_state); |
| 1156 | } |
Jasper St. Pierre | 512613a | 2019-04-08 16:25:23 -0700 | [diff] [blame] | 1157 | return skip; |
| 1158 | } |