1e5c31af7Sopenharmony_ci// Copyright 2015-2024 The Khronos Group Inc. 2e5c31af7Sopenharmony_ci// 3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 4e5c31af7Sopenharmony_ci 5e5c31af7Sopenharmony_ci[[samplers]] 6e5c31af7Sopenharmony_ci= Samplers 7e5c31af7Sopenharmony_ci 8e5c31af7Sopenharmony_ci[open,refpage='VkSampler',desc='Opaque handle to a sampler object',type='handles'] 9e5c31af7Sopenharmony_ci-- 10e5c31af7Sopenharmony_cisname:VkSampler objects represent the state of an image sampler which is 11e5c31af7Sopenharmony_ciused by the implementation to read image data and apply filtering and other 12e5c31af7Sopenharmony_citransformations for the shader. 13e5c31af7Sopenharmony_ci 14e5c31af7Sopenharmony_ciSamplers are represented by sname:VkSampler handles: 15e5c31af7Sopenharmony_ci 16e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkSampler.adoc[] 17e5c31af7Sopenharmony_ci-- 18e5c31af7Sopenharmony_ci 19e5c31af7Sopenharmony_ci[open,refpage='vkCreateSampler',desc='Create a new sampler object',type='protos'] 20e5c31af7Sopenharmony_ci-- 21e5c31af7Sopenharmony_ci:refpage: vkCreateSampler 22e5c31af7Sopenharmony_ci:objectnameplural: samplers 23e5c31af7Sopenharmony_ci:objectnamecamelcase: sampler 24e5c31af7Sopenharmony_ci:objectcount: 1 25e5c31af7Sopenharmony_ci 26e5c31af7Sopenharmony_ciTo create a sampler object, call: 27e5c31af7Sopenharmony_ci 28e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateSampler.adoc[] 29e5c31af7Sopenharmony_ci 30e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the sampler. 31e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a slink:VkSamplerCreateInfo structure 32e5c31af7Sopenharmony_ci specifying the state of the sampler object. 33e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 34e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 35e5c31af7Sopenharmony_ci * pname:pSampler is a pointer to a slink:VkSampler handle in which the 36e5c31af7Sopenharmony_ci resulting sampler object is returned. 37e5c31af7Sopenharmony_ci 38e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[] 39e5c31af7Sopenharmony_ci 40e5c31af7Sopenharmony_ci.Valid Usage 41e5c31af7Sopenharmony_ci**** 42e5c31af7Sopenharmony_ci * [[VUID-vkCreateSampler-maxSamplerAllocationCount-04110]] 43e5c31af7Sopenharmony_ci There must: be less than 44e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceLimits::pname:maxSamplerAllocationCount 45e5c31af7Sopenharmony_ci slink:VkSampler objects currently created on the device 46e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[] 47e5c31af7Sopenharmony_ci**** 48e5c31af7Sopenharmony_ci 49e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateSampler.adoc[] 50e5c31af7Sopenharmony_ci-- 51e5c31af7Sopenharmony_ci 52e5c31af7Sopenharmony_ci[open,refpage='VkSamplerCreateInfo',desc='Structure specifying parameters of a newly created sampler',type='structs'] 53e5c31af7Sopenharmony_ci-- 54e5c31af7Sopenharmony_ciThe sname:VkSamplerCreateInfo structure is defined as: 55e5c31af7Sopenharmony_ci 56e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerCreateInfo.adoc[] 57e5c31af7Sopenharmony_ci 58e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 59e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 60e5c31af7Sopenharmony_ci structure. 61e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkSamplerCreateFlagBits describing 62e5c31af7Sopenharmony_ci additional parameters of the sampler. 63e5c31af7Sopenharmony_ci * pname:magFilter is a elink:VkFilter value specifying the magnification 64e5c31af7Sopenharmony_ci filter to apply to lookups. 65e5c31af7Sopenharmony_ci * pname:minFilter is a elink:VkFilter value specifying the minification 66e5c31af7Sopenharmony_ci filter to apply to lookups. 67e5c31af7Sopenharmony_ci * pname:mipmapMode is a elink:VkSamplerMipmapMode value specifying the 68e5c31af7Sopenharmony_ci mipmap filter to apply to lookups. 69e5c31af7Sopenharmony_ci * pname:addressModeU is a elink:VkSamplerAddressMode value specifying the 70e5c31af7Sopenharmony_ci addressing mode for U coordinates outside [eq]#[0,1)#. 71e5c31af7Sopenharmony_ci * pname:addressModeV is a elink:VkSamplerAddressMode value specifying the 72e5c31af7Sopenharmony_ci addressing mode for V coordinates outside [eq]#[0,1)#. 73e5c31af7Sopenharmony_ci * pname:addressModeW is a elink:VkSamplerAddressMode value specifying the 74e5c31af7Sopenharmony_ci addressing mode for W coordinates outside [eq]#[0,1)#. 75e5c31af7Sopenharmony_ci * [[samplers-mipLodBias]] pname:mipLodBias is the bias to be added to 76e5c31af7Sopenharmony_ci mipmap LOD calculation and bias provided by image sampling functions in 77e5c31af7Sopenharmony_ci SPIR-V, as described in the <<textures-level-of-detail-operation, LOD 78e5c31af7Sopenharmony_ci Operation>> section. 79e5c31af7Sopenharmony_ci * [[samplers-maxAnisotropy]] pname:anisotropyEnable is ename:VK_TRUE to 80e5c31af7Sopenharmony_ci enable anisotropic filtering, as described in the 81e5c31af7Sopenharmony_ci <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> 82e5c31af7Sopenharmony_ci section, or ename:VK_FALSE otherwise. 83e5c31af7Sopenharmony_ci * pname:maxAnisotropy is the anisotropy value clamp used by the sampler 84e5c31af7Sopenharmony_ci when pname:anisotropyEnable is ename:VK_TRUE. 85e5c31af7Sopenharmony_ci If pname:anisotropyEnable is ename:VK_FALSE, pname:maxAnisotropy is 86e5c31af7Sopenharmony_ci ignored. 87e5c31af7Sopenharmony_ci * pname:compareEnable is ename:VK_TRUE to enable comparison against a 88e5c31af7Sopenharmony_ci reference value during lookups, or ename:VK_FALSE otherwise. 89e5c31af7Sopenharmony_ci ** Note: Some implementations will default to shader state if this member 90e5c31af7Sopenharmony_ci does not match. 91e5c31af7Sopenharmony_ci * pname:compareOp is a elink:VkCompareOp value specifying the comparison 92e5c31af7Sopenharmony_ci operator to apply to fetched data before filtering as described in the 93e5c31af7Sopenharmony_ci <<textures-depth-compare-operation, Depth Compare Operation>> section. 94e5c31af7Sopenharmony_ci * pname:minLod is used to clamp the <<textures-level-of-detail-operation, 95e5c31af7Sopenharmony_ci minimum of the computed LOD value>>. 96e5c31af7Sopenharmony_ci * pname:maxLod is used to clamp the <<textures-level-of-detail-operation, 97e5c31af7Sopenharmony_ci maximum of the computed LOD value>>. 98e5c31af7Sopenharmony_ci To avoid clamping the maximum value, set pname:maxLod to the constant 99e5c31af7Sopenharmony_ci ename:VK_LOD_CLAMP_NONE. 100e5c31af7Sopenharmony_ci * pname:borderColor is a elink:VkBorderColor value specifying the 101e5c31af7Sopenharmony_ci predefined border color to use. 102e5c31af7Sopenharmony_ci * [[samplers-unnormalizedCoordinates]] pname:unnormalizedCoordinates 103e5c31af7Sopenharmony_ci controls whether to use unnormalized or normalized texel coordinates to 104e5c31af7Sopenharmony_ci address texels of the image. 105e5c31af7Sopenharmony_ci When set to ename:VK_TRUE, the range of the image coordinates used to 106e5c31af7Sopenharmony_ci lookup the texel is in the range of zero to the image size in each 107e5c31af7Sopenharmony_ci dimension. 108e5c31af7Sopenharmony_ci When set to ename:VK_FALSE the range of image coordinates is zero to 109e5c31af7Sopenharmony_ci one. 110e5c31af7Sopenharmony_ci+ 111e5c31af7Sopenharmony_ciWhen pname:unnormalizedCoordinates is ename:VK_TRUE, images the sampler is 112e5c31af7Sopenharmony_ciused with in the shader have the following requirements: 113e5c31af7Sopenharmony_ci+ 114e5c31af7Sopenharmony_ci ** The pname:viewType must: be either ename:VK_IMAGE_VIEW_TYPE_1D or 115e5c31af7Sopenharmony_ci ename:VK_IMAGE_VIEW_TYPE_2D. 116e5c31af7Sopenharmony_ci ** The image view must: have a single layer and a single mip level. 117e5c31af7Sopenharmony_ci+ 118e5c31af7Sopenharmony_ciWhen pname:unnormalizedCoordinates is ename:VK_TRUE, image built-in 119e5c31af7Sopenharmony_cifunctions in the shader that use the sampler have the following 120e5c31af7Sopenharmony_cirequirements: 121e5c31af7Sopenharmony_ci+ 122e5c31af7Sopenharmony_ci ** The functions must: not use projection. 123e5c31af7Sopenharmony_ci ** The functions must: not use offsets. 124e5c31af7Sopenharmony_ci 125e5c31af7Sopenharmony_ci[NOTE] 126e5c31af7Sopenharmony_ci.Mapping of OpenGL to Vulkan filter modes 127e5c31af7Sopenharmony_ci==== 128e5c31af7Sopenharmony_cipname:magFilter values of ename:VK_FILTER_NEAREST and ename:VK_FILTER_LINEAR 129e5c31af7Sopenharmony_cidirectly correspond to code:GL_NEAREST and code:GL_LINEAR magnification 130e5c31af7Sopenharmony_cifilters. 131e5c31af7Sopenharmony_cipname:minFilter and pname:mipmapMode combine to correspond to the similarly 132e5c31af7Sopenharmony_cinamed OpenGL minification filter of code:GL_minFilter_MIPMAP_mipmapMode 133e5c31af7Sopenharmony_ci(e.g. pname:minFilter of ename:VK_FILTER_LINEAR and pname:mipmapMode of 134e5c31af7Sopenharmony_ciename:VK_SAMPLER_MIPMAP_MODE_NEAREST correspond to 135e5c31af7Sopenharmony_cicode:GL_LINEAR_MIPMAP_NEAREST). 136e5c31af7Sopenharmony_ci 137e5c31af7Sopenharmony_ciThere are no Vulkan filter modes that directly correspond to OpenGL 138e5c31af7Sopenharmony_ciminification filters of code:GL_LINEAR or code:GL_NEAREST, but they can: be 139e5c31af7Sopenharmony_ciemulated using ename:VK_SAMPLER_MIPMAP_MODE_NEAREST, pname:minLod = 0, and 140e5c31af7Sopenharmony_cipname:maxLod = 0.25, and using pname:minFilter = ename:VK_FILTER_LINEAR or 141e5c31af7Sopenharmony_cipname:minFilter = ename:VK_FILTER_NEAREST, respectively. 142e5c31af7Sopenharmony_ci 143e5c31af7Sopenharmony_ciNote that using a pname:maxLod of zero would cause 144e5c31af7Sopenharmony_ci<<textures-texel-filtering,magnification>> to always be performed, and the 145e5c31af7Sopenharmony_cipname:magFilter to always be used. 146e5c31af7Sopenharmony_ciThis is valid, just not an exact match for OpenGL behavior. 147e5c31af7Sopenharmony_ciClamping the maximum LOD to 0.25 allows the [eq]#{lambda}# value to be 148e5c31af7Sopenharmony_cinon-zero and minification to be performed, while still always rounding down 149e5c31af7Sopenharmony_cito the base level. 150e5c31af7Sopenharmony_ciIf the pname:minFilter and pname:magFilter are equal, then using a 151e5c31af7Sopenharmony_cipname:maxLod of zero also works. 152e5c31af7Sopenharmony_ci==== 153e5c31af7Sopenharmony_ci 154e5c31af7Sopenharmony_ciThe maximum number of sampler objects which can: be simultaneously created 155e5c31af7Sopenharmony_cion a device is implementation-dependent and specified by the 156e5c31af7Sopenharmony_ci<<limits-maxSamplerAllocationCount, pname:maxSamplerAllocationCount>> member 157e5c31af7Sopenharmony_ciof the slink:VkPhysicalDeviceLimits structure. 158e5c31af7Sopenharmony_ci 159e5c31af7Sopenharmony_ci[NOTE] 160e5c31af7Sopenharmony_ci.Note 161e5c31af7Sopenharmony_ci==== 162e5c31af7Sopenharmony_ciFor historical reasons, if pname:maxSamplerAllocationCount is exceeded, some 163e5c31af7Sopenharmony_ciimplementations may return ename:VK_ERROR_TOO_MANY_OBJECTS. 164e5c31af7Sopenharmony_ciExceeding this limit will result in undefined: behavior, and an application 165e5c31af7Sopenharmony_cishould not rely on the use of the returned error code in order to identify 166e5c31af7Sopenharmony_ciwhen the limit is reached. 167e5c31af7Sopenharmony_ci==== 168e5c31af7Sopenharmony_ci 169e5c31af7Sopenharmony_ciSince slink:VkSampler is a non-dispatchable handle type, implementations 170e5c31af7Sopenharmony_cimay: return the same handle for sampler state vectors that are identical. 171e5c31af7Sopenharmony_ciIn such cases, all such objects would only count once against the 172e5c31af7Sopenharmony_cipname:maxSamplerAllocationCount limit. 173e5c31af7Sopenharmony_ci 174e5c31af7Sopenharmony_ci.Valid Usage 175e5c31af7Sopenharmony_ci**** 176e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-mipLodBias-01069]] 177e5c31af7Sopenharmony_ci The absolute value of pname:mipLodBias must: be less than or equal to 178e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxSamplerLodBias 179e5c31af7Sopenharmony_ciifdef::VK_KHR_portability_subset[] 180e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-samplerMipLodBias-04467]] 181e5c31af7Sopenharmony_ci If the `apiext:VK_KHR_portability_subset` extension is enabled, and 182e5c31af7Sopenharmony_ci slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:samplerMipLodBias 183e5c31af7Sopenharmony_ci is ename:VK_FALSE, pname:mipLodBias must: be zero 184e5c31af7Sopenharmony_ciendif::VK_KHR_portability_subset[] 185e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-maxLod-01973]] 186e5c31af7Sopenharmony_ci pname:maxLod must: be greater than or equal to pname:minLod 187e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-anisotropyEnable-01070]] 188e5c31af7Sopenharmony_ci If the <<features-samplerAnisotropy, pname:samplerAnisotropy>> feature 189e5c31af7Sopenharmony_ci is not enabled, pname:anisotropyEnable must: be ename:VK_FALSE 190e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-anisotropyEnable-01071]] 191e5c31af7Sopenharmony_ci If pname:anisotropyEnable is ename:VK_TRUE, pname:maxAnisotropy must: be 192e5c31af7Sopenharmony_ci between `1.0` and 193e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceLimits::pname:maxSamplerAnisotropy, inclusive 194e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 195e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-minFilter-01645]] 196e5c31af7Sopenharmony_ci If <<samplers-YCbCr-conversion,sampler {YCbCr} conversion>> is enabled 197e5c31af7Sopenharmony_ci and the <<potential-format-features, potential format features>> of the 198e5c31af7Sopenharmony_ci sampler {YCbCr} conversion do not support 199e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, 200e5c31af7Sopenharmony_ci pname:minFilter and pname:magFilter must: be equal to the sampler 201e5c31af7Sopenharmony_ci {YCbCr} conversion's pname:chromaFilter 202e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 203e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01072]] 204e5c31af7Sopenharmony_ci If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:minFilter and 205e5c31af7Sopenharmony_ci pname:magFilter must: be equal 206e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01073]] 207e5c31af7Sopenharmony_ci If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:mipmapMode 208e5c31af7Sopenharmony_ci must: be ename:VK_SAMPLER_MIPMAP_MODE_NEAREST 209e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01074]] 210e5c31af7Sopenharmony_ci If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:minLod and 211e5c31af7Sopenharmony_ci pname:maxLod must: be zero 212e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01075]] 213e5c31af7Sopenharmony_ci If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:addressModeU 214e5c31af7Sopenharmony_ci and pname:addressModeV must: each be either 215e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or 216e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER 217e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01076]] 218e5c31af7Sopenharmony_ci If pname:unnormalizedCoordinates is ename:VK_TRUE, 219e5c31af7Sopenharmony_ci pname:anisotropyEnable must: be ename:VK_FALSE 220e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01077]] 221e5c31af7Sopenharmony_ci If pname:unnormalizedCoordinates is ename:VK_TRUE, pname:compareEnable 222e5c31af7Sopenharmony_ci must: be ename:VK_FALSE 223e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-addressModeU-01078]] 224e5c31af7Sopenharmony_ci If any of pname:addressModeU, pname:addressModeV or pname:addressModeW 225e5c31af7Sopenharmony_ci are ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, pname:borderColor 226e5c31af7Sopenharmony_ci must: be a valid elink:VkBorderColor value 227e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 228e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-addressModeU-01646]] 229e5c31af7Sopenharmony_ci If <<samplers-YCbCr-conversion,sampler {YCbCr} conversion>> is enabled, 230e5c31af7Sopenharmony_ci pname:addressModeU, pname:addressModeV, and pname:addressModeW must: be 231e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, pname:anisotropyEnable 232e5c31af7Sopenharmony_ci must: be ename:VK_FALSE, and pname:unnormalizedCoordinates must: be 233e5c31af7Sopenharmony_ci ename:VK_FALSE 234e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_sampler_filter_minmax[] 235e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-None-01647]] 236e5c31af7Sopenharmony_ci If <<samplers-YCbCr-conversion,sampler {YCbCr} conversion>> is enabled 237e5c31af7Sopenharmony_ci and the pname:pNext chain includes a 238e5c31af7Sopenharmony_ci slink:VkSamplerReductionModeCreateInfo structure, then the sampler 239e5c31af7Sopenharmony_ci reduction mode must: be set to 240e5c31af7Sopenharmony_ci ename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE 241e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_sampler_filter_minmax[] 242e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 243e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[] 244e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-pNext-06726]] 245e5c31af7Sopenharmony_ci If <<features-samplerFilterMinmax, pname:samplerFilterMinmax>> is not 246e5c31af7Sopenharmony_ci enabled and the pname:pNext chain includes a 247e5c31af7Sopenharmony_ci slink:VkSamplerReductionModeCreateInfo structure, then the sampler 248e5c31af7Sopenharmony_ci reduction mode must: be set to 249e5c31af7Sopenharmony_ci ename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE 250e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2[] 251e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-addressModeU-01079]] 252e5c31af7Sopenharmony_ci If <<features-samplerMirrorClampToEdge, pname:samplerMirrorClampToEdge>> 253e5c31af7Sopenharmony_ci is not enabled, and if the `apiext:VK_KHR_sampler_mirror_clamp_to_edge` 254e5c31af7Sopenharmony_ci extension is not enabled, pname:addressModeU, pname:addressModeV and 255e5c31af7Sopenharmony_ci pname:addressModeW must: not be 256e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE 257e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-compareEnable-01080]] 258e5c31af7Sopenharmony_ci If pname:compareEnable is ename:VK_TRUE, pname:compareOp must: be a 259e5c31af7Sopenharmony_ci valid elink:VkCompareOp value 260e5c31af7Sopenharmony_ciifdef::VK_IMG_filter_cubic,VK_EXT_filter_cubic[] 261e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-magFilter-01081]] 262e5c31af7Sopenharmony_ci If either pname:magFilter or pname:minFilter is 263e5c31af7Sopenharmony_ci ename:VK_FILTER_CUBIC_EXT, pname:anisotropyEnable must: be 264e5c31af7Sopenharmony_ci ename:VK_FALSE 265e5c31af7Sopenharmony_ciendif::VK_IMG_filter_cubic,VK_EXT_filter_cubic[] 266e5c31af7Sopenharmony_ciifdef::VK_IMG_filter_cubic+VK_EXT_sampler_filter_minmax[] 267e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-magFilter-07911]] 268e5c31af7Sopenharmony_ci If 269e5c31af7Sopenharmony_ciifdef::VK_EXT_filter_cubic[] 270e5c31af7Sopenharmony_ci the apiext:VK_EXT_filter_cubic extension is not enabled and 271e5c31af7Sopenharmony_ciendif::VK_EXT_filter_cubic[] 272e5c31af7Sopenharmony_ci either pname:magFilter or pname:minFilter is ename:VK_FILTER_CUBIC_EXT, 273e5c31af7Sopenharmony_ci the pname:reductionMode member of slink:VkSamplerReductionModeCreateInfo 274e5c31af7Sopenharmony_ci must: be ename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE 275e5c31af7Sopenharmony_ciendif::VK_IMG_filter_cubic+VK_EXT_sampler_filter_minmax[] 276e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_sampler_filter_minmax[] 277e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-compareEnable-01423]] 278e5c31af7Sopenharmony_ci If pname:compareEnable is ename:VK_TRUE, the pname:reductionMode member 279e5c31af7Sopenharmony_ci of slink:VkSamplerReductionModeCreateInfo must: be 280e5c31af7Sopenharmony_ci ename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE 281e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_sampler_filter_minmax[] 282e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 283e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-02574]] 284e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then 285e5c31af7Sopenharmony_ci pname:minFilter and pname:magFilter must: be equal 286e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-02575]] 287e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then 288e5c31af7Sopenharmony_ci pname:mipmapMode must: be ename:VK_SAMPLER_MIPMAP_MODE_NEAREST 289e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-02576]] 290e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then 291e5c31af7Sopenharmony_ci pname:minLod and pname:maxLod must: be zero 292e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-02577]] 293e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then 294e5c31af7Sopenharmony_ci pname:addressModeU and pname:addressModeV must: each be either 295e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or 296e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER 297e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-02578]] 298e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then 299e5c31af7Sopenharmony_ci pname:anisotropyEnable must: be ename:VK_FALSE 300e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-02579]] 301e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then 302e5c31af7Sopenharmony_ci pname:compareEnable must: be ename:VK_FALSE 303e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-02580]] 304e5c31af7Sopenharmony_ci If pname:flags includes ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then 305e5c31af7Sopenharmony_ci pname:unnormalizedCoordinates must: be ename:VK_FALSE 306e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 307e5c31af7Sopenharmony_ciifdef::VK_EXT_non_seamless_cube_map[] 308e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-nonSeamlessCubeMap-06788]] 309e5c31af7Sopenharmony_ci If the <<features-nonSeamlessCubeMap, pname:nonSeamlessCubeMap>> feature 310e5c31af7Sopenharmony_ci is not enabled, pname:flags must: not include 311e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT 312e5c31af7Sopenharmony_ciendif::VK_EXT_non_seamless_cube_map[] 313e5c31af7Sopenharmony_ciifdef::VK_EXT_custom_border_color[] 314e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-borderColor-04011]] 315e5c31af7Sopenharmony_ci If pname:borderColor is one of ename:VK_BORDER_COLOR_FLOAT_CUSTOM_EXT or 316e5c31af7Sopenharmony_ci ename:VK_BORDER_COLOR_INT_CUSTOM_EXT, then a 317e5c31af7Sopenharmony_ci slink:VkSamplerCustomBorderColorCreateInfoEXT must: be included in the 318e5c31af7Sopenharmony_ci pname:pNext chain 319e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-customBorderColors-04085]] 320e5c31af7Sopenharmony_ci If the <<features-customBorderColors, pname:customBorderColors>> feature 321e5c31af7Sopenharmony_ci is not enabled, pname:borderColor must: not be 322e5c31af7Sopenharmony_ci ename:VK_BORDER_COLOR_FLOAT_CUSTOM_EXT or 323e5c31af7Sopenharmony_ci ename:VK_BORDER_COLOR_INT_CUSTOM_EXT 324e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-borderColor-04442]] 325e5c31af7Sopenharmony_ci If pname:borderColor is one of ename:VK_BORDER_COLOR_FLOAT_CUSTOM_EXT or 326e5c31af7Sopenharmony_ci ename:VK_BORDER_COLOR_INT_CUSTOM_EXT, and 327e5c31af7Sopenharmony_ci slink:VkSamplerCustomBorderColorCreateInfoEXT::pname:format is not 328e5c31af7Sopenharmony_ci ename:VK_FORMAT_UNDEFINED, 329e5c31af7Sopenharmony_ci slink:VkSamplerCustomBorderColorCreateInfoEXT::pname:customBorderColor 330e5c31af7Sopenharmony_ci must: be within the range of values representable in pname:format 331e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-None-04012]] 332e5c31af7Sopenharmony_ci The maximum number of samplers with custom border colors which can: be 333e5c31af7Sopenharmony_ci simultaneously created on a device is implementation-dependent and 334e5c31af7Sopenharmony_ci specified by the <<limits-maxCustomBorderColorSamplers, 335e5c31af7Sopenharmony_ci pname:maxCustomBorderColorSamplers>> member of the 336e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceCustomBorderColorPropertiesEXT structure 337e5c31af7Sopenharmony_ciendif::VK_EXT_custom_border_color[] 338e5c31af7Sopenharmony_ciifdef::VK_EXT_descriptor_buffer[] 339e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-08110]] 340e5c31af7Sopenharmony_ci If pname:flags includes 341e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT, the 342e5c31af7Sopenharmony_ci <<features-descriptorBufferCaptureReplay, 343e5c31af7Sopenharmony_ci pname:descriptorBufferCaptureReplay>> feature must: be enabled 344e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-pNext-08111]] 345e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 346e5c31af7Sopenharmony_ci slink:VkOpaqueCaptureDescriptorDataCreateInfoEXT structure, pname:flags 347e5c31af7Sopenharmony_ci must: contain 348e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT 349e5c31af7Sopenharmony_ciendif::VK_EXT_descriptor_buffer[] 350e5c31af7Sopenharmony_ciifdef::VK_QCOM_image_processing[] 351e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-06964]] 352e5c31af7Sopenharmony_ci If pname:flags includes 353e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then pname:minFilter 354e5c31af7Sopenharmony_ci and pname:magFilter must: be ename:VK_FILTER_NEAREST 355e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-06965]] 356e5c31af7Sopenharmony_ci If pname:flags includes 357e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then pname:mipmapMode 358e5c31af7Sopenharmony_ci must: be ename:VK_SAMPLER_MIPMAP_MODE_NEAREST 359e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-06966]] 360e5c31af7Sopenharmony_ci [If pname:flags includes 361e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then pname:minLod and 362e5c31af7Sopenharmony_ci pname:maxLod must: be zero 363e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-06967]] 364e5c31af7Sopenharmony_ci If pname:flags includes 365e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then 366e5c31af7Sopenharmony_ci pname:addressModeU and pname:addressModeV must: each be either 367e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or 368e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER 369e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-06968]] 370e5c31af7Sopenharmony_ci If pname:flags includes 371e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, and if 372e5c31af7Sopenharmony_ci pname:addressModeU or pname:addressModeV is 373e5c31af7Sopenharmony_ci ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, then pname:borderColor 374e5c31af7Sopenharmony_ci must: be ename:VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK 375e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-06969]] 376e5c31af7Sopenharmony_ci If pname:flags includes 377e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then 378e5c31af7Sopenharmony_ci pname:anisotropyEnable must: be ename:VK_FALSE 379e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCreateInfo-flags-06970]] 380e5c31af7Sopenharmony_ci If pname:flags includes 381e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then 382e5c31af7Sopenharmony_ci pname:compareEnable must: be ename:VK_FALSE 383e5c31af7Sopenharmony_ciendif::VK_QCOM_image_processing[] 384e5c31af7Sopenharmony_ci**** 385e5c31af7Sopenharmony_ci 386e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerCreateInfo.adoc[] 387e5c31af7Sopenharmony_ci-- 388e5c31af7Sopenharmony_ci 389e5c31af7Sopenharmony_ci[open,refpage='VK_LOD_CLAMP_NONE',desc='Maximum LOD unclamped access sentinel',type='consts'] 390e5c31af7Sopenharmony_ci-- 391e5c31af7Sopenharmony_ciename:VK_LOD_CLAMP_NONE is a special constant value used for 392e5c31af7Sopenharmony_cislink:VkSamplerCreateInfo::pname:maxLod to indicate that maximum LOD 393e5c31af7Sopenharmony_ciclamping should not be performed. 394e5c31af7Sopenharmony_ci 395e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VK_LOD_CLAMP_NONE.adoc[] 396e5c31af7Sopenharmony_ci-- 397e5c31af7Sopenharmony_ci 398e5c31af7Sopenharmony_ci[open,refpage='VkSamplerCreateFlagBits',desc='Bitmask specifying additional parameters of sampler',type='enums'] 399e5c31af7Sopenharmony_ci-- 400e5c31af7Sopenharmony_ciBits which can: be set in slink:VkSamplerCreateInfo::pname:flags, specifying 401e5c31af7Sopenharmony_ciadditional parameters of a sampler, are: 402e5c31af7Sopenharmony_ci 403e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerCreateFlagBits.adoc[] 404e5c31af7Sopenharmony_ci 405e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 406e5c31af7Sopenharmony_ci * [[samplers-subsamplesampler]] ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT 407e5c31af7Sopenharmony_ci specifies that the sampler will read from an image created with 408e5c31af7Sopenharmony_ci pname:flags containing ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT. 409e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT 410e5c31af7Sopenharmony_ci specifies that the implementation may: use approximations when 411e5c31af7Sopenharmony_ci reconstructing a full color value for texture access from a subsampled 412e5c31af7Sopenharmony_ci image. 413e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 414e5c31af7Sopenharmony_ciifdef::VK_EXT_non_seamless_cube_map[] 415e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT specifies that 416e5c31af7Sopenharmony_ci <<textures-cubemapedge, cube map edge handling>> is not performed. 417e5c31af7Sopenharmony_ciendif::VK_EXT_non_seamless_cube_map[] 418e5c31af7Sopenharmony_ciifdef::VK_QCOM_image_processing[] 419e5c31af7Sopenharmony_ci * [[samplers-imageprocessingsampler]] 420e5c31af7Sopenharmony_ci ename:VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM specifies that the 421e5c31af7Sopenharmony_ci sampler will read from images using only code:OpImageWeightedSampleQCOM, 422e5c31af7Sopenharmony_ci code:OpImageBoxFilterQCOM, 423e5c31af7Sopenharmony_ciifdef::VK_QCOM_image_processing2[] 424e5c31af7Sopenharmony_ci code:OpImageBlockMatchGatherSSDQCOM, 425e5c31af7Sopenharmony_ci code:OpImageBlockMatchGatherSADQCOM, 426e5c31af7Sopenharmony_ci code:OpImageBlockMatchWindowSSDQCOM, 427e5c31af7Sopenharmony_ci code:OpImageBlockMatchWindowSADQCOM, 428e5c31af7Sopenharmony_ciendif::VK_QCOM_image_processing2[] 429e5c31af7Sopenharmony_ci code:OpImageBlockMatchSSDQCOM, or code:OpImageBlockMatchSADQCOM. 430e5c31af7Sopenharmony_ciendif::VK_QCOM_image_processing[] 431e5c31af7Sopenharmony_ci 432e5c31af7Sopenharmony_ciifdef::VK_EXT_fragment_density_map[] 433e5c31af7Sopenharmony_ci[NOTE] 434e5c31af7Sopenharmony_ci.Note 435e5c31af7Sopenharmony_ci==== 436e5c31af7Sopenharmony_ciThe approximations used when 437e5c31af7Sopenharmony_ciename:VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT is 438e5c31af7Sopenharmony_cispecified are implementation defined. 439e5c31af7Sopenharmony_ciSome implementations may: interpolate between fragment density levels in a 440e5c31af7Sopenharmony_cisubsampled image. 441e5c31af7Sopenharmony_ciIn that case, this bit may: be used to decide whether the interpolation 442e5c31af7Sopenharmony_cifactors are calculated per fragment or at a coarser granularity. 443e5c31af7Sopenharmony_ci==== 444e5c31af7Sopenharmony_ciendif::VK_EXT_fragment_density_map[] 445e5c31af7Sopenharmony_ciifdef::VK_EXT_descriptor_buffer[] 446e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT 447e5c31af7Sopenharmony_ci specifies that the sampler can: be used with descriptor buffers when 448e5c31af7Sopenharmony_ci capturing and replaying (e.g. for trace capture and replay), see 449e5c31af7Sopenharmony_ci slink:VkOpaqueCaptureDescriptorDataCreateInfoEXT for more detail. 450e5c31af7Sopenharmony_ciendif::VK_EXT_descriptor_buffer[] 451e5c31af7Sopenharmony_ci-- 452e5c31af7Sopenharmony_ci 453e5c31af7Sopenharmony_ci[open,refpage='VkSamplerCreateFlags',desc='Reserved for future use',type='flags'] 454e5c31af7Sopenharmony_ci-- 455e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkSamplerCreateFlags.adoc[] 456e5c31af7Sopenharmony_ci 457e5c31af7Sopenharmony_citname:VkSamplerCreateFlags is a bitmask type for setting a mask of zero or 458e5c31af7Sopenharmony_cimore elink:VkSamplerCreateFlagBits. 459e5c31af7Sopenharmony_ci-- 460e5c31af7Sopenharmony_ci 461e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_EXT_sampler_filter_minmax[] 462e5c31af7Sopenharmony_ci[open,refpage='VkSamplerReductionModeCreateInfo',desc='Structure specifying sampler reduction mode',type='structs',alias='VkSamplerReductionModeCreateInfoEXT'] 463e5c31af7Sopenharmony_ci-- 464e5c31af7Sopenharmony_ciThe sname:VkSamplerReductionModeCreateInfo structure is defined as: 465e5c31af7Sopenharmony_ci 466e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerReductionModeCreateInfo.adoc[] 467e5c31af7Sopenharmony_ci 468e5c31af7Sopenharmony_ciifdef::VK_EXT_sampler_filter_minmax[] 469e5c31af7Sopenharmony_cior the equivalent 470e5c31af7Sopenharmony_ci 471e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerReductionModeCreateInfoEXT.adoc[] 472e5c31af7Sopenharmony_ciendif::VK_EXT_sampler_filter_minmax[] 473e5c31af7Sopenharmony_ci 474e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 475e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 476e5c31af7Sopenharmony_ci structure. 477e5c31af7Sopenharmony_ci * pname:reductionMode is a elink:VkSamplerReductionMode value controlling 478e5c31af7Sopenharmony_ci how texture filtering combines texel values. 479e5c31af7Sopenharmony_ci 480e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkSamplerCreateInfo includes a 481e5c31af7Sopenharmony_cisname:VkSamplerReductionModeCreateInfo structure, then that structure 482e5c31af7Sopenharmony_ciincludes a mode controlling how texture filtering combines texel values. 483e5c31af7Sopenharmony_ci 484e5c31af7Sopenharmony_ciIf this structure is not present, pname:reductionMode is considered to be 485e5c31af7Sopenharmony_ciename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE. 486e5c31af7Sopenharmony_ci 487e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerReductionModeCreateInfo.adoc[] 488e5c31af7Sopenharmony_ci-- 489e5c31af7Sopenharmony_ci 490e5c31af7Sopenharmony_ci[open,refpage='VkSamplerReductionMode',desc='Specify reduction mode for texture filtering',type='enums',alias='VkSamplerReductionModeEXT'] 491e5c31af7Sopenharmony_ci-- 492e5c31af7Sopenharmony_ciReduction modes are specified by elink:VkSamplerReductionMode, which takes 493e5c31af7Sopenharmony_civalues: 494e5c31af7Sopenharmony_ci 495e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerReductionMode.adoc[] 496e5c31af7Sopenharmony_ci 497e5c31af7Sopenharmony_ciifdef::VK_EXT_sampler_filter_minmax[] 498e5c31af7Sopenharmony_cior the equivalent 499e5c31af7Sopenharmony_ci 500e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerReductionModeEXT.adoc[] 501e5c31af7Sopenharmony_ciendif::VK_EXT_sampler_filter_minmax[] 502e5c31af7Sopenharmony_ci 503e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE specifies that texel 504e5c31af7Sopenharmony_ci values are combined by computing a weighted average of values in the 505e5c31af7Sopenharmony_ci footprint, using weights as specified in 506e5c31af7Sopenharmony_ci <<textures-unnormalized-to-integer,the image operations chapter>>. 507e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_REDUCTION_MODE_MIN specifies that texel values are 508e5c31af7Sopenharmony_ci combined by taking the component-wise minimum of values in the footprint 509e5c31af7Sopenharmony_ci with non-zero weights. 510e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_REDUCTION_MODE_MAX specifies that texel values are 511e5c31af7Sopenharmony_ci combined by taking the component-wise maximum of values in the footprint 512e5c31af7Sopenharmony_ci with non-zero weights. 513e5c31af7Sopenharmony_ciifdef::VK_QCOM_filter_cubic_clamp[] 514e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM 515e5c31af7Sopenharmony_ci specifies values are combined as described by 516e5c31af7Sopenharmony_ci ename:VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, followed by a 517e5c31af7Sopenharmony_ci <<textures-texel-range-clamp,texel range clamp>>. 518e5c31af7Sopenharmony_ciendif::VK_QCOM_filter_cubic_clamp[] 519e5c31af7Sopenharmony_ci-- 520e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_EXT_sampler_filter_minmax[] 521e5c31af7Sopenharmony_ci 522e5c31af7Sopenharmony_ciifdef::VK_QCOM_filter_cubic_weights[] 523e5c31af7Sopenharmony_ci[open,refpage='VkSamplerCubicWeightsCreateInfoQCOM',desc='Structure specifying sampler cubic weights',type='structs'] 524e5c31af7Sopenharmony_ci-- 525e5c31af7Sopenharmony_ciThe sname:VkSamplerCubicWeightsCreateInfoQCOM structure is defined as: 526e5c31af7Sopenharmony_ci 527e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerCubicWeightsCreateInfoQCOM.adoc[] 528e5c31af7Sopenharmony_ci 529e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 530e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 531e5c31af7Sopenharmony_ci structure. 532e5c31af7Sopenharmony_ci * pname:cubicWeights is a elink:VkCubicFilterWeightsQCOM value controlling 533e5c31af7Sopenharmony_ci which cubic weights are used. 534e5c31af7Sopenharmony_ci 535e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkSamplerCreateInfo includes a 536e5c31af7Sopenharmony_cisname:VkSamplerCubicWeightsCreateInfoQCOM structure, then that structure 537e5c31af7Sopenharmony_cispecifies which cubic weights are used. 538e5c31af7Sopenharmony_ci 539e5c31af7Sopenharmony_ciIf that structure is not present, pname:cubicWeights is considered to be 540e5c31af7Sopenharmony_ciename:VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM. 541e5c31af7Sopenharmony_ci 542e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerCubicWeightsCreateInfoQCOM.adoc[] 543e5c31af7Sopenharmony_ci-- 544e5c31af7Sopenharmony_ci 545e5c31af7Sopenharmony_ci[open,refpage='VkCubicFilterWeightsQCOM',desc='Specify cubic weights for texture filtering',type='enums'] 546e5c31af7Sopenharmony_ci-- 547e5c31af7Sopenharmony_ciPossible values of the 548e5c31af7Sopenharmony_cislink:VkSamplerCubicWeightsCreateInfoQCOM::pname:cubicWeights, specifying 549e5c31af7Sopenharmony_cicubic weights used in <<textures-texel-cubic-filtering, Texel Cubic 550e5c31af7Sopenharmony_ciFiltering>> are: 551e5c31af7Sopenharmony_ci 552e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCubicFilterWeightsQCOM.adoc[] 553e5c31af7Sopenharmony_ci 554e5c31af7Sopenharmony_ci * ename:VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM specifies Catmull-Rom 555e5c31af7Sopenharmony_ci weights. 556e5c31af7Sopenharmony_ci * ename:VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM specifies Zero 557e5c31af7Sopenharmony_ci Tangent Cardinal weights. 558e5c31af7Sopenharmony_ci * ename:VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM specifies B-Spline weights. 559e5c31af7Sopenharmony_ci * ename:VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM specifies 560e5c31af7Sopenharmony_ci Mitchell-Netravali weights. 561e5c31af7Sopenharmony_ci-- 562e5c31af7Sopenharmony_ciendif::VK_QCOM_filter_cubic_weights[] 563e5c31af7Sopenharmony_ci 564e5c31af7Sopenharmony_ci[open,refpage='VkFilter',desc='Specify filters used for texture lookups',type='enums'] 565e5c31af7Sopenharmony_ci-- 566e5c31af7Sopenharmony_ciPossible values of the slink:VkSamplerCreateInfo::pname:magFilter and 567e5c31af7Sopenharmony_cipname:minFilter parameters, specifying filters used for texture lookups, 568e5c31af7Sopenharmony_ciare: 569e5c31af7Sopenharmony_ci 570e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkFilter.adoc[] 571e5c31af7Sopenharmony_ci 572e5c31af7Sopenharmony_ci * ename:VK_FILTER_NEAREST specifies nearest filtering. 573e5c31af7Sopenharmony_ci * ename:VK_FILTER_LINEAR specifies linear filtering. 574e5c31af7Sopenharmony_ciifdef::VK_IMG_filter_cubic,VK_EXT_filter_cubic[] 575e5c31af7Sopenharmony_ci * ename:VK_FILTER_CUBIC_EXT specifies cubic filtering. 576e5c31af7Sopenharmony_ciendif::VK_IMG_filter_cubic,VK_EXT_filter_cubic[] 577e5c31af7Sopenharmony_ci 578e5c31af7Sopenharmony_ciThese filters are described in detail in <<textures-texel-filtering, Texel 579e5c31af7Sopenharmony_ciFiltering>>. 580e5c31af7Sopenharmony_ci-- 581e5c31af7Sopenharmony_ci 582e5c31af7Sopenharmony_ci[open,refpage='VkSamplerMipmapMode',desc='Specify mipmap mode used for texture lookups',type='enums'] 583e5c31af7Sopenharmony_ci-- 584e5c31af7Sopenharmony_ciPossible values of the slink:VkSamplerCreateInfo::pname:mipmapMode, 585e5c31af7Sopenharmony_cispecifying the mipmap mode used for texture lookups, are: 586e5c31af7Sopenharmony_ci 587e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerMipmapMode.adoc[] 588e5c31af7Sopenharmony_ci 589e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_MIPMAP_MODE_NEAREST specifies nearest filtering. 590e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_MIPMAP_MODE_LINEAR specifies linear filtering. 591e5c31af7Sopenharmony_ci 592e5c31af7Sopenharmony_ciThese modes are described in detail in <<textures-texel-filtering, Texel 593e5c31af7Sopenharmony_ciFiltering>>. 594e5c31af7Sopenharmony_ci-- 595e5c31af7Sopenharmony_ci 596e5c31af7Sopenharmony_ci[open,refpage='VkSamplerAddressMode',desc='Specify behavior of sampling with texture coordinates outside an image',type='enums'] 597e5c31af7Sopenharmony_ci-- 598e5c31af7Sopenharmony_ciPossible values of the slink:VkSamplerCreateInfo::ptext:addressMode* 599e5c31af7Sopenharmony_ciparameters, specifying the behavior of sampling with coordinates outside the 600e5c31af7Sopenharmony_cirange [eq]#[0,1]# for the respective [eq]#u#, [eq]#v#, or [eq]#w# coordinate 601e5c31af7Sopenharmony_cias defined in the <<textures-wrapping-operation, Wrapping Operation>> 602e5c31af7Sopenharmony_cisection, are: 603e5c31af7Sopenharmony_ci 604e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerAddressMode.adoc[] 605e5c31af7Sopenharmony_ci 606e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_ADDRESS_MODE_REPEAT specifies that the repeat wrap mode 607e5c31af7Sopenharmony_ci will be used. 608e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT specifies that the 609e5c31af7Sopenharmony_ci mirrored repeat wrap mode will be used. 610e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE specifies that the clamp to 611e5c31af7Sopenharmony_ci edge wrap mode will be used. 612e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER specifies that the clamp 613e5c31af7Sopenharmony_ci to border wrap mode will be used. 614e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_sampler_mirror_clamp_to_edge[] 615e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE specifies that the 616e5c31af7Sopenharmony_ci mirror clamp to edge wrap mode will be used. 617e5c31af7Sopenharmony_ci This is only valid if 618e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2[<<features-samplerMirrorClampToEdge, pname:samplerMirrorClampToEdge>> is enabled, or if] 619e5c31af7Sopenharmony_ci the `apiext:VK_KHR_sampler_mirror_clamp_to_edge` extension is enabled. 620e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_sampler_mirror_clamp_to_edge[] 621e5c31af7Sopenharmony_ci-- 622e5c31af7Sopenharmony_ci 623e5c31af7Sopenharmony_ci[open,refpage='VkCompareOp',desc='Comparison operator for depth, stencil, and sampler operations',type='enums'] 624e5c31af7Sopenharmony_ci-- 625e5c31af7Sopenharmony_ci_Comparison operators_ compare a _reference_ and a _test_ value, and return 626e5c31af7Sopenharmony_cia true ("`passed`") or false ("`failed`") value depending on the comparison 627e5c31af7Sopenharmony_cioperator chosen. 628e5c31af7Sopenharmony_ciThe supported operators are: 629e5c31af7Sopenharmony_ci 630e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCompareOp.adoc[] 631e5c31af7Sopenharmony_ci 632e5c31af7Sopenharmony_ci * ename:VK_COMPARE_OP_NEVER specifies that the comparison always evaluates 633e5c31af7Sopenharmony_ci false. 634e5c31af7Sopenharmony_ci * ename:VK_COMPARE_OP_LESS specifies that the comparison evaluates 635e5c31af7Sopenharmony_ci [eq]#_reference_ < _test_#. 636e5c31af7Sopenharmony_ci * ename:VK_COMPARE_OP_EQUAL specifies that the comparison evaluates 637e5c31af7Sopenharmony_ci [eq]#_reference_ = _test_#. 638e5c31af7Sopenharmony_ci * ename:VK_COMPARE_OP_LESS_OR_EQUAL specifies that the comparison 639e5c31af7Sopenharmony_ci evaluates [eq]#_reference_ {leq} _test_#. 640e5c31af7Sopenharmony_ci * ename:VK_COMPARE_OP_GREATER specifies that the comparison evaluates 641e5c31af7Sopenharmony_ci [eq]#_reference_ > _test_#. 642e5c31af7Sopenharmony_ci * ename:VK_COMPARE_OP_NOT_EQUAL specifies that the comparison evaluates 643e5c31af7Sopenharmony_ci [eq]#_reference_ {neq} _test_#. 644e5c31af7Sopenharmony_ci * ename:VK_COMPARE_OP_GREATER_OR_EQUAL specifies that the comparison 645e5c31af7Sopenharmony_ci evaluates [eq]#_reference_ {geq} _test_#. 646e5c31af7Sopenharmony_ci * ename:VK_COMPARE_OP_ALWAYS specifies that the comparison always 647e5c31af7Sopenharmony_ci evaluates true. 648e5c31af7Sopenharmony_ci 649e5c31af7Sopenharmony_ciComparison operators are used for: 650e5c31af7Sopenharmony_ci 651e5c31af7Sopenharmony_ci * The <<textures-depth-compare-operation, Depth Compare Operation>> 652e5c31af7Sopenharmony_ci operator for a sampler, specified by 653e5c31af7Sopenharmony_ci slink:VkSamplerCreateInfo::pname:compareOp. 654e5c31af7Sopenharmony_ci * The stencil comparison operator for the <<fragops-stencil, stencil 655e5c31af7Sopenharmony_ci test>>, specified by 656e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[] 657e5c31af7Sopenharmony_ciflink:vkCmdSetStencilOp::pname:compareOp or 658e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[] 659e5c31af7Sopenharmony_ci slink:VkStencilOpState::pname:compareOp. 660e5c31af7Sopenharmony_ci * The <<fragops-depth-comparison, Depth Comparison>> operator for the 661e5c31af7Sopenharmony_ci <<fragops-depth,depth test>>, specified by 662e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[] 663e5c31af7Sopenharmony_ciflink:vkCmdSetDepthCompareOp::pname:depthCompareOp or 664e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state[] 665e5c31af7Sopenharmony_ci slink:VkPipelineDepthStencilStateCreateInfo::pname:depthCompareOp. 666e5c31af7Sopenharmony_ci 667e5c31af7Sopenharmony_ciEach such use describes how the _reference_ and _test_ values for that 668e5c31af7Sopenharmony_cicomparison are determined. 669e5c31af7Sopenharmony_ci-- 670e5c31af7Sopenharmony_ci 671e5c31af7Sopenharmony_ci[open,refpage='VkBorderColor',desc='Specify border color used for texture lookups',type='enums'] 672e5c31af7Sopenharmony_ci-- 673e5c31af7Sopenharmony_ciPossible values of slink:VkSamplerCreateInfo::pname:borderColor, specifying 674e5c31af7Sopenharmony_cithe border color used for texture lookups, are: 675e5c31af7Sopenharmony_ci 676e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkBorderColor.adoc[] 677e5c31af7Sopenharmony_ci 678e5c31af7Sopenharmony_ci * ename:VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK specifies a transparent, 679e5c31af7Sopenharmony_ci floating-point format, black color. 680e5c31af7Sopenharmony_ci * ename:VK_BORDER_COLOR_INT_TRANSPARENT_BLACK specifies a transparent, 681e5c31af7Sopenharmony_ci integer format, black color. 682e5c31af7Sopenharmony_ci * ename:VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK specifies an opaque, 683e5c31af7Sopenharmony_ci floating-point format, black color. 684e5c31af7Sopenharmony_ci * ename:VK_BORDER_COLOR_INT_OPAQUE_BLACK specifies an opaque, integer 685e5c31af7Sopenharmony_ci format, black color. 686e5c31af7Sopenharmony_ci * ename:VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE specifies an opaque, 687e5c31af7Sopenharmony_ci floating-point format, white color. 688e5c31af7Sopenharmony_ci * ename:VK_BORDER_COLOR_INT_OPAQUE_WHITE specifies an opaque, integer 689e5c31af7Sopenharmony_ci format, white color. 690e5c31af7Sopenharmony_ciifdef::VK_EXT_custom_border_color[] 691e5c31af7Sopenharmony_ci * ename:VK_BORDER_COLOR_FLOAT_CUSTOM_EXT indicates that a 692e5c31af7Sopenharmony_ci slink:VkSamplerCustomBorderColorCreateInfoEXT structure is included in 693e5c31af7Sopenharmony_ci the slink:VkSamplerCreateInfo::pname:pNext chain containing the color 694e5c31af7Sopenharmony_ci data in floating-point format. 695e5c31af7Sopenharmony_ci * ename:VK_BORDER_COLOR_INT_CUSTOM_EXT indicates that a 696e5c31af7Sopenharmony_ci slink:VkSamplerCustomBorderColorCreateInfoEXT structure is included in 697e5c31af7Sopenharmony_ci the slink:VkSamplerCreateInfo::pname:pNext chain containing the color 698e5c31af7Sopenharmony_ci data in integer format. 699e5c31af7Sopenharmony_ciendif::VK_EXT_custom_border_color[] 700e5c31af7Sopenharmony_ci 701e5c31af7Sopenharmony_ciThese colors are described in detail in <<textures-texel-replacement, Texel 702e5c31af7Sopenharmony_ciReplacement>>. 703e5c31af7Sopenharmony_ci-- 704e5c31af7Sopenharmony_ci 705e5c31af7Sopenharmony_ci[open,refpage='vkDestroySampler',desc='Destroy a sampler object',type='protos'] 706e5c31af7Sopenharmony_ci-- 707e5c31af7Sopenharmony_ciTo destroy a sampler, call: 708e5c31af7Sopenharmony_ci 709e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroySampler.adoc[] 710e5c31af7Sopenharmony_ci 711e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the sampler. 712e5c31af7Sopenharmony_ci * pname:sampler is the sampler to destroy. 713e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 714e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 715e5c31af7Sopenharmony_ci 716e5c31af7Sopenharmony_ci.Valid Usage 717e5c31af7Sopenharmony_ci**** 718e5c31af7Sopenharmony_ci * [[VUID-vkDestroySampler-sampler-01082]] 719e5c31af7Sopenharmony_ci All submitted commands that refer to pname:sampler must: have completed 720e5c31af7Sopenharmony_ci execution 721e5c31af7Sopenharmony_ciifndef::VKSC_VERSION_1_0[] 722e5c31af7Sopenharmony_ci * [[VUID-vkDestroySampler-sampler-01083]] 723e5c31af7Sopenharmony_ci If sname:VkAllocationCallbacks were provided when pname:sampler was 724e5c31af7Sopenharmony_ci created, a compatible set of callbacks must: be provided here 725e5c31af7Sopenharmony_ci * [[VUID-vkDestroySampler-sampler-01084]] 726e5c31af7Sopenharmony_ci If no sname:VkAllocationCallbacks were provided when pname:sampler was 727e5c31af7Sopenharmony_ci created, pname:pAllocator must: be `NULL` 728e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[] 729e5c31af7Sopenharmony_ci**** 730e5c31af7Sopenharmony_ci 731e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroySampler.adoc[] 732e5c31af7Sopenharmony_ci-- 733e5c31af7Sopenharmony_ci 734e5c31af7Sopenharmony_ci 735e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 736e5c31af7Sopenharmony_ci[[samplers-YCbCr-conversion]] 737e5c31af7Sopenharmony_ci== Sampler {YCbCr} Conversion 738e5c31af7Sopenharmony_ci 739e5c31af7Sopenharmony_ci[open,refpage='VkSamplerYcbcrConversionInfo',desc='Structure specifying {YCbCr} conversion to a sampler or image view',type='structs'] 740e5c31af7Sopenharmony_ci-- 741e5c31af7Sopenharmony_ciTo create a sampler with {YCbCr} conversion enabled, add a 742e5c31af7Sopenharmony_cislink:VkSamplerYcbcrConversionInfo structure to the pname:pNext chain of the 743e5c31af7Sopenharmony_cislink:VkSamplerCreateInfo structure. 744e5c31af7Sopenharmony_ciTo create a sampler {YCbCr} conversion, the 745e5c31af7Sopenharmony_ci<<features-samplerYcbcrConversion, pname:samplerYcbcrConversion>> feature 746e5c31af7Sopenharmony_cimust: be enabled. 747e5c31af7Sopenharmony_ciConversion must: be fixed at pipeline creation time, through use of a 748e5c31af7Sopenharmony_cicombined image sampler with an immutable sampler in 749e5c31af7Sopenharmony_cisname:VkDescriptorSetLayoutBinding. 750e5c31af7Sopenharmony_ci 751e5c31af7Sopenharmony_ciA slink:VkSamplerYcbcrConversionInfo must: be provided for samplers to be 752e5c31af7Sopenharmony_ciused with image views that access ename:VK_IMAGE_ASPECT_COLOR_BIT if the 753e5c31af7Sopenharmony_ciformat is one of the <<formats-requiring-sampler-ycbcr-conversion, formats 754e5c31af7Sopenharmony_cithat require a sampler {YCbCr} conversion>> 755e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[] 756e5c31af7Sopenharmony_ci, or if the image view has an 757e5c31af7Sopenharmony_ci<<memory-external-android-hardware-buffer-external-formats,external format>> 758e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[] 759e5c31af7Sopenharmony_ci. 760e5c31af7Sopenharmony_ci 761e5c31af7Sopenharmony_ciThe sname:VkSamplerYcbcrConversionInfo structure is defined as: 762e5c31af7Sopenharmony_ci 763e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerYcbcrConversionInfo.adoc[] 764e5c31af7Sopenharmony_ci 765e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[] 766e5c31af7Sopenharmony_cior the equivalent 767e5c31af7Sopenharmony_ci 768e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerYcbcrConversionInfoKHR.adoc[] 769e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[] 770e5c31af7Sopenharmony_ci 771e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 772e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 773e5c31af7Sopenharmony_ci structure. 774e5c31af7Sopenharmony_ci * pname:conversion is a slink:VkSamplerYcbcrConversion handle created with 775e5c31af7Sopenharmony_ci flink:vkCreateSamplerYcbcrConversion. 776e5c31af7Sopenharmony_ci 777e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerYcbcrConversionInfo.adoc[] 778e5c31af7Sopenharmony_ci-- 779e5c31af7Sopenharmony_ci 780e5c31af7Sopenharmony_ci[open,refpage='VkSamplerYcbcrConversion',desc='Opaque handle to a device-specific sampler {YCbCr} conversion description',type='handles'] 781e5c31af7Sopenharmony_ci-- 782e5c31af7Sopenharmony_ciA sampler {YCbCr} conversion is an opaque representation of a 783e5c31af7Sopenharmony_cidevice-specific sampler {YCbCr} conversion description, represented as a 784e5c31af7Sopenharmony_cisname:VkSamplerYcbcrConversion handle: 785e5c31af7Sopenharmony_ci 786e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkSamplerYcbcrConversion.adoc[] 787e5c31af7Sopenharmony_ci 788e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[] 789e5c31af7Sopenharmony_cior the equivalent 790e5c31af7Sopenharmony_ci 791e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkSamplerYcbcrConversionKHR.adoc[] 792e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[] 793e5c31af7Sopenharmony_ci-- 794e5c31af7Sopenharmony_ci 795e5c31af7Sopenharmony_ci[open,refpage='vkCreateSamplerYcbcrConversion',desc='Create a new {YCbCr} conversion',type='protos'] 796e5c31af7Sopenharmony_ci-- 797e5c31af7Sopenharmony_ci:refpage: vkCreateSamplerYcbcrConversion 798e5c31af7Sopenharmony_ci:objectnameplural: sampler conversions 799e5c31af7Sopenharmony_ci:objectnamecamelcase: samplerYcbcrConversion 800e5c31af7Sopenharmony_ci:objectcount: 1 801e5c31af7Sopenharmony_ci 802e5c31af7Sopenharmony_ciTo create a slink:VkSamplerYcbcrConversion, call: 803e5c31af7Sopenharmony_ci 804e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[] 805e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateSamplerYcbcrConversion.adoc[] 806e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[] 807e5c31af7Sopenharmony_ci 808e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_sampler_ycbcr_conversion[or the equivalent command] 809e5c31af7Sopenharmony_ci 810e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[] 811e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateSamplerYcbcrConversionKHR.adoc[] 812e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[] 813e5c31af7Sopenharmony_ci 814e5c31af7Sopenharmony_ci * pname:device is the logical device that creates the sampler {YCbCr} 815e5c31af7Sopenharmony_ci conversion. 816e5c31af7Sopenharmony_ci * pname:pCreateInfo is a pointer to a 817e5c31af7Sopenharmony_ci slink:VkSamplerYcbcrConversionCreateInfo structure specifying the 818e5c31af7Sopenharmony_ci requested sampler {YCbCr} conversion. 819e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 820e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 821e5c31af7Sopenharmony_ci * pname:pYcbcrConversion is a pointer to a slink:VkSamplerYcbcrConversion 822e5c31af7Sopenharmony_ci handle in which the resulting sampler {YCbCr} conversion is returned. 823e5c31af7Sopenharmony_ci 824e5c31af7Sopenharmony_ciThe interpretation of the configured sampler {YCbCr} conversion is described 825e5c31af7Sopenharmony_ciin more detail in <<textures-sampler-YCbCr-conversion,the description of 826e5c31af7Sopenharmony_cisampler {YCbCr} conversion>> in the <<textures,Image Operations>> chapter. 827e5c31af7Sopenharmony_ci 828e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[] 829e5c31af7Sopenharmony_ci 830e5c31af7Sopenharmony_ci.Valid Usage 831e5c31af7Sopenharmony_ci**** 832e5c31af7Sopenharmony_ci * [[VUID-vkCreateSamplerYcbcrConversion-None-01648]] 833e5c31af7Sopenharmony_ci The <<features-samplerYcbcrConversion, pname:samplerYcbcrConversion>> 834e5c31af7Sopenharmony_ci feature must: be enabled 835e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[] 836e5c31af7Sopenharmony_ci**** 837e5c31af7Sopenharmony_ci 838e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateSamplerYcbcrConversion.adoc[] 839e5c31af7Sopenharmony_ci-- 840e5c31af7Sopenharmony_ci 841e5c31af7Sopenharmony_ci[open,refpage='VkSamplerYcbcrConversionCreateInfo',desc='Structure specifying the parameters of the newly created conversion',type='structs'] 842e5c31af7Sopenharmony_ci-- 843e5c31af7Sopenharmony_ciThe sname:VkSamplerYcbcrConversionCreateInfo structure is defined as: 844e5c31af7Sopenharmony_ci 845e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerYcbcrConversionCreateInfo.adoc[] 846e5c31af7Sopenharmony_ci 847e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[] 848e5c31af7Sopenharmony_cior the equivalent 849e5c31af7Sopenharmony_ci 850e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerYcbcrConversionCreateInfoKHR.adoc[] 851e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[] 852e5c31af7Sopenharmony_ci 853e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 854e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 855e5c31af7Sopenharmony_ci structure. 856e5c31af7Sopenharmony_ci * pname:format is the format of the image from which color information 857e5c31af7Sopenharmony_ci will be retrieved. 858e5c31af7Sopenharmony_ci * pname:ycbcrModel describes the color matrix for conversion between color 859e5c31af7Sopenharmony_ci models. 860e5c31af7Sopenharmony_ci * pname:ycbcrRange describes whether the encoded values have headroom and 861e5c31af7Sopenharmony_ci foot room, or whether the encoding uses the full numerical range. 862e5c31af7Sopenharmony_ci * pname:components applies a _swizzle_ based on elink:VkComponentSwizzle 863e5c31af7Sopenharmony_ci enums prior to range expansion and color model conversion. 864e5c31af7Sopenharmony_ci * pname:xChromaOffset describes the 865e5c31af7Sopenharmony_ci <<textures-chroma-reconstruction,sample location>> associated with 866e5c31af7Sopenharmony_ci downsampled chroma components in the x dimension. 867e5c31af7Sopenharmony_ci pname:xChromaOffset has no effect for formats in which chroma components 868e5c31af7Sopenharmony_ci are not downsampled horizontally. 869e5c31af7Sopenharmony_ci * pname:yChromaOffset describes the 870e5c31af7Sopenharmony_ci <<textures-chroma-reconstruction,sample location>> associated with 871e5c31af7Sopenharmony_ci downsampled chroma components in the y dimension. 872e5c31af7Sopenharmony_ci pname:yChromaOffset has no effect for formats in which the chroma 873e5c31af7Sopenharmony_ci components are not downsampled vertically. 874e5c31af7Sopenharmony_ci * pname:chromaFilter is the filter for chroma reconstruction. 875e5c31af7Sopenharmony_ci * pname:forceExplicitReconstruction can: be used to ensure that 876e5c31af7Sopenharmony_ci reconstruction is done explicitly, if supported. 877e5c31af7Sopenharmony_ci 878e5c31af7Sopenharmony_ci[NOTE] 879e5c31af7Sopenharmony_ci.Note 880e5c31af7Sopenharmony_ci==== 881e5c31af7Sopenharmony_ciSetting pname:forceExplicitReconstruction to ename:VK_TRUE may: have a 882e5c31af7Sopenharmony_ciperformance penalty on implementations where explicit reconstruction is not 883e5c31af7Sopenharmony_cithe default mode of operation. 884e5c31af7Sopenharmony_ci 885e5c31af7Sopenharmony_ciIf pname:format supports 886e5c31af7Sopenharmony_ciename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT 887e5c31af7Sopenharmony_cithe pname:forceExplicitReconstruction value behaves as if it was set to 888e5c31af7Sopenharmony_ciename:VK_TRUE. 889e5c31af7Sopenharmony_ci==== 890e5c31af7Sopenharmony_ci 891e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[] 892e5c31af7Sopenharmony_ciIf the pname:pNext chain includes a slink:VkExternalFormatANDROID structure 893e5c31af7Sopenharmony_ciwith non-zero pname:externalFormat member, the sampler {YCbCr} conversion 894e5c31af7Sopenharmony_ciobject represents an _external format conversion_, and pname:format must: be 895e5c31af7Sopenharmony_ciename:VK_FORMAT_UNDEFINED. 896e5c31af7Sopenharmony_ciSuch conversions must: only be used to sample image views with a matching 897e5c31af7Sopenharmony_ci<<memory-external-android-hardware-buffer-external-formats,external 898e5c31af7Sopenharmony_ciformat>>. 899e5c31af7Sopenharmony_ciWhen creating an external format conversion, the value of pname:components 900e5c31af7Sopenharmony_ciis ignored. 901e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[] 902e5c31af7Sopenharmony_ciifndef::VK_ANDROID_external_memory_android_hardware_buffer[] 903e5c31af7Sopenharmony_ciSampler {YCbCr} conversion objects do not support _external format 904e5c31af7Sopenharmony_ciconversion_ without additional extensions defining _external formats_. 905e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[] 906e5c31af7Sopenharmony_ci 907e5c31af7Sopenharmony_ci.Valid Usage 908e5c31af7Sopenharmony_ci**** 909e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[] 910e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-format-01904]] 911e5c31af7Sopenharmony_ci If an external format conversion is being created, pname:format must: be 912e5c31af7Sopenharmony_ci ename:VK_FORMAT_UNDEFINED 913e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[] 914e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-format-04061]] 915e5c31af7Sopenharmony_ciifdef::VK_ANDROID_external_memory_android_hardware_buffer[] 916e5c31af7Sopenharmony_ci If an external format conversion is not being created, 917e5c31af7Sopenharmony_ciendif::VK_ANDROID_external_memory_android_hardware_buffer[] 918e5c31af7Sopenharmony_ci pname:format must: represent unsigned normalized values (i.e. the format 919e5c31af7Sopenharmony_ci must: be a etext:UNORM format) 920e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-format-01650]] 921e5c31af7Sopenharmony_ci The <<potential-format-features, potential format features>> of the 922e5c31af7Sopenharmony_ci sampler {YCbCr} conversion must: support 923e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or 924e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT 925e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01651]] 926e5c31af7Sopenharmony_ci If the <<potential-format-features, potential format features>> of the 927e5c31af7Sopenharmony_ci sampler {YCbCr} conversion do not support 928e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, pname:xChromaOffset 929e5c31af7Sopenharmony_ci and pname:yChromaOffset must: not be 930e5c31af7Sopenharmony_ci ename:VK_CHROMA_LOCATION_COSITED_EVEN if the corresponding components 931e5c31af7Sopenharmony_ci are <<textures-chroma-reconstruction, downsampled>> 932e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-01652]] 933e5c31af7Sopenharmony_ci If the <<potential-format-features, potential format features>> of the 934e5c31af7Sopenharmony_ci sampler {YCbCr} conversion do not support 935e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, pname:xChromaOffset 936e5c31af7Sopenharmony_ci and pname:yChromaOffset must: not be ename:VK_CHROMA_LOCATION_MIDPOINT 937e5c31af7Sopenharmony_ci if the corresponding components are <<textures-chroma-reconstruction, 938e5c31af7Sopenharmony_ci downsampled>> 939e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-components-02581]] 940e5c31af7Sopenharmony_ci If the format has a etext:_422 or etext:_420 suffix, then 941e5c31af7Sopenharmony_ci pname:components.g must: be the 942e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>> 943e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-components-02582]] 944e5c31af7Sopenharmony_ci If the format has a etext:_422 or etext:_420 suffix, then 945e5c31af7Sopenharmony_ci pname:components.a must: be the 946e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>>, 947e5c31af7Sopenharmony_ci ename:VK_COMPONENT_SWIZZLE_ONE, or ename:VK_COMPONENT_SWIZZLE_ZERO 948e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-components-02583]] 949e5c31af7Sopenharmony_ci If the format has a etext:_422 or etext:_420 suffix, then 950e5c31af7Sopenharmony_ci pname:components.r must: be the 951e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>> or 952e5c31af7Sopenharmony_ci ename:VK_COMPONENT_SWIZZLE_B 953e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-components-02584]] 954e5c31af7Sopenharmony_ci If the format has a etext:_422 or etext:_420 suffix, then 955e5c31af7Sopenharmony_ci pname:components.b must: be the 956e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>> or 957e5c31af7Sopenharmony_ci ename:VK_COMPONENT_SWIZZLE_R 958e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-components-02585]] 959e5c31af7Sopenharmony_ci If the format has a etext:_422 or etext:_420 suffix, and if either 960e5c31af7Sopenharmony_ci pname:components.r or pname:components.b is the 961e5c31af7Sopenharmony_ci <<resources-image-views-identity-mappings,identity swizzle>>, both 962e5c31af7Sopenharmony_ci values must: be the identity swizzle 963e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-01655]] 964e5c31af7Sopenharmony_ci If pname:ycbcrModel is not 965e5c31af7Sopenharmony_ci ename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, then 966e5c31af7Sopenharmony_ci pname:components.r, pname:components.g, and pname:components.b must: 967e5c31af7Sopenharmony_ci correspond to components of the pname:format; that is, 968e5c31af7Sopenharmony_ci pname:components.r, pname:components.g, and pname:components.b must: not 969e5c31af7Sopenharmony_ci be ename:VK_COMPONENT_SWIZZLE_ZERO or ename:VK_COMPONENT_SWIZZLE_ONE, 970e5c31af7Sopenharmony_ci and must: not correspond to a component containing zero or one as a 971e5c31af7Sopenharmony_ci consequence of <<textures-conversion-to-rgba,conversion to RGBA>> 972e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrRange-02748]] 973e5c31af7Sopenharmony_ci If pname:ycbcrRange is ename:VK_SAMPLER_YCBCR_RANGE_ITU_NARROW then the 974e5c31af7Sopenharmony_ci R, G and B components obtained by applying the pname:component swizzle 975e5c31af7Sopenharmony_ci to pname:format must: each have a bit-depth greater than or equal to 8 976e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-forceExplicitReconstruction-01656]] 977e5c31af7Sopenharmony_ci If the <<potential-format-features, potential format features>> of the 978e5c31af7Sopenharmony_ci sampler {YCbCr} conversion do not support 979e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT 980e5c31af7Sopenharmony_ci pname:forceExplicitReconstruction must: be ename:VK_FALSE 981e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-01657]] 982e5c31af7Sopenharmony_ci If the <<potential-format-features, potential format features>> of the 983e5c31af7Sopenharmony_ci sampler {YCbCr} conversion do not support 984e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, 985e5c31af7Sopenharmony_ci pname:chromaFilter must: not be ename:VK_FILTER_LINEAR 986e5c31af7Sopenharmony_ciifdef::VK_QCOM_ycbcr_degamma[] 987e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-pNext-09207]] 988e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 989e5c31af7Sopenharmony_ci slink:VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM structure, and 990e5c31af7Sopenharmony_ci if the <<features-ycbcr-degamma,pname:ycbcrDegamma>> feature is not 991e5c31af7Sopenharmony_ci enabled, then 992e5c31af7Sopenharmony_ci slink:VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM::pname:enableYDegamma 993e5c31af7Sopenharmony_ci must: be ename:VK_FALSE 994e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-pNext-09208]] 995e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 996e5c31af7Sopenharmony_ci slink:VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM structure, and 997e5c31af7Sopenharmony_ci if the <<features-ycbcr-degamma,pname:ycbcrDegamma>> feature is not 998e5c31af7Sopenharmony_ci enabled, then 999e5c31af7Sopenharmony_ci slink:VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM::pname:enableCbCrDegamma 1000e5c31af7Sopenharmony_ci must: be ename:VK_FALSE 1001e5c31af7Sopenharmony_ci * [[VUID-VkSamplerYcbcrConversionCreateInfo-pNext-09209]] 1002e5c31af7Sopenharmony_ci If the pname:pNext chain includes a 1003e5c31af7Sopenharmony_ci slink:VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM structure, 1004e5c31af7Sopenharmony_ci pname:format must: be a format with 8-bit R, G, and B components. 1005e5c31af7Sopenharmony_ciendif::VK_QCOM_ycbcr_degamma[] 1006e5c31af7Sopenharmony_ci**** 1007e5c31af7Sopenharmony_ci 1008e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerYcbcrConversionCreateInfo.adoc[] 1009e5c31af7Sopenharmony_ci 1010e5c31af7Sopenharmony_ciIf pname:chromaFilter is ename:VK_FILTER_NEAREST, chroma samples are 1011e5c31af7Sopenharmony_cireconstructed to luma component resolution using nearest-neighbour sampling. 1012e5c31af7Sopenharmony_ciOtherwise, chroma samples are reconstructed using interpolation. 1013e5c31af7Sopenharmony_ciMore details can be found in <<textures-sampler-YCbCr-conversion,the 1014e5c31af7Sopenharmony_cidescription of sampler {YCbCr} conversion>> in the <<textures,Image 1015e5c31af7Sopenharmony_ciOperations>> chapter. 1016e5c31af7Sopenharmony_ci-- 1017e5c31af7Sopenharmony_ci 1018e5c31af7Sopenharmony_ci[open,refpage='VkSamplerYcbcrModelConversion',desc='Color model component of a color space',type='enums'] 1019e5c31af7Sopenharmony_ci-- 1020e5c31af7Sopenharmony_cielink:VkSamplerYcbcrModelConversion defines the conversion from the source 1021e5c31af7Sopenharmony_cicolor model to the shader color model. 1022e5c31af7Sopenharmony_ciPossible values are: 1023e5c31af7Sopenharmony_ci 1024e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerYcbcrModelConversion.adoc[] 1025e5c31af7Sopenharmony_ci 1026e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[] 1027e5c31af7Sopenharmony_cior the equivalent 1028e5c31af7Sopenharmony_ci 1029e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerYcbcrModelConversionKHR.adoc[] 1030e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[] 1031e5c31af7Sopenharmony_ci 1032e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY specifies that the 1033e5c31af7Sopenharmony_ci input values to the conversion are unmodified. 1034e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY specifies no 1035e5c31af7Sopenharmony_ci model conversion but the inputs are range expanded as for {YCbCr}. 1036e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 specifies the color 1037e5c31af7Sopenharmony_ci model conversion from {YCbCr} to {RGBprime} defined in BT.709 and 1038e5c31af7Sopenharmony_ci described in the "`BT.709 {YCbCr} conversion`" section of the 1039e5c31af7Sopenharmony_ci <<data-format,Khronos Data Format Specification>>. 1040e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 specifies the color 1041e5c31af7Sopenharmony_ci model conversion from {YCbCr} to {RGBprime} defined in BT.601 and 1042e5c31af7Sopenharmony_ci described in the "`BT.601 {YCbCr} conversion`" section of the 1043e5c31af7Sopenharmony_ci <<data-format,Khronos Data Format Specification>>. 1044e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 specifies the color 1045e5c31af7Sopenharmony_ci model conversion from {YCbCr} to {RGBprime} defined in BT.2020 and 1046e5c31af7Sopenharmony_ci described in the "`BT.2020 {YCbCr} conversion`" section of the 1047e5c31af7Sopenharmony_ci <<data-format,Khronos Data Format Specification>>. 1048e5c31af7Sopenharmony_ci 1049e5c31af7Sopenharmony_ciIn the etext:VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_* color models, for the 1050e5c31af7Sopenharmony_ciinput to the sampler {YCbCr} range expansion and model conversion: 1051e5c31af7Sopenharmony_ci 1052e5c31af7Sopenharmony_ci * the Y (Y{prime} luma) component corresponds to the G component of an RGB 1053e5c31af7Sopenharmony_ci image. 1054e5c31af7Sopenharmony_ci * the CB (C~B~ or "`U`" blue color difference) component corresponds to 1055e5c31af7Sopenharmony_ci the B component of an RGB image. 1056e5c31af7Sopenharmony_ci * the CR (C~R~ or "`V`" red color difference) component corresponds to the 1057e5c31af7Sopenharmony_ci R component of an RGB image. 1058e5c31af7Sopenharmony_ci * the alpha component, if present, is not modified by color model 1059e5c31af7Sopenharmony_ci conversion. 1060e5c31af7Sopenharmony_ci 1061e5c31af7Sopenharmony_ciThese rules reflect the mapping of components after the component swizzle 1062e5c31af7Sopenharmony_cioperation (controlled by 1063e5c31af7Sopenharmony_cislink:VkSamplerYcbcrConversionCreateInfo::pname:components). 1064e5c31af7Sopenharmony_ci 1065e5c31af7Sopenharmony_ci[NOTE] 1066e5c31af7Sopenharmony_ci.Note 1067e5c31af7Sopenharmony_ci==== 1068e5c31af7Sopenharmony_ciFor example, an "`YUVA`" 32-bit format comprising four 8-bit components can 1069e5c31af7Sopenharmony_cibe implemented as ename:VK_FORMAT_R8G8B8A8_UNORM with a component mapping: 1070e5c31af7Sopenharmony_ci 1071e5c31af7Sopenharmony_ci * pname:components.a = ename:VK_COMPONENT_SWIZZLE_IDENTITY 1072e5c31af7Sopenharmony_ci * pname:components.r = ename:VK_COMPONENT_SWIZZLE_B 1073e5c31af7Sopenharmony_ci * pname:components.g = ename:VK_COMPONENT_SWIZZLE_R 1074e5c31af7Sopenharmony_ci * pname:components.b = ename:VK_COMPONENT_SWIZZLE_G 1075e5c31af7Sopenharmony_ci==== 1076e5c31af7Sopenharmony_ci-- 1077e5c31af7Sopenharmony_ci 1078e5c31af7Sopenharmony_ci[open,refpage='VkSamplerYcbcrRange',desc='Range of encoded values in a color space',type='enums'] 1079e5c31af7Sopenharmony_ci-- 1080e5c31af7Sopenharmony_ciThe elink:VkSamplerYcbcrRange enum describes whether color components are 1081e5c31af7Sopenharmony_ciencoded using the full range of numerical values or whether values are 1082e5c31af7Sopenharmony_cireserved for headroom and foot room. 1083e5c31af7Sopenharmony_cielink:VkSamplerYcbcrRange is defined as: 1084e5c31af7Sopenharmony_ci 1085e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerYcbcrRange.adoc[] 1086e5c31af7Sopenharmony_ci 1087e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[] 1088e5c31af7Sopenharmony_cior the equivalent 1089e5c31af7Sopenharmony_ci 1090e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSamplerYcbcrRangeKHR.adoc[] 1091e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[] 1092e5c31af7Sopenharmony_ci 1093e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_YCBCR_RANGE_ITU_FULL specifies that the full range of 1094e5c31af7Sopenharmony_ci the encoded values are valid and interpreted according to the ITU "`full 1095e5c31af7Sopenharmony_ci range`" quantization rules. 1096e5c31af7Sopenharmony_ci * ename:VK_SAMPLER_YCBCR_RANGE_ITU_NARROW specifies that headroom and foot 1097e5c31af7Sopenharmony_ci room are reserved in the numerical range of encoded values, and the 1098e5c31af7Sopenharmony_ci remaining values are expanded according to the ITU "`narrow range`" 1099e5c31af7Sopenharmony_ci quantization rules. 1100e5c31af7Sopenharmony_ci 1101e5c31af7Sopenharmony_ciThe formulae for these conversions is described in the 1102e5c31af7Sopenharmony_ci<<textures-sampler-YCbCr-conversion-rangeexpand,Sampler {YCbCr} Range 1103e5c31af7Sopenharmony_ciExpansion>> section of the <<textures,Image Operations>> chapter. 1104e5c31af7Sopenharmony_ci 1105e5c31af7Sopenharmony_ciNo range modification takes place if pname:ycbcrModel is 1106e5c31af7Sopenharmony_ciename:VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY; the pname:ycbcrRange 1107e5c31af7Sopenharmony_cifield of slink:VkSamplerYcbcrConversionCreateInfo is ignored in this case. 1108e5c31af7Sopenharmony_ci-- 1109e5c31af7Sopenharmony_ci 1110e5c31af7Sopenharmony_ci[open,refpage='VkChromaLocation',desc='Position of downsampled chroma samples',type='enums'] 1111e5c31af7Sopenharmony_ci-- 1112e5c31af7Sopenharmony_ciThe elink:VkChromaLocation enum defines the location of downsampled chroma 1113e5c31af7Sopenharmony_cicomponent samples relative to the luma samples, and is defined as: 1114e5c31af7Sopenharmony_ci 1115e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkChromaLocation.adoc[] 1116e5c31af7Sopenharmony_ci 1117e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[] 1118e5c31af7Sopenharmony_cior the equivalent 1119e5c31af7Sopenharmony_ci 1120e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkChromaLocationKHR.adoc[] 1121e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[] 1122e5c31af7Sopenharmony_ci 1123e5c31af7Sopenharmony_ci * ename:VK_CHROMA_LOCATION_COSITED_EVEN specifies that downsampled chroma 1124e5c31af7Sopenharmony_ci samples are aligned with luma samples with even coordinates. 1125e5c31af7Sopenharmony_ci * ename:VK_CHROMA_LOCATION_MIDPOINT specifies that downsampled chroma 1126e5c31af7Sopenharmony_ci samples are located half way between each even luma sample and the 1127e5c31af7Sopenharmony_ci nearest higher odd luma sample. 1128e5c31af7Sopenharmony_ci-- 1129e5c31af7Sopenharmony_ci 1130e5c31af7Sopenharmony_ciifdef::VK_QCOM_ycbcr_degamma[] 1131e5c31af7Sopenharmony_ci[open,refpage='VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM',desc='Structure specifying {YCbCr} degamma parameters',type='structs'] 1132e5c31af7Sopenharmony_ci-- 1133e5c31af7Sopenharmony_ciApplications can: enable sRGB to linear conversion for the R, G, and B 1134e5c31af7Sopenharmony_cicomponents of a {YCbCr} image during <<textures-ycbcr-degamma, format 1135e5c31af7Sopenharmony_ciconversion>> by including 1136e5c31af7Sopenharmony_cisname:VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM structure in the 1137e5c31af7Sopenharmony_cipname:pNext chain of slink:VkSamplerYcbcrConversionCreateInfo. 1138e5c31af7Sopenharmony_ci 1139e5c31af7Sopenharmony_ciThe sname:VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM structure is 1140e5c31af7Sopenharmony_cidefined as: 1141e5c31af7Sopenharmony_ci 1142e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM.adoc[] 1143e5c31af7Sopenharmony_ci 1144e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1145e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1146e5c31af7Sopenharmony_ci structure. 1147e5c31af7Sopenharmony_ci * pname:enableYDegamma indicates <<textures-ycbcr-degamma,sRGB to linear>> 1148e5c31af7Sopenharmony_ci conversion is enabled for the G component. 1149e5c31af7Sopenharmony_ci * pname:enableCbCrDegamma indicates <<textures-ycbcr-degamma,sRGB to 1150e5c31af7Sopenharmony_ci linear>> conversion is enabled for the R and B components. 1151e5c31af7Sopenharmony_ci 1152e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM.adoc[] 1153e5c31af7Sopenharmony_ci-- 1154e5c31af7Sopenharmony_ciendif::VK_QCOM_ycbcr_degamma[] 1155e5c31af7Sopenharmony_ci 1156e5c31af7Sopenharmony_ci[open,refpage='vkDestroySamplerYcbcrConversion',desc='Destroy a created {YCbCr} conversion',type='protos'] 1157e5c31af7Sopenharmony_ci-- 1158e5c31af7Sopenharmony_ciTo destroy a sampler {YCbCr} conversion, call: 1159e5c31af7Sopenharmony_ci 1160e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[] 1161e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroySamplerYcbcrConversion.adoc[] 1162e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[] 1163e5c31af7Sopenharmony_ci 1164e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_sampler_ycbcr_conversion[or the equivalent command] 1165e5c31af7Sopenharmony_ci 1166e5c31af7Sopenharmony_ciifdef::VK_KHR_sampler_ycbcr_conversion[] 1167e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroySamplerYcbcrConversionKHR.adoc[] 1168e5c31af7Sopenharmony_ciendif::VK_KHR_sampler_ycbcr_conversion[] 1169e5c31af7Sopenharmony_ci 1170e5c31af7Sopenharmony_ci * pname:device is the logical device that destroys the {YCbCr} conversion. 1171e5c31af7Sopenharmony_ci * pname:ycbcrConversion is the conversion to destroy. 1172e5c31af7Sopenharmony_ci * pname:pAllocator controls host memory allocation as described in the 1173e5c31af7Sopenharmony_ci <<memory-allocation, Memory Allocation>> chapter. 1174e5c31af7Sopenharmony_ci 1175e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroySamplerYcbcrConversion.adoc[] 1176e5c31af7Sopenharmony_ci-- 1177e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] 1178e5c31af7Sopenharmony_ci 1179e5c31af7Sopenharmony_ciifdef::VK_EXT_custom_border_color[] 1180e5c31af7Sopenharmony_ci[open,refpage='VkSamplerCustomBorderColorCreateInfoEXT',desc='Structure specifying custom border color',type='structs'] 1181e5c31af7Sopenharmony_ci-- 1182e5c31af7Sopenharmony_ciIn addition to the predefined border color values, applications can: provide 1183e5c31af7Sopenharmony_cia custom border color value by including the 1184e5c31af7Sopenharmony_cisname:VkSamplerCustomBorderColorCreateInfoEXT structure in the 1185e5c31af7Sopenharmony_cislink:VkSamplerCreateInfo::pname:pNext chain. 1186e5c31af7Sopenharmony_ci 1187e5c31af7Sopenharmony_ciThe sname:VkSamplerCustomBorderColorCreateInfoEXT structure is defined as: 1188e5c31af7Sopenharmony_ci 1189e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerCustomBorderColorCreateInfoEXT.adoc[] 1190e5c31af7Sopenharmony_ci 1191e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1192e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1193e5c31af7Sopenharmony_ci structure. 1194e5c31af7Sopenharmony_ci * pname:customBorderColor is a slink:VkClearColorValue representing the 1195e5c31af7Sopenharmony_ci desired custom sampler border color. 1196e5c31af7Sopenharmony_ci * pname:format is a elink:VkFormat representing the format of the sampled 1197e5c31af7Sopenharmony_ci image view(s). 1198e5c31af7Sopenharmony_ci This field may be ename:VK_FORMAT_UNDEFINED if the 1199e5c31af7Sopenharmony_ci <<features-customBorderColorWithoutFormat, 1200e5c31af7Sopenharmony_ci pname:customBorderColorWithoutFormat>> feature is enabled. 1201e5c31af7Sopenharmony_ci 1202e5c31af7Sopenharmony_ci[NOTE] 1203e5c31af7Sopenharmony_ci.Note 1204e5c31af7Sopenharmony_ci==== 1205e5c31af7Sopenharmony_ciIf pname:format is a depth/stencil format, the aspect is determined by the 1206e5c31af7Sopenharmony_civalue of slink:VkSamplerCreateInfo::pname:borderColor. 1207e5c31af7Sopenharmony_ciIf slink:VkSamplerCreateInfo::pname:borderColor is 1208e5c31af7Sopenharmony_ciename:VK_BORDER_COLOR_FLOAT_CUSTOM_EXT, the depth aspect is considered. 1209e5c31af7Sopenharmony_ciIf slink:VkSamplerCreateInfo::pname:borderColor is 1210e5c31af7Sopenharmony_ciename:VK_BORDER_COLOR_INT_CUSTOM_EXT, the stencil aspect is considered. 1211e5c31af7Sopenharmony_ci 1212e5c31af7Sopenharmony_ciIf pname:format is ename:VK_FORMAT_UNDEFINED, the 1213e5c31af7Sopenharmony_cislink:VkSamplerCreateInfo::pname:borderColor is 1214e5c31af7Sopenharmony_ciename:VK_BORDER_COLOR_INT_CUSTOM_EXT, and the sampler is used with an image 1215e5c31af7Sopenharmony_ciwith a stencil format, then the implementation must: source the custom 1216e5c31af7Sopenharmony_ciborder color from either the first or second components of 1217e5c31af7Sopenharmony_cislink:VkSamplerCreateInfo::pname:customBorderColor and should: source it 1218e5c31af7Sopenharmony_cifrom the first component. 1219e5c31af7Sopenharmony_ci==== 1220e5c31af7Sopenharmony_ci 1221e5c31af7Sopenharmony_ci.Valid Usage 1222e5c31af7Sopenharmony_ci**** 1223e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCustomBorderColorCreateInfoEXT-format-07605]] 1224e5c31af7Sopenharmony_ci If pname:format is not ename:VK_FORMAT_UNDEFINED and pname:format is not 1225e5c31af7Sopenharmony_ci a depth/stencil format then the 1226e5c31af7Sopenharmony_ci slink:VkSamplerCreateInfo::pname:borderColor type must: match the 1227e5c31af7Sopenharmony_ci sampled type of the provided pname:format, as shown in the _SPIR-V Type_ 1228e5c31af7Sopenharmony_ci column of the <<formats-numericformat>> table 1229e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCustomBorderColorCreateInfoEXT-format-04014]] 1230e5c31af7Sopenharmony_ci If the <<features-customBorderColorWithoutFormat, 1231e5c31af7Sopenharmony_ci pname:customBorderColorWithoutFormat>> feature is not enabled then 1232e5c31af7Sopenharmony_ci pname:format must: not be ename:VK_FORMAT_UNDEFINED 1233e5c31af7Sopenharmony_ci * [[VUID-VkSamplerCustomBorderColorCreateInfoEXT-format-04015]] 1234e5c31af7Sopenharmony_ci If the sampler is used to sample an image view of 1235e5c31af7Sopenharmony_ci ename:VK_FORMAT_B4G4R4A4_UNORM_PACK16, 1236e5c31af7Sopenharmony_ci ename:VK_FORMAT_B5G6R5_UNORM_PACK16, 1237e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance5[] 1238e5c31af7Sopenharmony_ci ename:VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR, 1239e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance5[] 1240e5c31af7Sopenharmony_ci or ename:VK_FORMAT_B5G5R5A1_UNORM_PACK16 format then pname:format must: 1241e5c31af7Sopenharmony_ci not be ename:VK_FORMAT_UNDEFINED 1242e5c31af7Sopenharmony_ci**** 1243e5c31af7Sopenharmony_ci 1244e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerCustomBorderColorCreateInfoEXT.adoc[] 1245e5c31af7Sopenharmony_ci-- 1246e5c31af7Sopenharmony_ciendif::VK_EXT_custom_border_color[] 1247e5c31af7Sopenharmony_ci 1248e5c31af7Sopenharmony_ciifdef::VK_EXT_border_color_swizzle[] 1249e5c31af7Sopenharmony_ci[open,refpage='VkSamplerBorderColorComponentMappingCreateInfoEXT',desc='Structure specifying the component mapping of the border color',type='structs'] 1250e5c31af7Sopenharmony_ci-- 1251e5c31af7Sopenharmony_ciIf the sampler is created with ename:VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK, 1252e5c31af7Sopenharmony_ciename:VK_BORDER_COLOR_INT_OPAQUE_BLACK, 1253e5c31af7Sopenharmony_ciename:VK_BORDER_COLOR_FLOAT_CUSTOM_EXT, or 1254e5c31af7Sopenharmony_ciename:VK_BORDER_COLOR_INT_CUSTOM_EXT pname:borderColor, and that sampler 1255e5c31af7Sopenharmony_ciwill be combined with an image view that does not have an 1256e5c31af7Sopenharmony_ci<<resources-image-views-identity-mappings,identity swizzle>>, and 1257e5c31af7Sopenharmony_cislink:VkPhysicalDeviceBorderColorSwizzleFeaturesEXT::pname:borderColorSwizzleFromImage 1258e5c31af7Sopenharmony_ciis not enabled, then it is necessary to specify the component mapping of the 1259e5c31af7Sopenharmony_ciborder color, by including the 1260e5c31af7Sopenharmony_cisname:VkSamplerBorderColorComponentMappingCreateInfoEXT structure in the 1261e5c31af7Sopenharmony_cislink:VkSamplerCreateInfo::pname:pNext chain, to get defined results. 1262e5c31af7Sopenharmony_ci 1263e5c31af7Sopenharmony_ciThe sname:VkSamplerBorderColorComponentMappingCreateInfoEXT structure is 1264e5c31af7Sopenharmony_cidefined as: 1265e5c31af7Sopenharmony_ci 1266e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerBorderColorComponentMappingCreateInfoEXT.adoc[] 1267e5c31af7Sopenharmony_ci 1268e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1269e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1270e5c31af7Sopenharmony_ci structure. 1271e5c31af7Sopenharmony_ci * pname:components is a slink:VkComponentMapping structure specifying a 1272e5c31af7Sopenharmony_ci remapping of the border color components. 1273e5c31af7Sopenharmony_ci * pname:srgb indicates that the sampler will be combined with an image 1274e5c31af7Sopenharmony_ci view that has an image format which is sRGB encoded. 1275e5c31af7Sopenharmony_ci 1276e5c31af7Sopenharmony_ciThe slink:VkComponentMapping pname:components member describes a remapping 1277e5c31af7Sopenharmony_cifrom components of the border color to components of the vector returned by 1278e5c31af7Sopenharmony_cishader image instructions when the border color is used. 1279e5c31af7Sopenharmony_ci 1280e5c31af7Sopenharmony_ci.Valid Usage 1281e5c31af7Sopenharmony_ci**** 1282e5c31af7Sopenharmony_ci * [[VUID-VkSamplerBorderColorComponentMappingCreateInfoEXT-borderColorSwizzle-06437]] 1283e5c31af7Sopenharmony_ci The <<features-borderColorSwizzle, pname:borderColorSwizzle>> feature 1284e5c31af7Sopenharmony_ci must: be enabled 1285e5c31af7Sopenharmony_ci**** 1286e5c31af7Sopenharmony_ci 1287e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerBorderColorComponentMappingCreateInfoEXT.adoc[] 1288e5c31af7Sopenharmony_ci-- 1289e5c31af7Sopenharmony_ciendif::VK_EXT_border_color_swizzle[] 1290e5c31af7Sopenharmony_ci 1291e5c31af7Sopenharmony_ciifdef::VK_QCOM_image_processing2[] 1292e5c31af7Sopenharmony_ci[open,refpage='VkSamplerBlockMatchWindowCreateInfoQCOM',desc='Structure specifying the block match window parameters',type='structs'] 1293e5c31af7Sopenharmony_ci-- 1294e5c31af7Sopenharmony_ci 1295e5c31af7Sopenharmony_ciThe sname:VkSamplerBlockMatchWindowCreateInfoQCOM structure is defined as: 1296e5c31af7Sopenharmony_ci 1297e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSamplerBlockMatchWindowCreateInfoQCOM.adoc[] 1298e5c31af7Sopenharmony_ci 1299e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 1300e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1301e5c31af7Sopenharmony_ci structure. 1302e5c31af7Sopenharmony_ci * pname:windowExtent is a slink:VkExtent2D specifying a the width and 1303e5c31af7Sopenharmony_ci height of the block match window. 1304e5c31af7Sopenharmony_ci * pname:windowCompareMode is a elink:VkBlockMatchWindowCompareModeQCOM 1305e5c31af7Sopenharmony_ci specifying the compare mode. 1306e5c31af7Sopenharmony_ci 1307e5c31af7Sopenharmony_ci.Valid Usage 1308e5c31af7Sopenharmony_ci**** 1309e5c31af7Sopenharmony_ci * [[VUID-VkSamplerBlockMatchWindowCreateInfoQCOM-WindowExtent-09210]] 1310e5c31af7Sopenharmony_ci pname:WindowExtent must: not be larger than 1311e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceImageProcessing2PropertiesQCOM::pname:maxBlockMatchWindow. 1312e5c31af7Sopenharmony_ci**** 1313e5c31af7Sopenharmony_ci 1314e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSamplerBlockMatchWindowCreateInfoQCOM.adoc[] 1315e5c31af7Sopenharmony_ci-- 1316e5c31af7Sopenharmony_ci 1317e5c31af7Sopenharmony_ci[open,refpage='VkBlockMatchWindowCompareModeQCOM',desc='Block match window compare modes',type='enums'] 1318e5c31af7Sopenharmony_ci-- 1319e5c31af7Sopenharmony_ciThe elink:VkBlockMatchWindowCompareModeQCOM enum describes how block match 1320e5c31af7Sopenharmony_civalues within the window are compared. 1321e5c31af7Sopenharmony_cielink:VkBlockMatchWindowCompareModeQCOM is defined as: 1322e5c31af7Sopenharmony_ci 1323e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkBlockMatchWindowCompareModeQCOM.adoc[] 1324e5c31af7Sopenharmony_ci 1325e5c31af7Sopenharmony_ci * ename:VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM specifies that 1326e5c31af7Sopenharmony_ci windowed block match operations return the minimum error within the 1327e5c31af7Sopenharmony_ci window. 1328e5c31af7Sopenharmony_ci * ename:VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM specifies that 1329e5c31af7Sopenharmony_ci windowed block match operations return the maximum error within the 1330e5c31af7Sopenharmony_ci window. 1331e5c31af7Sopenharmony_ci-- 1332e5c31af7Sopenharmony_ciendif::VK_QCOM_image_processing2[] 1333e5c31af7Sopenharmony_ci 1334