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