VkAccelerationStructureGeometryMicromapDataKHR - Structure specifying the data used to build a micromap
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 MicromapTriangleKHR 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_KHR or two bits per
element for OPACITY_MICROMAP_FORMAT_4_STATE_KHR 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.
Valid Usage
Only one of
pUsageCountsorppUsageCountscan be a valid pointer, the other must beNULL
The total sum of
countfrom all elements ofpUsageCountsandppUsageCountsmust be less than or equal to maxMicromapTrianglesFor each member of
pUsageCountsorppUsageCounts, ifformatis OPACITY_MICROMAP_FORMAT_2_STATE_KHR,subdivisionLevelmust be less than or equal to maxOpacity2StateSubdivisionLeveltriangleArrayStridemust be greater than or equal to8bytestriangleArrayStridemust be a multiple of4bytes
Valid Usage (Implicit)
If
usageCountsCountis not0, andpUsageCountsis notNULL,pUsageCountsmust be a valid pointer to an array ofusageCountsCountvalid MicromapUsageKHR structuresIf
usageCountsCountis not0, andppUsageCountsis notNULL,ppUsageCountsmust be a valid pointer to an array ofusageCountsCountvalid pointers to valid MicromapUsageKHR structures
Structure Chaining
See Also
VK_KHR_opacity_micromap, DeviceAddress, DeviceSize, MicromapUsageKHR, StructureType
Constructors
AccelerationStructureGeometryMicromapDataKHRusageCounts :: Vector MicromapUsageKHRpUsageCountsis a pointer to an array of MicromapUsageKHR structures.data' :: DeviceAddressdatais the device address to memory which contains the data for the micromap.triangleArray :: DeviceAddresstriangleArrayis the device address to memory containing the MicromapTriangleKHR datatriangleArrayStride :: DeviceSizetriangleArrayStrideis the stride in bytes between each element oftriangleArray
Instances4Show, FromCStruct, ToCStruct, Zero
Show AccelerationStructureGeometryMicromapDataKHRDefined in vulkan-3.27 · Vulkan.Extensions.VK_KHR_opacity_micromapFromCStruct AccelerationStructureGeometryMicromapDataKHRDefined in vulkan-3.27 · Vulkan.Extensions.VK_KHR_opacity_micromapToCStruct AccelerationStructureGeometryMicromapDataKHRDefined in vulkan-3.27 · Vulkan.Extensions.VK_KHR_opacity_micromapZero AccelerationStructureGeometryMicromapDataKHRDefined in vulkan-3.27 · Vulkan.Extensions.VK_KHR_opacity_micromap