Class VkMicromapBuildInfoEXT
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
Description
Only one of pUsageCounts or ppUsageCounts can be a valid pointer, the other must be NULL. The elements of the non-NULL array describe the total counts used to build each micromap. Each element contains a count which is the number of micromap triangles of that format and subdivisionLevel contained in the micromap. Multiple elements with the same format and subdivisionLevel are allowed and the total count for that format and subdivisionLevel is the sum of the count for each element.
Each micromap triangle refers to one element in triangleArray which contains the format and subdivisionLevel for that particular triangle as well as a dataOffset in bytes which is the location relative to data where that triangle’s micromap data begins. The data at triangleArray is laid out as a 4 byte unsigned integer for the dataOffset followed by a 2 byte unsigned integer for the subdivision level then a 2 byte unsigned integer for the format. In practice, compilers compile VkMicromapTriangleEXT to match this pattern.
For opacity micromaps, the data at data is packed as either one bit per element for OPACITY_MICROMAP_FORMAT_2_STATE_EXT or two bits per element for OPACITY_MICROMAP_FORMAT_4_STATE_EXT and is packed from LSB to MSB in each byte. The data at each index in those bytes is interpreted as discussed in Ray Opacity Micromap.
For displacement micromaps, the data at data is interpreted as discussed in Displacement Micromap Encoding.
Valid Usage
- Only one of
pUsageCountsorppUsageCountscan be a valid pointer, the other must beNULL - If
typeisMICROMAP_TYPE_OPACITY_MICROMAP_EXTtheformatmember ofVkMicromapUsageEXTmust be a valid value fromVkOpacityMicromapFormatEXT - If
typeisMICROMAP_TYPE_OPACITY_MICROMAP_EXTtheformatmember ofVkMicromapTriangleEXTmust be a valid value fromVkOpacityMicromapFormatEXT - If
typeisMICROMAP_TYPE_DISPLACEMENT_MICROMAP_NVtheformatmember ofVkMicromapUsageEXTmust be a valid value fromVkDisplacementMicromapFormatNV - If
typeisMICROMAP_TYPE_DISPLACEMENT_MICROMAP_NVtheformatmember ofVkMicromapTriangleEXTmust be a valid value fromVkDisplacementMicromapFormatNV
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXTpNextmust beNULLtypemust be a validVkMicromapTypeEXTvalueflagsmust be a valid combination ofVkBuildMicromapFlagBitsEXTvalues- If
usageCountsCountis not 0, andpUsageCountsis notNULL,pUsageCountsmust be a valid pointer to an array ofusageCountsCountVkMicromapUsageEXTstructures - If
usageCountsCountis not 0, andppUsageCountsis notNULL,ppUsageCountsmust be a valid pointer to an array ofusageCountsCountvalid pointers toVkMicromapUsageEXTstructures
See Also
VkDeviceOrHostAddressConstKHR, VkDeviceOrHostAddressKHR, VkMicromapUsageEXT, BuildMicromapsEXT, CmdBuildMicromapsEXT, GetMicromapBuildSizesEXT
Layout
struct VkMicromapBuildInfoEXT {
VkStructureType sType();
void const * pNext();
VkMicromapTypeEXT type();
VkBuildMicromapFlagsEXT flags();
VkBuildMicromapModeEXT mode();
VkMicromapEXT dstMicromap();
uint32_t usageCountsCount();
VkMicromapUsageEXT const * pUsageCounts();
VkMicromapUsageEXT const * const * ppUsageCounts();
VkDeviceOrHostAddressConstKHR data();
VkDeviceOrHostAddressKHR scratchData();
VkDeviceOrHostAddressConstKHR triangleArray();
VkDeviceSize triangleArrayStride();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVkMicromapBuildInfoEXT(ByteBuffer container) Creates aVkMicromapBuildInfoEXTinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic VkMicromapBuildInfoEXTcalloc()Returns a newVkMicromapBuildInfoEXTinstance allocated withmemCalloc.calloc(int capacity) Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkMicromapBuildInfoEXTcalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkMicromapBuildInfoEXTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkMicromapBuildInfoEXTcreate()Returns a newVkMicromapBuildInfoEXTinstance allocated withBufferUtils.create(int capacity) Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated withBufferUtils.static VkMicromapBuildInfoEXTcreate(long address) Returns a newVkMicromapBuildInfoEXTinstance for the specified memory address.create(long address, int capacity) Create aVkMicromapBuildInfoEXT.Bufferinstance at the specified memory.static @Nullable VkMicromapBuildInfoEXTcreateSafe(long address) static @Nullable VkMicromapBuildInfoEXT.BuffercreateSafe(long address, int capacity) data()the device or host address to memory which contains the data for the micromap.data(Consumer<VkDeviceOrHostAddressConstKHR> consumer) Copies the specifiedVkDeviceOrHostAddressConstKHRto thedata()field.longa pointer to the target micromap for the build.dstMicromap(long value) Sets the specified value to thedstMicromap()field.intflags()a bitmask ofVkBuildMicromapFlagBitsEXTspecifying additional parameters of the micromap.flags(int value) Sets the specified value to theflags()field.static VkMicromapBuildInfoEXTmalloc()Returns a newVkMicromapBuildInfoEXTinstance allocated withmemAlloc.malloc(int capacity) Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated on the specifiedMemoryStack.static VkMicromapBuildInfoEXTmalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkMicromapBuildInfoEXTinstance allocated on the specifiedMemoryStack.intmode()aVkBuildMicromapModeEXTvalue specifying the type of operation to perform.mode(int value) Sets the specified value to themode()field.ndata(long struct) Unsafe version ofdata().static voidndata(long struct, VkDeviceOrHostAddressConstKHR value) Unsafe version ofdata.static longndstMicromap(long struct) Unsafe version ofdstMicromap().static voidndstMicromap(long struct, long value) Unsafe version ofdstMicromap.static intnflags(long struct) Unsafe version offlags().static voidnflags(long struct, int value) Unsafe version offlags.static intnmode(long struct) Unsafe version ofmode().static voidnmode(long struct, int value) Unsafe version ofmode.static longnpNext(long struct) Unsafe version ofpNext().static voidnpNext(long struct, long value) Unsafe version ofpNext.static @Nullable org.lwjgl.PointerBuffernppUsageCounts(long struct) Unsafe version ofppUsageCounts.static voidnppUsageCounts(long struct, @Nullable org.lwjgl.PointerBuffer value) Unsafe version ofppUsageCounts.static @Nullable VkMicromapUsageEXT.BuffernpUsageCounts(long struct) Unsafe version ofpUsageCounts().static voidnpUsageCounts(long struct, @Nullable VkMicromapUsageEXT.Buffer value) Unsafe version ofpUsageCounts.static VkDeviceOrHostAddressKHRnscratchData(long struct) Unsafe version ofscratchData().static voidnscratchData(long struct, VkDeviceOrHostAddressKHR value) Unsafe version ofscratchData.static intnsType(long struct) Unsafe version ofsType().static voidnsType(long struct, int value) Unsafe version ofsType.ntriangleArray(long struct) Unsafe version oftriangleArray().static voidntriangleArray(long struct, VkDeviceOrHostAddressConstKHR value) Unsafe version oftriangleArray.static longntriangleArrayStride(long struct) Unsafe version oftriangleArrayStride().static voidntriangleArrayStride(long struct, long value) Unsafe version oftriangleArrayStride.static intntype(long struct) Unsafe version oftype().static voidntype(long struct, int value) Unsafe version oftype.static intnusageCountsCount(long struct) Unsafe version ofusageCountsCount().static voidnusageCountsCount(long struct, int value) Sets the specified value to theusageCountsCountfield of the specifiedstruct.longpNext()NULLor a pointer to a structure extending this structure.pNext(long value) Sets the specified value to thepNext()field.@Nullable org.lwjgl.PointerBuffera pointer to an array of pointers toVkMicromapUsageEXTstructures.ppUsageCounts(@Nullable org.lwjgl.PointerBuffer value) Sets the address of the specifiedPointerBufferto theppUsageCounts()field.@Nullable VkMicromapUsageEXT.Buffera pointer to an array ofVkMicromapUsageEXTstructures.pUsageCounts(@Nullable VkMicromapUsageEXT.Buffer value) Sets the address of the specifiedVkMicromapUsageEXT.Bufferto thepUsageCounts()field.the device or host address to memory that will be used as scratch memory for the build.scratchData(Consumer<VkDeviceOrHostAddressKHR> consumer) Passes thescratchData()field to the specifiedConsumer.Copies the specifiedVkDeviceOrHostAddressKHRto thescratchData()field.set(int sType, long pNext, int type, int flags, int mode, long dstMicromap, int usageCountsCount, @Nullable VkMicromapUsageEXT.Buffer pUsageCounts, @Nullable org.lwjgl.PointerBuffer ppUsageCounts, VkDeviceOrHostAddressConstKHR data, VkDeviceOrHostAddressKHR scratchData, VkDeviceOrHostAddressConstKHR triangleArray, long triangleArrayStride) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()intsType()aVkStructureTypevalue identifying this structure.sType(int value) Sets the specified value to thesType()field.Sets theSTRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXTvalue to thesType()field.the device or host address to memory containing theVkMicromapTriangleEXTdatatriangleArray(Consumer<VkDeviceOrHostAddressConstKHR> consumer) Passes thetriangleArray()field to the specifiedConsumer.Copies the specifiedVkDeviceOrHostAddressConstKHRto thetriangleArray()field.longthe stride in bytes between each element oftriangleArraytriangleArrayStride(long value) Sets the specified value to thetriangleArrayStride()field.inttype()aVkMicromapTypeEXTvalue specifying the type of micromap being built.type(int value) Sets the specified value to thetype()field.intspecifies the number of usage counts structures that will be used to determine the size of this micromap.usageCountsCount(int value) Sets the specified value to theusageCountsCount()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
STYPE
public static final int STYPEThe struct member offsets. -
PNEXT
public static final int PNEXTThe struct member offsets. -
TYPE
public static final int TYPEThe struct member offsets. -
FLAGS
public static final int FLAGSThe struct member offsets. -
MODE
public static final int MODEThe struct member offsets. -
DSTMICROMAP
public static final int DSTMICROMAPThe struct member offsets. -
USAGECOUNTSCOUNT
public static final int USAGECOUNTSCOUNTThe struct member offsets. -
PUSAGECOUNTS
public static final int PUSAGECOUNTSThe struct member offsets. -
PPUSAGECOUNTS
public static final int PPUSAGECOUNTSThe struct member offsets. -
DATA
public static final int DATAThe struct member offsets. -
SCRATCHDATA
public static final int SCRATCHDATAThe struct member offsets. -
TRIANGLEARRAY
public static final int TRIANGLEARRAYThe struct member offsets. -
TRIANGLEARRAYSTRIDE
public static final int TRIANGLEARRAYSTRIDEThe struct member offsets.
-
-
Constructor Details
-
VkMicromapBuildInfoEXT
Creates aVkMicromapBuildInfoEXTinstance at the current position of the specifiedByteBuffercontainer. 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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VkMicromapBuildInfoEXT>
-
sType
public int sType()aVkStructureTypevalue identifying this structure. -
pNext
public long pNext()NULLor a pointer to a structure extending this structure. -
type
public int type()aVkMicromapTypeEXTvalue specifying the type of micromap being built. -
flags
public int flags()a bitmask ofVkBuildMicromapFlagBitsEXTspecifying additional parameters of the micromap. -
mode
public int mode()aVkBuildMicromapModeEXTvalue specifying the type of operation to perform. -
dstMicromap
public long dstMicromap()a pointer to the target micromap for the build. -
usageCountsCount
public int usageCountsCount()specifies the number of usage counts structures that will be used to determine the size of this micromap. -
pUsageCounts
a pointer to an array ofVkMicromapUsageEXTstructures. -
ppUsageCounts
public @Nullable org.lwjgl.PointerBuffer ppUsageCounts()a pointer to an array of pointers toVkMicromapUsageEXTstructures. -
data
the device or host address to memory which contains the data for the micromap. -
scratchData
the device or host address to memory that will be used as scratch memory for the build. -
triangleArray
the device or host address to memory containing theVkMicromapTriangleEXTdata -
triangleArrayStride
public long triangleArrayStride()the stride in bytes between each element oftriangleArray -
sType
Sets the specified value to thesType()field. -
sType$Default
Sets theSTRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXTvalue to thesType()field. -
pNext
Sets the specified value to thepNext()field. -
type
Sets the specified value to thetype()field. -
flags
Sets the specified value to theflags()field. -
mode
Sets the specified value to themode()field. -
dstMicromap
Sets the specified value to thedstMicromap()field. -
usageCountsCount
Sets the specified value to theusageCountsCount()field. -
pUsageCounts
Sets the address of the specifiedVkMicromapUsageEXT.Bufferto thepUsageCounts()field. -
ppUsageCounts
Sets the address of the specifiedPointerBufferto theppUsageCounts()field. -
data
Copies the specifiedVkDeviceOrHostAddressConstKHRto thedata()field. -
data
-
scratchData
Copies the specifiedVkDeviceOrHostAddressKHRto thescratchData()field. -
scratchData
Passes thescratchData()field to the specifiedConsumer. -
triangleArray
Copies the specifiedVkDeviceOrHostAddressConstKHRto thetriangleArray()field. -
triangleArray
Passes thetriangleArray()field to the specifiedConsumer. -
triangleArrayStride
Sets the specified value to thetriangleArrayStride()field. -
set
public VkMicromapBuildInfoEXT set(int sType, long pNext, int type, int flags, int mode, long dstMicromap, int usageCountsCount, @Nullable VkMicromapUsageEXT.Buffer pUsageCounts, @Nullable org.lwjgl.PointerBuffer ppUsageCounts, VkDeviceOrHostAddressConstKHR data, VkDeviceOrHostAddressKHR scratchData, VkDeviceOrHostAddressConstKHR triangleArray, long triangleArrayStride) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newVkMicromapBuildInfoEXTinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkMicromapBuildInfoEXTinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkMicromapBuildInfoEXTinstance allocated withBufferUtils. -
create
Returns a newVkMicromapBuildInfoEXTinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkMicromapBuildInfoEXT.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newVkMicromapBuildInfoEXTinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVkMicromapBuildInfoEXTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkMicromapBuildInfoEXT.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VkMicromapBuildInfoEXT.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkMicromapBuildInfoEXT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nsType
public static int nsType(long struct) Unsafe version ofsType(). -
npNext
public static long npNext(long struct) Unsafe version ofpNext(). -
ntype
public static int ntype(long struct) Unsafe version oftype(). -
nflags
public static int nflags(long struct) Unsafe version offlags(). -
nmode
public static int nmode(long struct) Unsafe version ofmode(). -
ndstMicromap
public static long ndstMicromap(long struct) Unsafe version ofdstMicromap(). -
nusageCountsCount
public static int nusageCountsCount(long struct) Unsafe version ofusageCountsCount(). -
npUsageCounts
Unsafe version ofpUsageCounts(). -
nppUsageCounts
public static @Nullable org.lwjgl.PointerBuffer nppUsageCounts(long struct) Unsafe version ofppUsageCounts. -
ndata
Unsafe version ofdata(). -
nscratchData
Unsafe version ofscratchData(). -
ntriangleArray
Unsafe version oftriangleArray(). -
ntriangleArrayStride
public static long ntriangleArrayStride(long struct) Unsafe version oftriangleArrayStride(). -
nsType
public static void nsType(long struct, int value) Unsafe version ofsType. -
npNext
public static void npNext(long struct, long value) Unsafe version ofpNext. -
ntype
public static void ntype(long struct, int value) Unsafe version oftype. -
nflags
public static void nflags(long struct, int value) Unsafe version offlags. -
nmode
public static void nmode(long struct, int value) Unsafe version ofmode. -
ndstMicromap
public static void ndstMicromap(long struct, long value) Unsafe version ofdstMicromap. -
nusageCountsCount
public static void nusageCountsCount(long struct, int value) Sets the specified value to theusageCountsCountfield of the specifiedstruct. -
npUsageCounts
Unsafe version ofpUsageCounts. -
nppUsageCounts
public static void nppUsageCounts(long struct, @Nullable org.lwjgl.PointerBuffer value) Unsafe version ofppUsageCounts. -
ndata
Unsafe version ofdata. -
nscratchData
Unsafe version ofscratchData. -
ntriangleArray
Unsafe version oftriangleArray. -
ntriangleArrayStride
public static void ntriangleArrayStride(long struct, long value) Unsafe version oftriangleArrayStride.
-