Top Description Inners Fields Constructors Methods
org.lwjgl.vulkan

public Class VkSamplerCreateInfo

extends Struct<VkSamplerCreateInfo>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Structure specifying parameters of a newly created sampler.
Description
Mapping of OpenGL to Vulkan filter modes

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.

Note

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.

Valid Usage
Valid Usage (Implicit)
See Also

CreateSampler

Layout


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;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField 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.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
VkSamplerCreateInfo(long address, ByteBuffer container)

public
VkSamplerCreateInfo(ByteBuffer container)

Creates a VkSamplerCreateInfo instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public int
addressModeU()

a VkSamplerAddressMode value specifying the addressing mode for U coordinates outside [0,1).

public VkSamplerCreateInfo
addressModeU(int value)

Sets the specified value to the addressModeU field.

public int
addressModeV()

a VkSamplerAddressMode value specifying the addressing mode for V coordinates outside [0,1).

public VkSamplerCreateInfo
addressModeV(int value)

Sets the specified value to the addressModeV field.

public int
addressModeW()

a VkSamplerAddressMode value specifying the addressing mode for W coordinates outside [0,1).

public VkSamplerCreateInfo
addressModeW(int value)

Sets the specified value to the addressModeW field.

public boolean
anisotropyEnable()

TRUE to enable anisotropic filtering, as described in the Texel Anisotropic Filtering section, or FALSE otherwise.

public VkSamplerCreateInfo
anisotropyEnable(boolean value)

Sets the specified value to the anisotropyEnable field.

public int
borderColor()

a VkBorderColor value specifying the predefined border color to use.

public VkSamplerCreateInfo
borderColor(int value)

Sets the specified value to the borderColor field.

public static VkSamplerCreateInfo
calloc()

Returns a new VkSamplerCreateInfo instance allocated with memCalloc.

public static VkSamplerCreateInfo.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new VkSamplerCreateInfo.Buffer instance allocated with memCalloc.

public static VkSamplerCreateInfo
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VkSamplerCreateInfo instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VkSamplerCreateInfo.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VkSamplerCreateInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VkSamplerCreateInfo
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VkSamplerCreateInfo
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VkSamplerCreateInfo.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VkSamplerCreateInfo.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public boolean
compareEnable()

TRUE to enable comparison against a reference value during lookups, or FALSE otherwise.

public VkSamplerCreateInfo
compareEnable(boolean value)

Sets the specified value to the compareEnable field.

public int
compareOp()

a VkCompareOp value specifying the comparison operator to apply to fetched data before filtering as described in the Depth Compare Operation section.

public VkSamplerCreateInfo
compareOp(int value)

Sets the specified value to the compareOp field.

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.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static VkSamplerCreateInfo
create()

Returns a new VkSamplerCreateInfo instance allocated with BufferUtils.

public static VkSamplerCreateInfo
create(long address)

Returns a new VkSamplerCreateInfo instance for the specified memory address.

public static VkSamplerCreateInfo.Buffer
create(int
the buffer capacity
capacity
)

Returns a new VkSamplerCreateInfo.Buffer instance allocated with BufferUtils.

public static VkSamplerCreateInfo.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a VkSamplerCreateInfo.Buffer instance at the specified memory.

public static VkSamplerCreateInfo
createSafe(long address)

Like create, but returns null if address is NULL.

public static VkSamplerCreateInfo.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public int
flags()

a bitmask of VkSamplerCreateFlagBits describing additional parameters of the sampler.

public VkSamplerCreateInfo
flags(int value)

Sets the specified value to the flags field.

public int
magFilter()

a VkFilter value specifying the magnification filter to apply to lookups.

public VkSamplerCreateInfo
magFilter(int value)

Sets the specified value to the magFilter field.

public static VkSamplerCreateInfo
malloc()

Returns a new VkSamplerCreateInfo instance allocated with memAlloc.

public static VkSamplerCreateInfo.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new VkSamplerCreateInfo.Buffer instance allocated with memAlloc.

public static VkSamplerCreateInfo
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VkSamplerCreateInfo instance allocated on the specified MemoryStack.

public static VkSamplerCreateInfo.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VkSamplerCreateInfo.Buffer instance allocated on the specified MemoryStack.

public static VkSamplerCreateInfo
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VkSamplerCreateInfo
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VkSamplerCreateInfo.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VkSamplerCreateInfo.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public float
maxAnisotropy()

the anisotropy value clamp used by the sampler when anisotropyEnable is TRUE.

public VkSamplerCreateInfo
maxAnisotropy(float value)

Sets the specified value to the maxAnisotropy field.

public float
public VkSamplerCreateInfo
maxLod(float value)

Sets the specified value to the maxLod field.

public int
minFilter()

a VkFilter value specifying the minification filter to apply to lookups.

public VkSamplerCreateInfo
minFilter(int value)

Sets the specified value to the minFilter field.

public float
public VkSamplerCreateInfo
minLod(float value)

Sets the specified value to the minLod field.

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
mipLodBias(float value)

