C Specification
The VkSamplerCreateInfo structure is defined as:
typedef struct VkSamplerCreateInfo {
VkStructureType sType;
const void* pNext;
VkSamplerCreateFlags flags;
VkFilter magFilter;
VkFilter minFilter;
VkSamplerMipmapMode mipmapMode;
VkSamplerAddressMode addressModeU;
VkSamplerAddressMode addressModeV;
VkSamplerAddressMode addressModeW;
float mipLodBias;
VkBool32 anisotropyEnable;
float maxAnisotropy;
VkBool32 compareEnable;
VkCompareOp compareOp;
float minLod;
float maxLod;
VkBorderColor borderColor;
VkBool32 unnormalizedCoordinates;
} VkSamplerCreateInfo;
Members
-
sTypeis the type of this structure. -
pNextisNULLor a pointer to an extension-specific structure. -
flagsis a bitmask of VkSamplerCreateFlagBits describing additional parameters of the sampler. -
magFilteris a VkFilter value specifying the magnification filter to apply to lookups. -
minFilteris a VkFilter value specifying the minification filter to apply to lookups. -
mipmapModeis a VkSamplerMipmapMode value specifying the mipmap filter to apply to lookups. -
addressModeUis a VkSamplerAddressMode value specifying the addressing mode for outside [0..1] range for U coordinate. -
addressModeVis a VkSamplerAddressMode value specifying the addressing mode for outside [0..1] range for V coordinate. -
addressModeWis a VkSamplerAddressMode value specifying the addressing mode for outside [0..1] range for W coordinate. -
mipLodBiasis the bias to be added to mipmap LOD (level-of-detail) calculation and bias provided by image sampling functions in SPIR-V, as described in the Level-of-Detail Operation section. -
anisotropyEnableisVK_TRUEto enable anisotropic filtering, as described in the Texel Anisotropic Filtering section, orVK_FALSEotherwise. -
maxAnisotropyis the anisotropy value clamp used by the sampler whenanisotropyEnableisVK_TRUE. IfanisotropyEnableisVK_FALSE,maxAnisotropyis ignored. -
compareEnableisVK_TRUEto enable comparison against a reference value during lookups, orVK_FALSEotherwise.-
Note: Some implementations will default to shader state if this member does not match.
-
-
compareOpis a VkCompareOp value specifying the comparison function to apply to fetched data before filtering as described in the Depth Compare Operation section. -
minLodandmaxLodare the values used to clamp the computed LOD value, as described in the Level-of-Detail Operation section. -
borderColoris a VkBorderColor value specifying the predefined border color to use. -
unnormalizedCoordinatescontrols whether to use unnormalized or normalized texel coordinates to address texels of the image. When set toVK_TRUE, the range of the image coordinates used to lookup the texel is in the range of zero to the image dimensions for x, y and z. When set toVK_FALSEthe range of image coordinates is zero to one.When
unnormalizedCoordinatesisVK_TRUE, images the sampler is used with in the shader have the following requirements:-
The
viewTypemust be eitherVK_IMAGE_VIEW_TYPE_1DorVK_IMAGE_VIEW_TYPE_2D. -
The image view must have a single layer and a single mip level.
When
unnormalizedCoordinatesisVK_TRUE, image built-in functions in the shader that use the sampler have the following requirements:-
The functions must not use projection.
-
The functions must not use offsets.
-
Description
|
Mapping of OpenGL to Vulkan filter modes
There are no Vulkan filter modes that directly correspond to OpenGL
minification filters of Note that using a |
The maximum number of sampler objects which can be simultaneously created
on a device is implementation-dependent and specified by the
maxSamplerAllocationCount member of the
VkPhysicalDeviceLimits structure.
If maxSamplerAllocationCount is exceeded, vkCreateSampler will
return VK_ERROR_TOO_MANY_OBJECTS.
Since VkSampler is a non-dispatchable handle type, implementations
may return the same handle for sampler state vectors that are identical.
In such cases, all such objects would only count once against the
maxSamplerAllocationCount limit.
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.