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