C Specification
The VkMicromapBuildInfoEXT structure is defined as:
// Provided by VK_EXT_opacity_micromap
typedef struct VkMicromapBuildInfoEXT {
VkStructureType sType;
const void* pNext;
VkMicromapTypeEXT type;
VkBuildMicromapFlagsEXT flags;
VkBuildMicromapModeEXT mode;
VkMicromapEXT dstMicromap;
uint32_t usageCountsCount;
const VkMicromapUsageEXT* pUsageCounts;
const VkMicromapUsageEXT* const* ppUsageCounts;
VkDeviceOrHostAddressConstKHR data;
VkDeviceOrHostAddressKHR scratchData;
VkDeviceOrHostAddressConstKHR triangleArray;
VkDeviceSize triangleArrayStride;
} VkMicromapBuildInfoEXT;
Members
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
typeis a VkMicromapTypeEXT value specifying the type of micromap being built. -
flagsis a bitmask of VkBuildMicromapFlagBitsEXT specifying additional parameters of the micromap. -
modeis a VkBuildMicromapModeEXT value specifying the type of operation to perform. -
dstMicromapis a pointer to the target micromap for the build. -
usageCountsCountspecifies the number of usage counts structures that will be used to determine the size of this micromap. -
pUsageCountsis a pointer to an array of VkMicromapUsageEXT structures. -
ppUsageCountsis a pointer to an array of pointers to VkMicromapUsageEXT structures. -
datais the device or host address to memory which contains the data for the micromap. -
scratchDatais the device or host address to memory that will be used as scratch memory for the build. -
triangleArrayis the device or host address to memory containing the VkMicromapTriangleEXT data -
triangleArrayStrideis the stride in bytes between each element oftriangleArray
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 VK_OPACITY_MICROMAP_FORMAT_2_STATE_EXT or two bits per
element for VK_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.
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.