Sets the specified value to the mipLodBias field.

public int
mipmapMode()

a VkSamplerMipmapMode value specifying the mipmap filter to apply to lookups.

public VkSamplerCreateInfo
mipmapMode(int value)

Sets the specified value to the mipmapMode field.

public static int
naddressModeU(long struct)

Unsafe version of addressModeU.

public static void
naddressModeU(long struct, int value)

Unsafe version of addressModeU.

public static int
naddressModeV(long struct)

Unsafe version of addressModeV.

public static void
naddressModeV(long struct, int value)

Unsafe version of addressModeV.

public static int
naddressModeW(long struct)

Unsafe version of addressModeW.

public static void
naddressModeW(long struct, int value)

Unsafe version of addressModeW.

public static int
nanisotropyEnable(long struct)

Unsafe version of anisotropyEnable.

public static void
nanisotropyEnable(long struct, int value)

Unsafe version of anisotropyEnable.

public static int
nborderColor(long struct)

Unsafe version of borderColor.

public static void
nborderColor(long struct, int value)

Unsafe version of borderColor.

public static int
ncompareEnable(long struct)

Unsafe version of compareEnable.

public static void
ncompareEnable(long struct, int value)

Unsafe version of compareEnable.

public static int
ncompareOp(long struct)

Unsafe version of compareOp.

public static void
ncompareOp(long struct, int value)

Unsafe version of compareOp.

public static int
nflags(long struct)

Unsafe version of flags.

public static void
nflags(long struct, int value)

Unsafe version of flags.

public static int
nmagFilter(long struct)

Unsafe version of magFilter.

public static void
nmagFilter(long struct, int value)

Unsafe version of magFilter.

public static float
nmaxAnisotropy(long struct)

Unsafe version of maxAnisotropy.

public static void
nmaxAnisotropy(long struct, float value)

Unsafe version of maxAnisotropy.

public static float
nmaxLod(long struct)

Unsafe version of maxLod.

public static void
nmaxLod(long struct, float value)

Unsafe version of maxLod.

public static int
nminFilter(long struct)

Unsafe version of minFilter.

public static void
nminFilter(long struct, int value)

Unsafe version of minFilter.

public static float
nminLod(long struct)

Unsafe version of minLod.

public static void
nminLod(long struct, float value)

Unsafe version of minLod.

public static float
nmipLodBias(long struct)

Unsafe version of mipLodBias.

public static void
nmipLodBias(long struct, float value)

Unsafe version of mipLodBias.

public static int
nmipmapMode(long struct)

Unsafe version of mipmapMode.

public static void
nmipmapMode(long struct, int value)

Unsafe version of mipmapMode.

public static long
npNext(long struct)

Unsafe version of pNext.

public static void
npNext(long struct, long value)

Unsafe version of pNext.

public static int
nsType(long struct)

Unsafe version of sType.

public static void
nsType(long struct, int value)

Unsafe version of sType.

public static int
nunnormalizedCoordinates(long struct)

Unsafe version of unnormalizedCoordinates.

public static void
nunnormalizedCoordinates(long struct, int value)

Unsafe version of unnormalizedCoordinates.

public long
pNext()

NULL or a pointer to a structure extending this structure.

public VkSamplerCreateInfo
pNext(long value)

Sets the specified value to the pNext field.

public VkSamplerCreateInfo
public VkSamplerCreateInfo
pNext(VkSamplerBlockMatchWindowCreateInfoQCOM value)

Prepends the specified VkSamplerBlockMatchWindowCreateInfoQCOM value to the pNext chain.

public VkSamplerCreateInfo
public VkSamplerCreateInfo
pNext(VkSamplerCubicWeightsCreateInfoQCOM value)

Prepends the specified VkSamplerCubicWeightsCreateInfoQCOM value to the pNext chain.

public VkSamplerCreateInfo
pNext(VkSamplerCustomBorderColorCreateInfoEXT value)

Prepends the specified VkSamplerCustomBorderColorCreateInfoEXT value to the pNext chain.

public VkSamplerCreateInfo
pNext(VkSamplerReductionModeCreateInfo value)

Prepends the specified VkSamplerReductionModeCreateInfo value to the pNext chain.

public VkSamplerCreateInfo
pNext(VkSamplerReductionModeCreateInfoEXT value)

Prepends the specified VkSamplerReductionModeCreateInfoEXT value to the pNext chain.

public VkSamplerCreateInfo
pNext(VkSamplerYcbcrConversionInfo value)

Prepends the specified VkSamplerYcbcrConversionInfo value to the pNext chain.

public VkSamplerCreateInfo
pNext(VkSamplerYcbcrConversionInfoKHR value)

Prepends the specified VkSamplerYcbcrConversionInfoKHR value to the pNext chain.

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 struct
set
(VkSamplerCreateInfo
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public int
sType()

a VkStructureType value identifying this structure.

public VkSamplerCreateInfo
sType(int value)

Sets the specified value to the sType field.

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 unnormalizedCoordinates field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate