vkCmdBuildMicromapsEXT - Build a micromap
Description
The cmdBuildMicromapsEXT command provides the ability to initiate
multiple micromaps builds, however there is no ordering or
synchronization implied between any of the individual micromap builds.
This means that there cannot be any memory aliasing between any
micromap memories or scratch memories being used by any of the builds.
The input buffers passed to this command will be referenced by the
implementation for the duration of the command’s execution on the
device. Micromaps must be fully self-contained. The application can
reuse or free any memory which was used by this command’s execution on
the device as an input or as scratch without affecting the results of a
subsequent acceleration structure build using the micromap or traversal
of that acceleration structure, provided proper synchronization is used
as described below.
Accesses to the micromap scratch buffers as identified by the
MicromapBuildInfoEXT::scratchData buffer device addresses must be
synchronized
with the
PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT
pipeline stage
and an
access type
of (ACCESS_2_MICROMAP_READ_BIT_EXT |
ACCESS_2_MICROMAP_WRITE_BIT_EXT).
Accesses to MicromapBuildInfoEXT::dstMicromap must be
synchronized
with the
PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT
pipeline stage
and an
access type
of ACCESS_2_MICROMAP_WRITE_BIT_EXT.
Accesses to other input buffers as identified by any used values of
MicromapBuildInfoEXT::data or
MicromapBuildInfoEXT::triangleArray must be
synchronized
with the
PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT
pipeline stage
and an
access type
of ACCESS_SHADER_READ_BIT.
Valid Usage
For each pInfos[i],
dstMicromap must have been created with a value of
MicromapCreateInfoEXT::size greater than or equal to the memory
size required by the build operation, as returned by
getMicromapBuildSizesEXT with pBuildInfo = pInfos[i]
The mode member of each
element of pInfos must be a valid BuildMicromapModeEXT value
The dstMicromap
member of any element of pInfos must be a valid
MicromapEXT handle
For each element of
pInfos its type member must match the value of
MicromapCreateInfoEXT::type when its dstMicromap was created
The
::micromap
feature must be enabled
For each element of
pInfos, the buffer used to create its dstMicromap member
must be bound to device memory
If pInfos[i].mode is
BUILD_MICROMAP_MODE_BUILD_EXT, all addresses between
pInfos[i].scratchData.deviceAddress and
pInfos[i].scratchData.deviceAddress + N - 1 must be in the
buffer device address range of the same buffer, where N is given by
the buildScratchSize member of the MicromapBuildSizesInfoEXT
structure returned from a call to getMicromapBuildSizesEXT with an
identical MicromapBuildInfoEXT structure and primitive count
The buffers from which the
buffer device addresses for all of the data and triangleArray
members of all pInfos[i] are queried must have been created with
the
BUFFER_USAGE_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT
usage flag set
For each element of
pInfos[i] the buffer from which the buffer device address
pInfos[i].scratchData.deviceAddress is queried must have been
created with the
BUFFER_USAGE_STORAGE_BUFFER_BIT
usage flag set
For each element of
pInfos, if the value of
MicromapBuildSizesInfoEXT::buildScratchSize, returned from a
call to getMicromapBuildSizesEXT with an identical
MicromapBuildInfoEXT structure, is not 0,
scratchData.deviceAddress must be a valid
DeviceAddress
For each element of
pInfos, data.deviceAddress must be a valid
DeviceAddress
For each element of
pInfos, triangleArray.deviceAddress must be a valid
DeviceAddress
For each element of
pInfos, its scratchData.deviceAddress member must be a
multiple of
PhysicalDeviceAccelerationStructurePropertiesKHR::minAccelerationStructureScratchOffsetAlignment
For each element of
pInfos, its triangleArray.deviceAddress and data.deviceAddress
members must be a multiple of 256
The range of memory
backing the dstMicromap member of any element of pInfos that is
accessed by the execution of this command on the device must not
overlap the memory backing the dstMicromap member of any other
element of pInfos, which is accessed by the execution of this
command on the device
The range of memory
backing the dstMicromap member of any element of pInfos that is
accessed by the execution of this command on the device must not
overlap the memory backing the scratchData member of any element
of pInfos (including the same element), which is accessed by the
execution of this command on the device
The range of memory
backing the scratchData member of any element of pInfos that is
accessed by the execution of this command on the device must not
overlap the memory backing the scratchData member of any other
element of pInfos, which is accessed by the execution of this
command on the device
Valid Usage (Implicit)
pInfos must be a
valid pointer to an array of infoCount valid
MicromapBuildInfoEXT structures
commandBuffer must be in the
recording state
The
CommandPool that commandBuffer was
allocated from must support
QUEUE_COMPUTE_BIT operations
This command must only be
called outside of a render pass instance
This command must not be
called between suspended render pass instances
This command must only
be called outside of a video coding scope
infoCount
must be greater than 0
Host Synchronization
Command Properties
'
Conditional Rendering
vkCmdBuildMicromapsEXT is not affected by
conditional rendering
See Also
VK_EXT_opacity_micromap,
CommandBuffer, MicromapBuildInfoEXT