1// Copyright 2019-2021 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5// Common Valid Usage 6// Common to all dispatch and drawing commands 7 * [[VUID-{refpage}-magFilter-04553]] 8 If a slink:VkSampler created with pname:magFilter or pname:minFilter 9 equal to ename:VK_FILTER_LINEAR and pname:compareEnable equal to 10 ename:VK_FALSE is used to sample a slink:VkImageView as a result of this 11 command, then the image view's 12 <<resources-image-view-format-features,format features>> must: contain 13 ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT 14 * [[VUID-{refpage}-mipmapMode-04770]] 15 If a slink:VkSampler created with pname:mipmapMode equal to 16 ename:VK_SAMPLER_MIPMAP_MODE_LINEAR and pname:compareEnable equal to 17 ename:VK_FALSE is used to sample a slink:VkImageView as a result of this 18 command, then the image view's 19 <<resources-image-view-format-features,format features>> must: contain 20 ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT 21ifndef::VK_KHR_format_feature_flags2[] 22 * [[VUID-{refpage}-aspectMask-06478]] 23 If a slink:VkImageView is sampled with 24 <<textures-depth-compare-operation,depth comparison>>, the image view 25 must: have been created with an pname:aspectMask that contains 26 ename:VK_IMAGE_ASPECT_DEPTH_BIT. 27endif::VK_KHR_format_feature_flags2[] 28ifdef::VK_KHR_format_feature_flags2[] 29 * [[VUID-{refpage}-None-06479]] 30 If a slink:VkImageView is sampled with 31 <<textures-depth-compare-operation,depth comparison>>, the image view's 32 <<resources-image-view-format-features,format features>> must: contain 33 ename:VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR 34endif::VK_KHR_format_feature_flags2[] 35 * [[VUID-{refpage}-None-02691]] 36 If a sname:VkImageView is accessed using atomic operations as a result 37 of this command, then the image view's 38 <<resources-image-view-format-features,format features>> must: contain 39 ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT 40ifdef::VK_IMG_filter_cubic,VK_EXT_filter_cubic[] 41 * [[VUID-{refpage}-None-02692]] 42 If a sname:VkImageView is sampled with ename:VK_FILTER_CUBIC_EXT as a 43 result of this command, then the image view's 44 <<resources-image-view-format-features,format features>> must: contain 45 ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT 46ifndef::VK_EXT_filter_cubic[] 47 * [[VUID-{refpage}-None-02693]] 48 Any slink:VkImageView being sampled with ename:VK_FILTER_CUBIC_EXT as a 49 result of this command must: not have a elink:VkImageViewType of 50 ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, or 51 ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY 52endif::VK_EXT_filter_cubic[] 53ifdef::VK_EXT_filter_cubic[] 54 * [[VUID-{refpage}-filterCubic-02694]] 55 Any slink:VkImageView being sampled with ename:VK_FILTER_CUBIC_EXT as a 56 result of this command must: have a elink:VkImageViewType and format 57 that supports cubic filtering, as specified by 58 sname:VkFilterCubicImageViewImageFormatPropertiesEXT::pname:filterCubic 59 returned by fname:vkGetPhysicalDeviceImageFormatProperties2 60 * [[VUID-{refpage}-filterCubicMinmax-02695]] 61 Any slink:VkImageView being sampled with ename:VK_FILTER_CUBIC_EXT with 62 a reduction mode of either ename:VK_SAMPLER_REDUCTION_MODE_MIN or 63 ename:VK_SAMPLER_REDUCTION_MODE_MAX as a result of this command must: 64 have a elink:VkImageViewType and format that supports cubic filtering 65 together with minmax filtering, as specified by 66 sname:VkFilterCubicImageViewImageFormatPropertiesEXT::pname:filterCubicMinmax 67 returned by fname:vkGetPhysicalDeviceImageFormatProperties2 68endif::VK_EXT_filter_cubic[] 69endif::VK_IMG_filter_cubic,VK_EXT_filter_cubic[] 70ifdef::VK_NV_corner_sampled_image[] 71 * [[VUID-{refpage}-flags-02696]] 72 Any slink:VkImage created with a slink:VkImageCreateInfo::pname:flags 73 containing ename:VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV sampled as a 74 result of this command must: only be sampled using a 75 elink:VkSamplerAddressMode of 76 ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE 77endif::VK_NV_corner_sampled_image[] 78ifdef::VK_KHR_format_feature_flags2[] 79 * [[VUID-{refpage}-OpTypeImage-06423]] 80 Any slink:VkImageView or slink:VkBufferView being written as a storage 81 image or storage texel buffer where the image format field of the 82 code:OpTypeImage is code:Unknown must: have image format features that 83 support ename:VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR 84 * [[VUID-{refpage}-OpTypeImage-06424]] 85 Any slink:VkImageView or slink:VkBufferView being read as a storage 86 image or storage texel buffer where the image format field of the 87 code:OpTypeImage is code:Unknown must: have image format features that 88 support ename:VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR 89endif::VK_KHR_format_feature_flags2[] 90 * [[VUID-{refpage}-None-02697]] 91 For each set _n_ that is statically used by the sname:VkPipeline bound 92 to the pipeline bind point used by this command, a descriptor set must: 93 have been bound to _n_ at the same pipeline bind point, with a 94 sname:VkPipelineLayout that is compatible for set _n_, with the 95 sname:VkPipelineLayout used to create the current sname:VkPipeline, as 96 described in <<descriptorsets-compatibility>> 97ifndef::VK_KHR_maintenance4[] 98 * [[VUID-{refpage}-None-02698]] 99 For each push constant that is statically used by the sname:VkPipeline 100 bound to the pipeline bind point used by this command, a push constant 101 value must: have been set for the same pipeline bind point, with a 102 sname:VkPipelineLayout that is compatible for push constants, with the 103 sname:VkPipelineLayout used to create the current sname:VkPipeline, as 104 described in <<descriptorsets-compatibility>> 105endif::VK_KHR_maintenance4[] 106ifdef::VK_KHR_maintenance4[] 107 * [[VUID-{refpage}-maintenance4-06425]] 108 If the <<features-maintenance4, pname:maintenance4>> feature is not 109 enabled, then for each push constant that is statically used by the 110 sname:VkPipeline bound to the pipeline bind point used by this command, 111 a push constant value must: have been set for the same pipeline bind 112 point, with a sname:VkPipelineLayout that is compatible for push 113 constants, with the sname:VkPipelineLayout used to create the current 114 sname:VkPipeline, as described in <<descriptorsets-compatibility>> 115endif::VK_KHR_maintenance4[] 116 * [[VUID-{refpage}-None-02699]] 117 Descriptors in each bound descriptor set, specified via 118 fname:vkCmdBindDescriptorSets, must: be valid if they are statically 119 used by the sname:VkPipeline bound to the pipeline bind point used by 120 this command 121 * [[VUID-{refpage}-None-02700]] 122 A valid pipeline must: be bound to the pipeline bind point used by this 123 command 124 * [[VUID-{refpage}-commandBuffer-02701]] 125 If the sname:VkPipeline object bound to the pipeline bind point used by 126 this command requires any dynamic state, that state must: have been set 127 or inherited (if the `apiext:VK_NV_inherited_viewport_scissor` extension 128 is enabled) for pname:commandBuffer, and done so after any previously 129 bound pipeline with the corresponding state not specified as dynamic 130 * [[VUID-{refpage}-None-02859]] 131 There must: not have been any calls to dynamic state setting commands 132 for any state not specified as dynamic in the sname:VkPipeline object 133 bound to the pipeline bind point used by this command, since that 134 pipeline was bound 135 * [[VUID-{refpage}-None-02702]] 136 If the sname:VkPipeline object bound to the pipeline bind point used by 137 this command accesses a sname:VkSampler object that uses unnormalized 138 coordinates, that sampler must: not be used to sample from any 139 sname:VkImage with a sname:VkImageView of the type 140 ename:VK_IMAGE_VIEW_TYPE_3D, ename:VK_IMAGE_VIEW_TYPE_CUBE, 141 ename:VK_IMAGE_VIEW_TYPE_1D_ARRAY, ename:VK_IMAGE_VIEW_TYPE_2D_ARRAY or 142 ename:VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stage 143 * [[VUID-{refpage}-None-02703]] 144 If the sname:VkPipeline object bound to the pipeline bind point used by 145 this command accesses a sname:VkSampler object that uses unnormalized 146 coordinates, that sampler must: not be used with any of the SPIR-V 147 `OpImageSample*` or `OpImageSparseSample*` instructions with 148 code:ImplicitLod, code:Dref or code:Proj in their name, in any shader 149 stage 150 * [[VUID-{refpage}-None-02704]] 151 If the sname:VkPipeline object bound to the pipeline bind point used by 152 this command accesses a sname:VkSampler object that uses unnormalized 153 coordinates, that sampler must: not be used with any of the SPIR-V 154 `OpImageSample*` or `OpImageSparseSample*` instructions that includes a 155 LOD bias or any offset values, in any shader stage 156 * [[VUID-{refpage}-None-02705]] 157 If the <<features-robustBufferAccess,robust buffer access>> feature is 158 not enabled, and if the sname:VkPipeline object bound to the pipeline 159 bind point used by this command accesses a uniform buffer, it must: not 160 access values outside of the range of the buffer as specified in the 161 descriptor set bound to the same pipeline bind point 162 * [[VUID-{refpage}-None-02706]] 163 If the <<features-robustBufferAccess,robust buffer access>> feature is 164 not enabled, and if the sname:VkPipeline object bound to the pipeline 165 bind point used by this command accesses a storage buffer, it must: not 166 access values outside of the range of the buffer as specified in the 167 descriptor set bound to the same pipeline bind point 168ifdef::VK_VERSION_1_1[] 169 * [[VUID-{refpage}-commandBuffer-02707]] 170 If pname:commandBuffer is an unprotected command buffer and 171 <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 172 any resource accessed by the slink:VkPipeline object bound to the 173 pipeline bind point used by this command must: not be a protected 174 resource 175endif::VK_VERSION_1_1[] 176 * [[VUID-{refpage}-None-04115]] 177 If a slink:VkImageView is accessed using code:OpImageWrite as a result 178 of this command, then the code:Type of the code:Texel operand of that 179 instruction must: have at least as many components as the image view's 180 format 181 * [[VUID-{refpage}-OpImageWrite-04469]] 182 If a slink:VkBufferView is accessed using code:OpImageWrite as a result 183 of this command, then the code:Type of the code:Texel operand of that 184 instruction must: have at least as many components as the buffer view's 185 format 186ifdef::VK_EXT_shader_image_atomic_int64[] 187 * [[VUID-{refpage}-SampledType-04470]] 188 If a slink:VkImageView with a elink:VkFormat that has a 64-bit component 189 width is accessed as a result of this command, the code:SampledType of 190 the code:OpTypeImage operand of that instruction must: have a code:Width 191 of 64 192 * [[VUID-{refpage}-SampledType-04471]] 193 If a slink:VkImageView with a elink:VkFormat that has a component width 194 less than 64-bit is accessed as a result of this command, the 195 code:SampledType of the code:OpTypeImage operand of that instruction 196 must: have a code:Width of 32 197 * [[VUID-{refpage}-SampledType-04472]] 198 If a slink:VkBufferView with a elink:VkFormat that has a 64-bit 199 component width is accessed as a result of this command, the 200 code:SampledType of the code:OpTypeImage operand of that instruction 201 must: have a code:Width of 64 202 * [[VUID-{refpage}-SampledType-04473]] 203 If a slink:VkBufferView with a elink:VkFormat that has a component width 204 less than 64-bit is accessed as a result of this command, the 205 code:SampledType of the code:OpTypeImage operand of that instruction 206 must: have a code:Width of 32 207 * [[VUID-{refpage}-sparseImageInt64Atomics-04474]] 208 If the 209 <<features-sparseImageInt64Atomics,pname:sparseImageInt64Atomics>> 210 feature is not enabled, slink:VkImage objects created with the 211 ename:VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT flag must: not be accessed by 212 atomic instructions through an code:OpTypeImage with a code:SampledType 213 with a code:Width of 64 by this command 214 * [[VUID-{refpage}-sparseImageInt64Atomics-04475]] 215 If the 216 <<features-sparseImageInt64Atomics,pname:sparseImageInt64Atomics>> 217 feature is not enabled, slink:VkBuffer objects created with the 218 ename:VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT flag must: not be accessed 219 by atomic instructions through an code:OpTypeImage with a 220 code:SampledType with a code:Width of 64 by this command 221endif::VK_EXT_shader_image_atomic_int64[] 222// Common Valid Usage 223