Package org.lwjgl.vulkan
Class VkSamplerCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkSamplerCreateInfo
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class VkSamplerCreateInfo extends Struct
Khronos Reference Page
Vulkan SpecificationContains information about how a sampler object should be created.
Valid Usage
sType
must beSTRUCTURE_TYPE_SAMPLER_CREATE_INFO
pNext
must beNULL
flags
must be 0magFilter
must be a validVkFilter
valueminFilter
must be a validVkFilter
valuemipmapMode
must be a validVkSamplerMipmapMode
valueaddressModeU
must be a validVkSamplerAddressMode
valueaddressModeV
must be a validVkSamplerAddressMode
valueaddressModeW
must be a validVkSamplerAddressMode
value- The absolute value of
mipLodBias
must be less than or equal toVkPhysicalDeviceLimits
::maxSamplerLodBias
- If the anisotropic sampling feature is not enabled,
anisotropyEnable
must beFALSE
- If
anisotropyEnable
isTRUE
,maxAnisotropy
must be between1.0
andVkPhysicalDeviceLimits
::maxSamplerAnisotropy
, inclusive - If
unnormalizedCoordinates
isTRUE
,minFilter
andmagFilter
must be equal - If
unnormalizedCoordinates
isTRUE
,mipmapMode
must beSAMPLER_MIPMAP_MODE_NEAREST
- If
unnormalizedCoordinates
isTRUE
,minLod
andmaxLod
must be zero - If
unnormalizedCoordinates
isTRUE
,addressModeU
andaddressModeV
must each be eitherSAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
orSAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER
- If
unnormalizedCoordinates
isTRUE
,anisotropyEnable
must beFALSE
- If
unnormalizedCoordinates
isTRUE
,compareEnable
must beFALSE
- If any of
addressModeU
,addressModeV
oraddressModeW
areSAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER
,borderColor
must be a validVkBorderColor
value - If the VK_KHR_mirror_clamp_to_edge extension is not enabled,
addressModeU
,addressModeV
andaddressModeW
must not beSAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE
- If
compareEnable
isTRUE
,compareOp
must be a validVkCompareOp
value
Member documentation
sType
– the type of this structure. Must be:STRUCTURE_TYPE_SAMPLER_CREATE_INFO
pNext
– reserved for use by extensionsflags
– reserved for future usemagFilter
– the magnification filter to apply to lookupsminFilter
– the minification filter to apply to lookupsmipmapMode
– the mipmap filter to apply to lookups. One of:SAMPLER_MIPMAP_MODE_LINEAR
SAMPLER_MIPMAP_MODE_NEAREST
addressModeU
– the addressing mode for outside [0..1] range for U coordinate. One of:SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER
SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE
SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT
SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE
SAMPLER_ADDRESS_MODE_REPEAT
addressModeV
– the addressing mode for outside [0..1] range for V coordinateaddressModeW
– the addressing mode for outside [0..1] range for W coordinatemipLodBias
– the bias to be added to mipmap LOD calculation and bias provided by image sampling functions in SPIR-VanisotropyEnable
– isTRUE
to enable anisotropic filtering, orFALSE
otherwisemaxAnisotropy
– the anisotropy value clampcompareEnable
– isTRUE
to enable comparison against a reference value during lookups, orFALSE
otherwisecompareOp
– the comparison function to apply to fetched data before filtering. One of:COMPARE_OP_ALWAYS
COMPARE_OP_EQUAL
COMPARE_OP_GREATER
COMPARE_OP_GREATER_OR_EQUAL
COMPARE_OP_LESS
COMPARE_OP_LESS_OR_EQUAL
COMPARE_OP_NEVER
COMPARE_OP_NOT_EQUAL
minLod
– the minimum value to which the computed level-of-detail value will be clampedmaxLod
– the maximum value to which the computed level-of-detail value will be clampedborderColor
– the predefined border color to use. One of:BORDER_COLOR_FLOAT_OPAQUE_BLACK
BORDER_COLOR_FLOAT_OPAQUE_WHITE
BORDER_COLOR_FLOAT_TRANSPARENT_BLACK
BORDER_COLOR_INT_OPAQUE_BLACK
BORDER_COLOR_INT_OPAQUE_WHITE
BORDER_COLOR_INT_TRANSPARENT_BLACK
unnormalizedCoordinates
– controls whether to use unnormalized or normalized texel coordinates to address texels of the image
Layout
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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
VkSamplerCreateInfo.Buffer
An array ofVkSamplerCreateInfo
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor and Description VkSamplerCreateInfo(java.nio.ByteBuffer container)
Creates aVkSamplerCreateInfo
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
addressModeU()
Returns the value of theaddressModeU
field.VkSamplerCreateInfo
addressModeU(int value)
Sets the specified value to theaddressModeU
field.int
addressModeV()
Returns the value of theaddressModeV
field.VkSamplerCreateInfo
addressModeV(int value)
Sets the specified value to theaddressModeV
field.int
addressModeW()
Returns the value of theaddressModeW
field.VkSamplerCreateInfo
addressModeW(int value)
Sets the specified value to theaddressModeW
field.int
anisotropyEnable()
Returns the value of theanisotropyEnable
field.VkSamplerCreateInfo
anisotropyEnable(int value)
Sets the specified value to theanisotropyEnable
field.int
borderColor()
Returns the value of theborderColor
field.VkSamplerCreateInfo
borderColor(int value)
Sets the specified value to theborderColor
field.static VkSamplerCreateInfo
calloc()
Returns a newVkSamplerCreateInfo
instance allocated withmemCalloc
.static VkSamplerCreateInfo.Buffer
calloc(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated withmemCalloc
.static VkSamplerCreateInfo
callocStack()
Returns a newVkSamplerCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkSamplerCreateInfo.Buffer
callocStack(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkSamplerCreateInfo.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkSamplerCreateInfo
callocStack(MemoryStack stack)
Returns a newVkSamplerCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.int
compareEnable()
Returns the value of thecompareEnable
field.VkSamplerCreateInfo
compareEnable(int value)
Sets the specified value to thecompareEnable
field.int
compareOp()
Returns the value of thecompareOp
field.VkSamplerCreateInfo
compareOp(int value)
Sets the specified value to thecompareOp
field.static VkSamplerCreateInfo
create()
Returns a newVkSamplerCreateInfo
instance allocated withBufferUtils
.static VkSamplerCreateInfo.Buffer
create(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated withBufferUtils
.static VkSamplerCreateInfo
create(long address)
Returns a newVkSamplerCreateInfo
instance for the specified memory address ornull
if the address isNULL
.static VkSamplerCreateInfo.Buffer
create(long address, int capacity)
Create aVkSamplerCreateInfo.Buffer
instance at the specified memory.int
flags()
Returns the value of theflags
field.VkSamplerCreateInfo
flags(int value)
Sets the specified value to theflags
field.int
magFilter()
Returns the value of themagFilter
field.VkSamplerCreateInfo
magFilter(int value)
Sets the specified value to themagFilter
field.static VkSamplerCreateInfo
malloc()
Returns a newVkSamplerCreateInfo
instance allocated withmemAlloc
.static VkSamplerCreateInfo.Buffer
malloc(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated withmemAlloc
.static VkSamplerCreateInfo
mallocStack()
Returns a newVkSamplerCreateInfo
instance allocated on the thread-localMemoryStack
.static VkSamplerCreateInfo.Buffer
mallocStack(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VkSamplerCreateInfo.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VkSamplerCreateInfo
mallocStack(MemoryStack stack)
Returns a newVkSamplerCreateInfo
instance allocated on the specifiedMemoryStack
.float
maxAnisotropy()
Returns the value of themaxAnisotropy
field.VkSamplerCreateInfo
maxAnisotropy(float value)
Sets the specified value to themaxAnisotropy
field.float
maxLod()
Returns the value of themaxLod
field.VkSamplerCreateInfo
maxLod(float value)
Sets the specified value to themaxLod
field.int
minFilter()
Returns the value of theminFilter
field.VkSamplerCreateInfo
minFilter(int value)
Sets the specified value to theminFilter
field.float
minLod()
Returns the value of theminLod
field.VkSamplerCreateInfo
minLod(float value)
Sets the specified value to theminLod
field.float
mipLodBias()
Returns the value of themipLodBias
field.VkSamplerCreateInfo
mipLodBias(float value)
Sets the specified value to themipLodBias
field.int
mipmapMode()
Returns the value of themipmapMode
field.VkSamplerCreateInfo
mipmapMode(int value)
Sets the specified value to themipmapMode
field.VkSamplerCreateInfo
nset(long struct)
Unsafe version ofset
.long
pNext()
Returns the value of thepNext
field.VkSamplerCreateInfo
pNext(long value)
Sets the specified value to thepNext
field.VkSamplerCreateInfo
set(int sType, long pNext, int flags, int magFilter, int minFilter, int mipmapMode, int addressModeU, int addressModeV, int addressModeW, float mipLodBias, int anisotropyEnable, float maxAnisotropy, int compareEnable, int compareOp, float minLod, float maxLod, int borderColor, int unnormalizedCoordinates)
Initializes this struct with the specified values.VkSamplerCreateInfo
set(VkSamplerCreateInfo src)
Copies the specified struct data to this struct.int
sizeof()
Returns thesizeof(struct)
.int
sType()
Returns the value of thesType
field.VkSamplerCreateInfo
sType(int value)
Sets the specified value to thesType
field.int
unnormalizedCoordinates()
Returns the value of theunnormalizedCoordinates
field.VkSamplerCreateInfo
unnormalizedCoordinates(int value)
Sets the specified value to theunnormalizedCoordinates
field.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Constructor Detail
-
VkSamplerCreateInfo
public VkSamplerCreateInfo(java.nio.ByteBuffer container)
Creates aVkSamplerCreateInfo
instance at the current position of the specifiedByteBuffer
container. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
Description copied from class:Struct
Returns thesizeof(struct)
.
-
sType
public int sType()
Returns the value of thesType
field.
-
pNext
public long pNext()
Returns the value of thepNext
field.
-
flags
public int flags()
Returns the value of theflags
field.
-
magFilter
public int magFilter()
Returns the value of themagFilter
field.
-
minFilter
public int minFilter()
Returns the value of theminFilter
field.
-
mipmapMode
public int mipmapMode()
Returns the value of themipmapMode
field.
-
addressModeU
public int addressModeU()
Returns the value of theaddressModeU
field.
-
addressModeV
public int addressModeV()
Returns the value of theaddressModeV
field.
-
addressModeW
public int addressModeW()
Returns the value of theaddressModeW
field.
-
mipLodBias
public float mipLodBias()
Returns the value of themipLodBias
field.
-
anisotropyEnable
public int anisotropyEnable()
Returns the value of theanisotropyEnable
field.
-
maxAnisotropy
public float maxAnisotropy()
Returns the value of themaxAnisotropy
field.
-
compareEnable
public int compareEnable()
Returns the value of thecompareEnable
field.
-
compareOp
public int compareOp()
Returns the value of thecompareOp
field.
-
minLod
public float minLod()
Returns the value of theminLod
field.
-
maxLod
public float maxLod()
Returns the value of themaxLod
field.
-
borderColor
public int borderColor()
Returns the value of theborderColor
field.
-
unnormalizedCoordinates
public int unnormalizedCoordinates()
Returns the value of theunnormalizedCoordinates
field.
-
sType
public VkSamplerCreateInfo sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkSamplerCreateInfo pNext(long value)
Sets the specified value to thepNext
field.
-
flags
public VkSamplerCreateInfo flags(int value)
Sets the specified value to theflags
field.
-
magFilter
public VkSamplerCreateInfo magFilter(int value)
Sets the specified value to themagFilter
field.
-
minFilter
public VkSamplerCreateInfo minFilter(int value)
Sets the specified value to theminFilter
field.
-
mipmapMode
public VkSamplerCreateInfo mipmapMode(int value)
Sets the specified value to themipmapMode
field.
-
addressModeU
public VkSamplerCreateInfo addressModeU(int value)
Sets the specified value to theaddressModeU
field.
-
addressModeV
public VkSamplerCreateInfo addressModeV(int value)
Sets the specified value to theaddressModeV
field.
-
addressModeW
public VkSamplerCreateInfo addressModeW(int value)
Sets the specified value to theaddressModeW
field.
-
mipLodBias
public VkSamplerCreateInfo mipLodBias(float value)
Sets the specified value to themipLodBias
field.
-
anisotropyEnable
public VkSamplerCreateInfo anisotropyEnable(int value)
Sets the specified value to theanisotropyEnable
field.
-
maxAnisotropy
public VkSamplerCreateInfo maxAnisotropy(float value)
Sets the specified value to themaxAnisotropy
field.
-
compareEnable
public VkSamplerCreateInfo compareEnable(int value)
Sets the specified value to thecompareEnable
field.
-
compareOp
public VkSamplerCreateInfo compareOp(int value)
Sets the specified value to thecompareOp
field.
-
minLod
public VkSamplerCreateInfo minLod(float value)
Sets the specified value to theminLod
field.
-
maxLod
public VkSamplerCreateInfo maxLod(float value)
Sets the specified value to themaxLod
field.
-
borderColor
public VkSamplerCreateInfo borderColor(int value)
Sets the specified value to theborderColor
field.
-
unnormalizedCoordinates
public VkSamplerCreateInfo unnormalizedCoordinates(int value)
Sets the specified value to theunnormalizedCoordinates
field.
-
set
public VkSamplerCreateInfo set(int sType, long pNext, int flags, int magFilter, int minFilter, int mipmapMode, int addressModeU, int addressModeV, int addressModeW, float mipLodBias, int anisotropyEnable, float maxAnisotropy, int compareEnable, int compareOp, float minLod, float maxLod, int borderColor, int unnormalizedCoordinates)
Initializes this struct with the specified values.
-
nset
public VkSamplerCreateInfo nset(long struct)
Unsafe version ofset
.
-
set
public VkSamplerCreateInfo set(VkSamplerCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkSamplerCreateInfo malloc()
Returns a newVkSamplerCreateInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkSamplerCreateInfo calloc()
Returns a newVkSamplerCreateInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkSamplerCreateInfo create()
Returns a newVkSamplerCreateInfo
instance allocated withBufferUtils
.
-
create
public static VkSamplerCreateInfo create(long address)
Returns a newVkSamplerCreateInfo
instance for the specified memory address ornull
if the address isNULL
.
-
malloc
public static VkSamplerCreateInfo.Buffer malloc(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkSamplerCreateInfo.Buffer calloc(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkSamplerCreateInfo.Buffer create(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkSamplerCreateInfo.Buffer create(long address, int capacity)
Create aVkSamplerCreateInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static VkSamplerCreateInfo mallocStack()
Returns a newVkSamplerCreateInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkSamplerCreateInfo callocStack()
Returns a newVkSamplerCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkSamplerCreateInfo mallocStack(MemoryStack stack)
Returns a newVkSamplerCreateInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkSamplerCreateInfo callocStack(MemoryStack stack)
Returns a newVkSamplerCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkSamplerCreateInfo.Buffer mallocStack(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkSamplerCreateInfo.Buffer callocStack(int capacity)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkSamplerCreateInfo.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkSamplerCreateInfo.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newVkSamplerCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
-