magFilter values of FILTER_NEAREST and FILTER_LINEAR directly correspond to GL_NEAREST and GL_LINEAR magnification filters. minFilter and mipmapMode combine to correspond to the similarly named OpenGL minification filter of GL_minFilter_MIPMAP_mipmapMode (e.g. minFilter of FILTER_LINEAR and mipmapMode of SAMPLER_MIPMAP_MODE_NEAREST correspond to GL_LINEAR_MIPMAP_NEAREST).
There are no Vulkan filter modes that directly correspond to OpenGL minification filters of GL_LINEAR or GL_NEAREST, but they can be emulated using SAMPLER_MIPMAP_MODE_NEAREST, minLod = 0, and maxLod = 0.25, and using minFilter = FILTER_LINEAR or minFilter = FILTER_NEAREST, respectively.
Note that using a maxLod of zero would cause magnification to always be performed, and the magFilter to always be used. This is valid, just not an exact match for OpenGL behavior. Clamping the maximum LOD to 0.25 allows the λ value to be non-zero and minification to be performed, while still always rounding down to the base level. If the minFilter and magFilter are equal, then using a maxLod of zero also works.
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.
For historical reasons, if maxSamplerAllocationCount is exceeded, some implementations may return ERROR_TOO_MANY_OBJECTS. Exceeding this limit will result in undefined behavior, and an application should not rely on the use of the returned error code in order to identify when the limit is reached.
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.
mipLodBias must be less than or equal to VkPhysicalDeviceLimits::maxSamplerLodBiasVK_KHR_portability_subset extension is enabled, and VkPhysicalDevicePortabilitySubsetFeaturesKHR::samplerMipLodBias is FALSE, mipLodBias must be zeromaxLod must be greater than or equal to minLodsamplerAnisotropy feature is not enabled, anisotropyEnable must be FALSEanisotropyEnable is TRUE, maxAnisotropy must be between 1.0 and VkPhysicalDeviceLimits::maxSamplerAnisotropy, inclusiveFORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, minFilter and magFilter must be equal to the sampler Y′CBCR conversion’s chromaFilterunnormalizedCoordinates is TRUE, minFilter and magFilter must be equalunnormalizedCoordinates is TRUE, mipmapMode must be SAMPLER_MIPMAP_MODE_NEARESTunnormalizedCoordinates is TRUE, minLod and maxLod must be zerounnormalizedCoordinates is TRUE, addressModeU and addressModeV must each be either SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDERunnormalizedCoordinates is TRUE, anisotropyEnable must be FALSEunnormalizedCoordinates is TRUE, compareEnable must be FALSEaddressModeU, addressModeV or addressModeW are SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, borderColor must be a valid VkBorderColor valueaddressModeU, addressModeV, and addressModeW must be SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, anisotropyEnable must be FALSE, and unnormalizedCoordinates must be FALSEpNext chain includes a VkSamplerReductionModeCreateInfo structure, then the sampler reduction mode must be set to SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGEsamplerFilterMinmax is not enabled and the pNext chain includes a VkSamplerReductionModeCreateInfo structure, then the sampler reduction mode must be set to SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGEsamplerMirrorClampToEdge is not enabled, and if the VK_KHR_sampler_mirror_clamp_to_edge extension is not enabled, addressModeU, addressModeV and addressModeW must not be SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGEcompareEnable is TRUE, compareOp must be a valid VkCompareOp valuemagFilter or minFilter is FILTER_CUBIC_EXT, anisotropyEnable must be FALSEVK_EXT_filter_cubic extension is not enabled and either magFilter or minFilter is FILTER_CUBIC_EXT, the reductionMode member of VkSamplerReductionModeCreateInfo must be SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGEcompareEnable is TRUE, the reductionMode member of VkSamplerReductionModeCreateInfo must be SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGEflags includes SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then minFilter and magFilter must be equalflags includes SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then mipmapMode must be SAMPLER_MIPMAP_MODE_NEARESTflags includes SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then minLod and maxLod must be zeroflags includes SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then addressModeU and addressModeV must each be either SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDERflags includes SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then anisotropyEnable must be FALSEflags includes SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then compareEnable must be FALSEflags includes SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, then unnormalizedCoordinates must be FALSEnonSeamlessCubeMap feature is not enabled, flags must not include SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXTborderColor is one of BORDER_COLOR_FLOAT_CUSTOM_EXT or BORDER_COLOR_INT_CUSTOM_EXT, then a VkSamplerCustomBorderColorCreateInfoEXT must be included in the pNext chaincustomBorderColors feature is not enabled, borderColor must not be BORDER_COLOR_FLOAT_CUSTOM_EXT or BORDER_COLOR_INT_CUSTOM_EXTborderColor is one of BORDER_COLOR_FLOAT_CUSTOM_EXT or BORDER_COLOR_INT_CUSTOM_EXT, and VkSamplerCustomBorderColorCreateInfoEXT::format is not FORMAT_UNDEFINED, VkSamplerCustomBorderColorCreateInfoEXT::customBorderColor must be within the range of values representable in formatmaxCustomBorderColorSamplers member of the VkPhysicalDeviceCustomBorderColorPropertiesEXT structureflags includes SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT, the descriptorBufferCaptureReplay feature must be enabledpNext chain includes a VkOpaqueCaptureDescriptorDataCreateInfoEXT structure, flags must contain SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXTflags includes SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then minFilter and magFilter must be FILTER_NEARESTflags includes SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then mipmapMode must be SAMPLER_MIPMAP_MODE_NEARESTflags includes SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then minLod and maxLod must be zeroflags includes SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then addressModeU and addressModeV must each be either SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE or SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDERflags includes SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, and if addressModeU or addressModeV is SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, then borderColor must be BORDER_COLOR_FLOAT_TRANSPARENT_BLACKflags includes SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then anisotropyEnable must be FALSEflags includes SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM, then compareEnable must be FALSEsType must be STRUCTURE_TYPE_SAMPLER_CREATE_INFOpNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkOpaqueCaptureDescriptorDataCreateInfoEXT, VkSamplerBlockMatchWindowCreateInfoQCOM, VkSamplerBorderColorComponentMappingCreateInfoEXT, VkSamplerCubicWeightsCreateInfoQCOM, VkSamplerCustomBorderColorCreateInfoEXT, VkSamplerReductionModeCreateInfo, or VkSamplerYcbcrConversionInfosType value of each struct in the pNext chain must be uniqueflags must be a valid combination of VkSamplerCreateFlagBits valuesmagFilter must be a valid VkFilter valueminFilter must be a valid VkFilter valuemipmapMode must be a valid VkSamplerMipmapMode valueaddressModeU must be a valid VkSamplerAddressMode valueaddressModeV must be a valid VkSamplerAddressMode valueaddressModeW must be a valid VkSamplerAddressMode value
struct VkSamplerCreateInfo {
VkStructureType sType;
void const * 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;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | VkSamplerCreateInfo.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ADDRESSMODEU
The struct member offsets. |
| public static final int | ADDRESSMODEV
The struct member offsets. |
| public static final int | ADDRESSMODEW
The struct member offsets. |
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | ANISOTROPYENABLE
The struct member offsets. |
| public static final int | BORDERCOLOR
The struct member offsets. |
| public static final int | COMPAREENABLE
The struct member offsets. |
| public static final int | COMPAREOP
The struct member offsets. |
| public static final int | FLAGS
The struct member offsets. |
| public static final int | MAGFILTER
The struct member offsets. |
| public static final int | MAXANISOTROPY
The struct member offsets. |
| public static final int | MAXLOD
The struct member offsets. |
| public static final int | MINFILTER
The struct member offsets. |
| public static final int | MINLOD
The struct member offsets. |
| public static final int | MIPLODBIAS
The struct member offsets. |
| public static final int | MIPMAPMODE
The struct member offsets. |
| public static final int | PNEXT
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | STYPE
The struct member offsets. |
| public static final int | UNNORMALIZEDCOORDINATES
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | VkSamplerCreateInfo(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public int | addressModeU()
a |
| public VkSamplerCreateInfo | |
| public int | addressModeV()
a |
| public VkSamplerCreateInfo | |
| public int | addressModeW()
a |
| public VkSamplerCreateInfo | |
| public boolean | anisotropyEnable()
|
| public VkSamplerCreateInfo | |
| public int | |
| public VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo. | calloc(int
the buffer capacity capacity)Returns a new |
| public static VkSamplerCreateInfo | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkSamplerCreateInfo. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo. | |
| public static VkSamplerCreateInfo. | |
| public boolean | compareEnable()
|
| public VkSamplerCreateInfo | |
| public int | compareOp()
a |
| public VkSamplerCreateInfo | |
| protected VkSamplerCreateInfo | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo. | create(int
the buffer capacity capacity)Returns a new |
| public static VkSamplerCreateInfo. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo. | |
| public int | |
| public VkSamplerCreateInfo | |
| public int | |
| public VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo. | malloc(int
the buffer capacity capacity)Returns a new |
| public static VkSamplerCreateInfo | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkSamplerCreateInfo. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo | |
| public static VkSamplerCreateInfo. | |
| public static VkSamplerCreateInfo. | |
| public float | |
| public VkSamplerCreateInfo | |
| public float | |
| public VkSamplerCreateInfo | |
| public int | |
| public VkSamplerCreateInfo | |
| public float | |
| public VkSamplerCreateInfo | |
| public float | mipLodBias()
the bias to be added to mipmap LOD calculation and bias provided by image sampling functions in SPIR-V, as described in the LOD Operation section. |
| public VkSamplerCreateInfo | |
| public int | |
| public VkSamplerCreateInfo | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static float | |
| public static void | |
| public static float | |
| public static void | |
| public static int | |
| public static void | |
| public static float | |
| public static void | |
| public static float | |
| public static void | |
| public static int | |
| public static void | |
| public static long | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public long | |
| public VkSamplerCreateInfo | |
| public VkSamplerCreateInfo | pNext(VkOpaqueCaptureDescriptorDataCreateInfoEXT value)
Prepends the specified |
| public VkSamplerCreateInfo | pNext(VkSamplerBlockMatchWindowCreateInfoQCOM value)
Prepends the specified |
| public VkSamplerCreateInfo | pNext(VkSamplerBorderColorComponentMappingCreateInfoEXT value)
Prepends the specified |
| public VkSamplerCreateInfo | pNext(VkSamplerCubicWeightsCreateInfoQCOM value)
Prepends the specified |
| public VkSamplerCreateInfo | pNext(VkSamplerCustomBorderColorCreateInfoEXT value)
Prepends the specified |
| public VkSamplerCreateInfo | pNext(VkSamplerReductionModeCreateInfo value)
Prepends the specified |
| public VkSamplerCreateInfo | pNext(VkSamplerReductionModeCreateInfoEXT value)
Prepends the specified |
| public VkSamplerCreateInfo | pNext(VkSamplerYcbcrConversionInfo value)
Prepends the specified |
| public VkSamplerCreateInfo | pNext(VkSamplerYcbcrConversionInfoKHR value)
Prepends the specified |
| public VkSamplerCreateInfo | set(int sType, long pNext, int flags, int magFilter, int minFilter, int mipmapMode, int addressModeU, int addressModeV, int addressModeW, float mipLodBias, boolean anisotropyEnable, float maxAnisotropy, boolean compareEnable, int compareOp, float minLod, float maxLod, int borderColor, boolean unnormalizedCoordinates)
Initializes this struct with the specified values. |
| public VkSamplerCreateInfo | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public int | |
| public VkSamplerCreateInfo | |
| public VkSamplerCreateInfo | |
| public boolean | unnormalizedCoordinates()
controls whether to use unnormalized or normalized texel coordinates to address texels of the image. |
| public VkSamplerCreateInfo | unnormalizedCoordinates(boolean value)
Sets the specified value to the |