1e5c31af7Sopenharmony_ci// Copyright 2020-2021 The Khronos Group, Inc. 2e5c31af7Sopenharmony_ci// 3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 4e5c31af7Sopenharmony_ci 5e5c31af7Sopenharmony_ci[[acceleration-structure]] 6e5c31af7Sopenharmony_ci= Acceleration Structures 7e5c31af7Sopenharmony_ci 8e5c31af7Sopenharmony_ci 9e5c31af7Sopenharmony_ci[[acceleration-structure-def]] 10e5c31af7Sopenharmony_ci== Acceleration Structures 11e5c31af7Sopenharmony_ci 12e5c31af7Sopenharmony_ci_Acceleration structures_ are data structures used by the implementation to 13e5c31af7Sopenharmony_ciefficiently manage scene geometry as it is <<ray-traversal, traversed during 14e5c31af7Sopenharmony_cia ray tracing query>>. 15e5c31af7Sopenharmony_ciThe application is responsible for managing acceleration structure objects 16e5c31af7Sopenharmony_ci(see <<resources-acceleration-structures,Acceleration Structures>>), 17e5c31af7Sopenharmony_ciincluding allocation, destruction, executing builds or updates, and 18e5c31af7Sopenharmony_cisynchronizing resources used during ray tracing queries. 19e5c31af7Sopenharmony_ci 20e5c31af7Sopenharmony_ciThere are two types of acceleration structures, _top level acceleration 21e5c31af7Sopenharmony_cistructures_ and _bottom level acceleration structures_. 22e5c31af7Sopenharmony_ci 23e5c31af7Sopenharmony_ciAn acceleration structure is considered to be constructed if an 24e5c31af7Sopenharmony_ci<<acceleration-structure-building,acceleration structure build command>> or 25e5c31af7Sopenharmony_ci<<acceleration-structure-copying,copy command>> has been executed with the 26e5c31af7Sopenharmony_cigiven acceleration structure as the destination. 27e5c31af7Sopenharmony_ci 28e5c31af7Sopenharmony_ci[[fig-accelstruct]] 29e5c31af7Sopenharmony_ciimage::{images}/accelstruct.svg[align="center",title="Acceleration Structure",opts="{imageopts}"] 30e5c31af7Sopenharmony_ci 31e5c31af7Sopenharmony_ci.Caption 32e5c31af7Sopenharmony_ci**** 33e5c31af7Sopenharmony_ciThe diagram shows the relationship between top and bottom level acceleration 34e5c31af7Sopenharmony_cistructures. 35e5c31af7Sopenharmony_ci**** 36e5c31af7Sopenharmony_ci 37e5c31af7Sopenharmony_ci 38e5c31af7Sopenharmony_ci[[acceleration-structure-geometry]] 39e5c31af7Sopenharmony_ci=== Geometry 40e5c31af7Sopenharmony_ci 41e5c31af7Sopenharmony_ci_Geometries_ refer to a triangle or axis-aligned bounding box. 42e5c31af7Sopenharmony_ci 43e5c31af7Sopenharmony_ci 44e5c31af7Sopenharmony_ci[[acceleration-structure-top-level]] 45e5c31af7Sopenharmony_ci=== Top Level Acceleration Structures 46e5c31af7Sopenharmony_ci 47e5c31af7Sopenharmony_ciOpaque acceleration structure for an array of instances. 48e5c31af7Sopenharmony_ciThe descriptor or device address referencing this is the starting point for 49e5c31af7Sopenharmony_citraversal. 50e5c31af7Sopenharmony_ci 51e5c31af7Sopenharmony_ciThe top level acceleration structure takes a reference to any bottom level 52e5c31af7Sopenharmony_ciacceleration structure referenced by its instances. 53e5c31af7Sopenharmony_ciThose bottom level acceleration structure objects must: be valid when the 54e5c31af7Sopenharmony_citop level acceleration structure is accessed. 55e5c31af7Sopenharmony_ci 56e5c31af7Sopenharmony_ci 57e5c31af7Sopenharmony_ci[[acceleration-structure-bottom-level]] 58e5c31af7Sopenharmony_ci=== Bottom Level Acceleration Structures 59e5c31af7Sopenharmony_ci 60e5c31af7Sopenharmony_ciOpaque acceleration structure for an array of geometries. 61e5c31af7Sopenharmony_ci 62e5c31af7Sopenharmony_ci 63e5c31af7Sopenharmony_ci[[acceleration-structure-update]] 64e5c31af7Sopenharmony_ci=== Acceleration Structure Update Rules 65e5c31af7Sopenharmony_ci 66e5c31af7Sopenharmony_ciThe API defines two types of operations to produce acceleration structures 67e5c31af7Sopenharmony_cifrom geometry: 68e5c31af7Sopenharmony_ci 69e5c31af7Sopenharmony_ci * A _build_ operation is used to construct an acceleration structure. 70e5c31af7Sopenharmony_ci * An _update_ operation is used to modify an existing acceleration 71e5c31af7Sopenharmony_ci structure. 72e5c31af7Sopenharmony_ci 73e5c31af7Sopenharmony_ciAn update operation imposes certain constraints on the input, in exchange 74e5c31af7Sopenharmony_cifor considerably faster execution. 75e5c31af7Sopenharmony_ciWhen performing an update, the application is required to provide a full 76e5c31af7Sopenharmony_cidescription of the acceleration structure, but is prohibited from changing 77e5c31af7Sopenharmony_cianything other than instance definitions, transform matrices, and vertex or 78e5c31af7Sopenharmony_ciAABB positions. 79e5c31af7Sopenharmony_ciAll other aspects of the description must: exactly match the one from the 80e5c31af7Sopenharmony_cioriginal build. 81e5c31af7Sopenharmony_ci 82e5c31af7Sopenharmony_ciMore precisely, the application must: not use an update operation to do any 83e5c31af7Sopenharmony_ciof the following: 84e5c31af7Sopenharmony_ci 85e5c31af7Sopenharmony_ci * Change primitives or instances from _active_ to _inactive_ (as defined 86e5c31af7Sopenharmony_ci in <<acceleration-structure-inactive-prims>>). 87e5c31af7Sopenharmony_ci * Change the index or vertex formats of triangle geometry. 88e5c31af7Sopenharmony_ci * Change triangle geometry transform pointers from null to non-null or 89e5c31af7Sopenharmony_ci vice versa. 90e5c31af7Sopenharmony_ci * Change the number of geometries or instances in the structure. 91e5c31af7Sopenharmony_ci * Change the geometry flags for any geometry in the structure. 92e5c31af7Sopenharmony_ci * Change the number of vertices or primitives for any geometry in the 93e5c31af7Sopenharmony_ci structure. 94e5c31af7Sopenharmony_ci 95e5c31af7Sopenharmony_ci 96e5c31af7Sopenharmony_ci[[acceleration-structure-inactive-prims]] 97e5c31af7Sopenharmony_ci=== Inactive Primitives and Instances 98e5c31af7Sopenharmony_ci 99e5c31af7Sopenharmony_ciAcceleration structures allow the use of particular input values to signal 100e5c31af7Sopenharmony_ci_inactive_ primitives or instances. 101e5c31af7Sopenharmony_ci 102e5c31af7Sopenharmony_ciAn _inactive_ triangle is one for which the first (X) component of each 103e5c31af7Sopenharmony_civertex is NaN. 104e5c31af7Sopenharmony_ciIf any other vertex component is NaN, and the first is not, the behavior is 105e5c31af7Sopenharmony_ciundefined:. 106e5c31af7Sopenharmony_ciIf the vertex format does not have a NaN representation, then all triangles 107e5c31af7Sopenharmony_ciare considered active. 108e5c31af7Sopenharmony_ci 109e5c31af7Sopenharmony_ciAn _inactive_ instance is one whose acceleration structure handle is 110e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE. 111e5c31af7Sopenharmony_ci 112e5c31af7Sopenharmony_ciAn _inactive_ AABB is one for which the minimum X coordinate is NaN. 113e5c31af7Sopenharmony_ciIf any other component is NaN, and the first is not, the behavior is 114e5c31af7Sopenharmony_ciundefined:. 115e5c31af7Sopenharmony_ci 116e5c31af7Sopenharmony_ciIn the above definitions, "NaN" refers to any type of NaN. 117e5c31af7Sopenharmony_ciSignaling, non-signaling, quiet, loud, or otherwise. 118e5c31af7Sopenharmony_ci 119e5c31af7Sopenharmony_ciAn inactive object is considered invisible to all rays, and should: not be 120e5c31af7Sopenharmony_cirepresented in the acceleration structure. 121e5c31af7Sopenharmony_ciImplementations should: ensure that the presence of inactive objects does 122e5c31af7Sopenharmony_cinot seriously degrade traversal performance. 123e5c31af7Sopenharmony_ci 124e5c31af7Sopenharmony_ciInactive objects are counted in the auto-generated index sequences which are 125e5c31af7Sopenharmony_ciprovided to shaders via code:InstanceId and code:PrimitiveId SPIR-V 126e5c31af7Sopenharmony_cidecorations. 127e5c31af7Sopenharmony_ciThis allows objects in the scene to change freely between the active and 128e5c31af7Sopenharmony_ciinactive states, without affecting the layout of any arrays which are being 129e5c31af7Sopenharmony_ciindexed using the ID values. 130e5c31af7Sopenharmony_ci 131e5c31af7Sopenharmony_ciAny transition between the active and inactive states requires a full 132e5c31af7Sopenharmony_ciacceleration structure rebuild. 133e5c31af7Sopenharmony_ciApplications must: not perform an acceleration structure update where an 134e5c31af7Sopenharmony_ciobject is active in the source acceleration structure but would be inactive 135e5c31af7Sopenharmony_ciin the destination, or vice versa. 136e5c31af7Sopenharmony_ci 137e5c31af7Sopenharmony_ci 138e5c31af7Sopenharmony_ci[[acceleration-structure-building]] 139e5c31af7Sopenharmony_ci=== Building Acceleration Structures 140e5c31af7Sopenharmony_ci 141e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 142e5c31af7Sopenharmony_ci[open,refpage='vkCmdBuildAccelerationStructureNV',desc='Build an acceleration structure',type='protos'] 143e5c31af7Sopenharmony_ci-- 144e5c31af7Sopenharmony_ci:refpage: vkCmdBuildAccelerationStructureNV 145e5c31af7Sopenharmony_ci 146e5c31af7Sopenharmony_ciTo build an acceleration structure call: 147e5c31af7Sopenharmony_ci 148e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBuildAccelerationStructureNV.txt[] 149e5c31af7Sopenharmony_ci 150e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 151e5c31af7Sopenharmony_ci recorded. 152e5c31af7Sopenharmony_ci * pname:pInfo contains the shared information for the acceleration 153e5c31af7Sopenharmony_ci structure's structure. 154e5c31af7Sopenharmony_ci * pname:instanceData is the buffer containing an array of 155e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInstanceKHR structures defining 156e5c31af7Sopenharmony_ci acceleration structures. 157e5c31af7Sopenharmony_ci This parameter must: be `NULL` for bottom level acceleration structures. 158e5c31af7Sopenharmony_ci * pname:instanceOffset is the offset in bytes (relative to the start of 159e5c31af7Sopenharmony_ci pname:instanceData) at which the instance data is located. 160e5c31af7Sopenharmony_ci * pname:update specifies whether to update the pname:dst acceleration 161e5c31af7Sopenharmony_ci structure with the data in pname:src. 162e5c31af7Sopenharmony_ci * pname:dst is a pointer to the target acceleration structure for the 163e5c31af7Sopenharmony_ci build. 164e5c31af7Sopenharmony_ci * pname:src is a pointer to an existing acceleration structure that is to 165e5c31af7Sopenharmony_ci be used to update the pname:dst acceleration structure. 166e5c31af7Sopenharmony_ci * pname:scratch is the slink:VkBuffer that will be used as scratch memory 167e5c31af7Sopenharmony_ci for the build. 168e5c31af7Sopenharmony_ci * pname:scratchOffset is the offset in bytes relative to the start of 169e5c31af7Sopenharmony_ci pname:scratch that will be used as a scratch memory. 170e5c31af7Sopenharmony_ci 171e5c31af7Sopenharmony_ciAccesses to pname:dst, pname:src, and pname:scratch must: be 172e5c31af7Sopenharmony_ci<<synchronization-dependencies,synchronized>> with the 173e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 174e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 175e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 176e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR or 177e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR. 178e5c31af7Sopenharmony_ci 179e5c31af7Sopenharmony_ci.Valid Usage 180e5c31af7Sopenharmony_ci**** 181e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-geometryCount-02241]] 182e5c31af7Sopenharmony_ci pname:geometryCount must: be less than or equal to 183e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceRayTracingPropertiesNV::pname:maxGeometryCount 184e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-dst-02488]] 185e5c31af7Sopenharmony_ci pname:dst must: have been created with compatible 186e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInfoNV where 187e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInfoNV::pname:type and 188e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInfoNV::pname:flags are identical, 189e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInfoNV::pname:instanceCount and 190e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInfoNV::pname:geometryCount for pname:dst 191e5c31af7Sopenharmony_ci are greater than or equal to the build size and each geometry in 192e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInfoNV::pname:pGeometries for pname:dst has 193e5c31af7Sopenharmony_ci greater than or equal to the number of vertices, indices, and AABBs 194e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-update-02489]] 195e5c31af7Sopenharmony_ci If pname:update is ename:VK_TRUE, pname:src must: not be 196e5c31af7Sopenharmony_ci dlink:VK_NULL_HANDLE 197e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-update-02490]] 198e5c31af7Sopenharmony_ci If pname:update is ename:VK_TRUE, pname:src must: have previously been 199e5c31af7Sopenharmony_ci constructed with 200e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV set in 201e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInfoNV::pname:flags in the original build 202e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-update-02491]] 203e5c31af7Sopenharmony_ci If pname:update is ename:VK_FALSE, the pname:size member of the 204e5c31af7Sopenharmony_ci slink:VkMemoryRequirements structure returned from a call to 205e5c31af7Sopenharmony_ci flink:vkGetAccelerationStructureMemoryRequirementsNV with 206e5c31af7Sopenharmony_ci slink:VkAccelerationStructureMemoryRequirementsInfoNV::pname:accelerationStructure 207e5c31af7Sopenharmony_ci set to pname:dst and 208e5c31af7Sopenharmony_ci slink:VkAccelerationStructureMemoryRequirementsInfoNV::pname:type set to 209e5c31af7Sopenharmony_ci ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV 210e5c31af7Sopenharmony_ci must: be less than or equal to the size of pname:scratch minus 211e5c31af7Sopenharmony_ci pname:scratchOffset 212e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-update-02492]] 213e5c31af7Sopenharmony_ci If pname:update is ename:VK_TRUE, the pname:size member of the 214e5c31af7Sopenharmony_ci slink:VkMemoryRequirements structure returned from a call to 215e5c31af7Sopenharmony_ci flink:vkGetAccelerationStructureMemoryRequirementsNV with 216e5c31af7Sopenharmony_ci slink:VkAccelerationStructureMemoryRequirementsInfoNV::pname:accelerationStructure 217e5c31af7Sopenharmony_ci set to pname:dst and 218e5c31af7Sopenharmony_ci slink:VkAccelerationStructureMemoryRequirementsInfoNV::pname:type set to 219e5c31af7Sopenharmony_ci ename:VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV 220e5c31af7Sopenharmony_ci must: be less than or equal to the size of pname:scratch minus 221e5c31af7Sopenharmony_ci pname:scratchOffset 222e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-scratch-03522]] 223e5c31af7Sopenharmony_ci pname:scratch must: have been created with 224e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_RAY_TRACING_BIT_NV usage flag 225e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-instanceData-03523]] 226e5c31af7Sopenharmony_ci If pname:instanceData is not dlink:VK_NULL_HANDLE, pname:instanceData 227e5c31af7Sopenharmony_ci must: have been created with ename:VK_BUFFER_USAGE_RAY_TRACING_BIT_NV 228e5c31af7Sopenharmony_ci usage flag 229e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-accelerationStructureReference-03786]] 230e5c31af7Sopenharmony_ci Each 231e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInstanceKHR::pname:accelerationStructureReference 232e5c31af7Sopenharmony_ci value in pname:instanceData must: be a valid device address containing a 233e5c31af7Sopenharmony_ci value obtained from flink:vkGetAccelerationStructureHandleNV 234e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-update-03524]] 235e5c31af7Sopenharmony_ci If pname:update is ename:VK_TRUE, then objects that were previously 236e5c31af7Sopenharmony_ci active must: not be made inactive as per 237e5c31af7Sopenharmony_ci <<acceleration-structure-inactive-prims>> 238e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-update-03525]] 239e5c31af7Sopenharmony_ci If pname:update is ename:VK_TRUE, then objects that were previously 240e5c31af7Sopenharmony_ci inactive must: not be made active as per 241e5c31af7Sopenharmony_ci <<acceleration-structure-inactive-prims>> 242e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructureNV-update-03526]] 243e5c31af7Sopenharmony_ci If pname:update is ename:VK_TRUE, the pname:src and pname:dst objects 244e5c31af7Sopenharmony_ci must: either be the same object or not have any 245e5c31af7Sopenharmony_ci <<resources-memory-aliasing, memory aliasing>> 246e5c31af7Sopenharmony_ci 247e5c31af7Sopenharmony_ci**** 248e5c31af7Sopenharmony_ci 249e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBuildAccelerationStructureNV.txt[] 250e5c31af7Sopenharmony_ci-- 251e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 252e5c31af7Sopenharmony_ci 253e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 254e5c31af7Sopenharmony_ci[open,refpage='vkCmdBuildAccelerationStructuresKHR',desc='Build an acceleration structure',type='protos'] 255e5c31af7Sopenharmony_ci-- 256e5c31af7Sopenharmony_ci:refpage: vkCmdBuildAccelerationStructuresKHR 257e5c31af7Sopenharmony_ci:maxinstancecheck: pname:ppBuildRangeInfos[i][j].pname:primitiveCount 258e5c31af7Sopenharmony_ci 259e5c31af7Sopenharmony_ciTo build acceleration structures call: 260e5c31af7Sopenharmony_ci 261e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBuildAccelerationStructuresKHR.txt[] 262e5c31af7Sopenharmony_ci 263e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 264e5c31af7Sopenharmony_ci recorded. 265e5c31af7Sopenharmony_ci * pname:infoCount is the number of acceleration structures to build. 266e5c31af7Sopenharmony_ci It specifies the number of the pname:pInfos structures and 267e5c31af7Sopenharmony_ci pname:ppBuildRangeInfos pointers that must: be provided. 268e5c31af7Sopenharmony_ci * pname:pInfos is a pointer to an array of pname:infoCount 269e5c31af7Sopenharmony_ci slink:VkAccelerationStructureBuildGeometryInfoKHR structures defining 270e5c31af7Sopenharmony_ci the geometry used to build each acceleration structure. 271e5c31af7Sopenharmony_ci * pname:ppBuildRangeInfos is a pointer to an array of pname:infoCount 272e5c31af7Sopenharmony_ci pointers to arrays of slink:VkAccelerationStructureBuildRangeInfoKHR 273e5c31af7Sopenharmony_ci structures. 274e5c31af7Sopenharmony_ci Each pname:ppBuildRangeInfos[i] is a pointer to an array of 275e5c31af7Sopenharmony_ci pname:pInfos[i].pname:geometryCount 276e5c31af7Sopenharmony_ci slink:VkAccelerationStructureBuildRangeInfoKHR structures defining 277e5c31af7Sopenharmony_ci dynamic offsets to the addresses where geometry data is stored, as 278e5c31af7Sopenharmony_ci defined by pname:pInfos[i]. 279e5c31af7Sopenharmony_ci 280e5c31af7Sopenharmony_ciThe fname:vkCmdBuildAccelerationStructuresKHR command provides the ability 281e5c31af7Sopenharmony_cito initiate multiple acceleration structures builds, however there is no 282e5c31af7Sopenharmony_ciordering or synchronization implied between any of the individual 283e5c31af7Sopenharmony_ciacceleration structure builds. 284e5c31af7Sopenharmony_ci 285e5c31af7Sopenharmony_ci[NOTE] 286e5c31af7Sopenharmony_ci.Note 287e5c31af7Sopenharmony_ci==== 288e5c31af7Sopenharmony_ciThis means that an application cannot: build a top-level acceleration 289e5c31af7Sopenharmony_cistructure in the same flink:vkCmdBuildAccelerationStructuresKHR call as the 290e5c31af7Sopenharmony_ciassociated bottom-level or instance acceleration structures are being built. 291e5c31af7Sopenharmony_ciThere also cannot: be any memory aliasing between any acceleration structure 292e5c31af7Sopenharmony_cimemories or scratch memories being used by any of the builds. 293e5c31af7Sopenharmony_ci==== 294e5c31af7Sopenharmony_ci 295e5c31af7Sopenharmony_ci[[acceleration-structure-scratch]] 296e5c31af7Sopenharmony_ciAccesses to the acceleration structure scratch buffers as identified by the 297e5c31af7Sopenharmony_cislink:VkAccelerationStructureBuildGeometryInfoKHR::pname:scratchData buffer 298e5c31af7Sopenharmony_cidevice addresses must: be <<synchronization-dependencies,synchronized>> with 299e5c31af7Sopenharmony_cithe ename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 300e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 301e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 302e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR or 303e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR. 304e5c31af7Sopenharmony_ciSimilarly for accesses to each 305e5c31af7Sopenharmony_cislink:VkAccelerationStructureBuildGeometryInfoKHR::pname:srcAccelerationStructure 306e5c31af7Sopenharmony_ciand 307e5c31af7Sopenharmony_cislink:VkAccelerationStructureBuildGeometryInfoKHR::pname:dstAccelerationStructure. 308e5c31af7Sopenharmony_ci 309e5c31af7Sopenharmony_ciAccesses to other input buffers as identified by any used values of 310e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 311e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryMotionTrianglesDataNV::pname:vertexData, 312e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 313e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:vertexData, 314e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:indexData, 315e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:transformData, 316e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryAabbsDataKHR::pname:data, and 317e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryInstancesDataKHR::pname:data must: be 318e5c31af7Sopenharmony_ci<<synchronization-dependencies,synchronized>> with the 319e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 320e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 321e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 322e5c31af7Sopenharmony_ciename:VK_ACCESS_SHADER_READ_BIT. 323e5c31af7Sopenharmony_ci 324e5c31af7Sopenharmony_ci 325e5c31af7Sopenharmony_ci.Valid Usage 326e5c31af7Sopenharmony_ci**** 327e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/build_acceleration_structure_common.txt[] 328e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/build_acceleration_structure_device_common.txt[] 329e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/build_acceleration_structure_nonindirect_common.txt[] 330e5c31af7Sopenharmony_ci**** 331e5c31af7Sopenharmony_ci 332e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBuildAccelerationStructuresKHR.txt[] 333e5c31af7Sopenharmony_ci-- 334e5c31af7Sopenharmony_ci 335e5c31af7Sopenharmony_ci[open,refpage='vkCmdBuildAccelerationStructuresIndirectKHR',desc='Build an acceleration structure with some parameters provided on the device',type='protos'] 336e5c31af7Sopenharmony_ci-- 337e5c31af7Sopenharmony_ci:refpage: vkCmdBuildAccelerationStructuresIndirectKHR 338e5c31af7Sopenharmony_ci:maxinstancecheck: pname:ppMaxPrimitiveCounts[i][j] 339e5c31af7Sopenharmony_ci 340e5c31af7Sopenharmony_ciTo build acceleration structures with some parameters sourced on the device 341e5c31af7Sopenharmony_cicall: 342e5c31af7Sopenharmony_ci 343e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdBuildAccelerationStructuresIndirectKHR.txt[] 344e5c31af7Sopenharmony_ci 345e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 346e5c31af7Sopenharmony_ci recorded. 347e5c31af7Sopenharmony_ci * pname:infoCount is the number of acceleration structures to build. 348e5c31af7Sopenharmony_ci * pname:pInfos is a pointer to an array of pname:infoCount 349e5c31af7Sopenharmony_ci slink:VkAccelerationStructureBuildGeometryInfoKHR structures defining 350e5c31af7Sopenharmony_ci the geometry used to build each acceleration structure. 351e5c31af7Sopenharmony_ci * pname:pIndirectDeviceAddresses is a pointer to an array of 352e5c31af7Sopenharmony_ci pname:infoCount buffer device addresses which point to 353e5c31af7Sopenharmony_ci pname:pInfos[i].pname:geometryCount 354e5c31af7Sopenharmony_ci slink:VkAccelerationStructureBuildRangeInfoKHR structures defining 355e5c31af7Sopenharmony_ci dynamic offsets to the addresses where geometry data is stored, as 356e5c31af7Sopenharmony_ci defined by pname:pInfos[i]. 357e5c31af7Sopenharmony_ci * pname:pIndirectStrides is a pointer to an array of pname:infoCount byte 358e5c31af7Sopenharmony_ci strides between elements of pname:pIndirectDeviceAddresses. 359e5c31af7Sopenharmony_ci * pname:ppMaxPrimitiveCounts is a pointer to an array of pname:infoCount 360e5c31af7Sopenharmony_ci pointers to arrays of pname:pInfos[i].pname:geometryCount values 361e5c31af7Sopenharmony_ci indicating the maximum number of primitives that will be built by this 362e5c31af7Sopenharmony_ci command for each geometry. 363e5c31af7Sopenharmony_ci 364e5c31af7Sopenharmony_ciAccesses to acceleration structures, scratch buffers, vertex buffers, index 365e5c31af7Sopenharmony_cibuffers, and instance buffers must be synchronized as with 366e5c31af7Sopenharmony_ci<<acceleration-structure-scratch,vkCmdBuildAccelerationStructuresKHR>>. 367e5c31af7Sopenharmony_ci 368e5c31af7Sopenharmony_ciAccesses to any element of pname:pIndirectDeviceAddresses must: be 369e5c31af7Sopenharmony_ci<<synchronization-dependencies,synchronized>> with the 370e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 371e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 372e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 373e5c31af7Sopenharmony_ciename:VK_ACCESS_INDIRECT_COMMAND_READ_BIT. 374e5c31af7Sopenharmony_ci 375e5c31af7Sopenharmony_ci 376e5c31af7Sopenharmony_ci.Valid Usage 377e5c31af7Sopenharmony_ci**** 378e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/build_acceleration_structure_common.txt[] 379e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/build_acceleration_structure_device_common.txt[] 380e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03645]] 381e5c31af7Sopenharmony_ci For any element of pname:pIndirectDeviceAddresses, if the buffer from 382e5c31af7Sopenharmony_ci which it was queried is non-sparse then it must: be bound completely and 383e5c31af7Sopenharmony_ci contiguously to a single slink:VkDeviceMemory object 384e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03646]] 385e5c31af7Sopenharmony_ci For any element of pname:pIndirectDeviceAddresses[i], all device 386e5c31af7Sopenharmony_ci addresses between pname:pIndirectDeviceAddresses[i] and 387e5c31af7Sopenharmony_ci [eq]#pname:pIndirectDeviceAddresses[i] {plus} 388e5c31af7Sopenharmony_ci (pname:pInfos[i].pname:geometryCount {times} pname:pIndirectStrides[i]) - 389e5c31af7Sopenharmony_ci 1# must: be in the buffer device address range of the same buffer 390e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03647]] 391e5c31af7Sopenharmony_ci For any element of pname:pIndirectDeviceAddresses, the buffer from which 392e5c31af7Sopenharmony_ci it was queried must: have been created with the 393e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set 394e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03648]] 395e5c31af7Sopenharmony_ci Each element of pname:pIndirectDeviceAddresses must: be a multiple of 396e5c31af7Sopenharmony_ci `4` 397e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-03787]] 398e5c31af7Sopenharmony_ci Each element of pname:pIndirectStrides must: be a multiple of `4` 399e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-commandBuffer-03649]] 400e5c31af7Sopenharmony_ci pname:commandBuffer must: not be a protected command buffer 401e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-accelerationStructureIndirectBuild-03650]] 402e5c31af7Sopenharmony_ci The <<features-accelerationStructureIndirectBuild, 403e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:accelerationStructureIndirectBuild>> 404e5c31af7Sopenharmony_ci feature must: be enabled 405e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-03651]] 406e5c31af7Sopenharmony_ci Each slink:VkAccelerationStructureBuildRangeInfoKHR structure referenced 407e5c31af7Sopenharmony_ci by any element of pname:pIndirectDeviceAddresses must: be a valid 408e5c31af7Sopenharmony_ci slink:VkAccelerationStructureBuildRangeInfoKHR structure 409e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03652]] 410e5c31af7Sopenharmony_ci pname:pInfos[i].pname:dstAccelerationStructure must: have been created 411e5c31af7Sopenharmony_ci with a value of slink:VkAccelerationStructureCreateInfoKHR::pname:size 412e5c31af7Sopenharmony_ci greater than or equal to the memory size required by the build 413e5c31af7Sopenharmony_ci operation, as returned by flink:vkGetAccelerationStructureBuildSizesKHR 414e5c31af7Sopenharmony_ci with [eq]#pname:pBuildInfo = pname:pInfos[i]# and 415e5c31af7Sopenharmony_ci [eq]#pname:pMaxPrimitiveCounts = pname:ppMaxPrimitiveCounts[i]# 416e5c31af7Sopenharmony_ci * [[VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-03653]] 417e5c31af7Sopenharmony_ci Each pname:ppMaxPrimitiveCounts[i][j] must: be greater than or equal to 418e5c31af7Sopenharmony_ci the the pname:primitiveCount value specified by the 419e5c31af7Sopenharmony_ci slink:VkAccelerationStructureBuildRangeInfoKHR structure located at 420e5c31af7Sopenharmony_ci [eq]#pname:pIndirectDeviceAddresses[i] {plus} (code:j {times} 421e5c31af7Sopenharmony_ci pname:pIndirectStrides[i])# 422e5c31af7Sopenharmony_ci**** 423e5c31af7Sopenharmony_ci 424e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdBuildAccelerationStructuresIndirectKHR.txt[] 425e5c31af7Sopenharmony_ci-- 426e5c31af7Sopenharmony_ci 427e5c31af7Sopenharmony_ci 428e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureBuildGeometryInfoKHR',desc='Structure specifying the geometry data used to build an acceleration structure',type='structs'] 429e5c31af7Sopenharmony_ci-- 430e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureBuildGeometryInfoKHR 431e5c31af7Sopenharmony_ci 432e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureBuildGeometryInfoKHR structure is defined 433e5c31af7Sopenharmony_cias: 434e5c31af7Sopenharmony_ci 435e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureBuildGeometryInfoKHR.txt[] 436e5c31af7Sopenharmony_ci 437e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 438e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 439e5c31af7Sopenharmony_ci structure. 440e5c31af7Sopenharmony_ci * pname:type is a elink:VkAccelerationStructureTypeKHR value specifying 441e5c31af7Sopenharmony_ci the type of acceleration structure being built. 442e5c31af7Sopenharmony_ci * pname:flags is a bitmask of 443e5c31af7Sopenharmony_ci elink:VkBuildAccelerationStructureFlagBitsKHR specifying additional 444e5c31af7Sopenharmony_ci parameters of the acceleration structure. 445e5c31af7Sopenharmony_ci * pname:mode is a elink:VkBuildAccelerationStructureModeKHR value 446e5c31af7Sopenharmony_ci specifying the type of operation to perform. 447e5c31af7Sopenharmony_ci * pname:srcAccelerationStructure is a pointer to an existing acceleration 448e5c31af7Sopenharmony_ci structure that is to be used to update the pname:dst acceleration 449e5c31af7Sopenharmony_ci structure when pname:mode is 450e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR. 451e5c31af7Sopenharmony_ci * pname:dstAccelerationStructure is a pointer to the target acceleration 452e5c31af7Sopenharmony_ci structure for the build. 453e5c31af7Sopenharmony_ci * pname:geometryCount specifies the number of geometries that will be 454e5c31af7Sopenharmony_ci built into pname:dstAccelerationStructure. 455e5c31af7Sopenharmony_ci * pname:pGeometries is a pointer to an array of 456e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryKHR structures. 457e5c31af7Sopenharmony_ci * pname:ppGeometries is a pointer to an array of pointers to 458e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryKHR structures. 459e5c31af7Sopenharmony_ci * pname:scratchData is the device or host address to memory that will be 460e5c31af7Sopenharmony_ci used as scratch memory for the build. 461e5c31af7Sopenharmony_ci 462e5c31af7Sopenharmony_ciOnly one of pname:pGeometries or pname:ppGeometries can: be a valid pointer, 463e5c31af7Sopenharmony_cithe other must: be `NULL`. 464e5c31af7Sopenharmony_ciEach element of the non-`NULL` array describes the data used to build each 465e5c31af7Sopenharmony_ciacceleration structure geometry. 466e5c31af7Sopenharmony_ci 467e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline,VK_KHR_ray_query[] 468e5c31af7Sopenharmony_ci[[acceleration-structure-geometry-index]] 469e5c31af7Sopenharmony_ciThe index of each element of the pname:pGeometries or pname:ppGeometries 470e5c31af7Sopenharmony_cimembers of slink:VkAccelerationStructureBuildGeometryInfoKHR is used as the 471e5c31af7Sopenharmony_ci_geometry index_ during ray traversal. 472e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_tracing_pipeline[] 473e5c31af7Sopenharmony_ciThe geometry index is available in ray shaders via the 474e5c31af7Sopenharmony_ci<<interfaces-builtin-variables-raygeometryindex,code:RayGeometryIndexKHR 475e5c31af7Sopenharmony_cibuilt-in>>, and is <<shader-binding-table-hit-shader-indexing, used to 476e5c31af7Sopenharmony_cidetermine hit and intersection shaders executed during traversal>>. 477e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline[] 478e5c31af7Sopenharmony_ciifdef::VK_KHR_ray_query[] 479e5c31af7Sopenharmony_ciThe geometry index is available to ray queries via the 480e5c31af7Sopenharmony_cicode:OpRayQueryGetIntersectionGeometryIndexKHR instruction. 481e5c31af7Sopenharmony_ciendif::VK_KHR_ray_query[] 482e5c31af7Sopenharmony_ciendif::VK_KHR_ray_tracing_pipeline,VK_KHR_ray_query[] 483e5c31af7Sopenharmony_ci 484e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 485e5c31af7Sopenharmony_ci[[acceleration-structure-motion-instances]] 486e5c31af7Sopenharmony_ciSetting ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags 487e5c31af7Sopenharmony_ciindicates that this build is a motion top level acceleration structure. 488e5c31af7Sopenharmony_ciA motion top level uses instances of format 489e5c31af7Sopenharmony_cislink:VkAccelerationStructureMotionInstanceNV if 490e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryInstancesDataKHR::pname:arrayOfPointers 491e5c31af7Sopenharmony_ciis ename:VK_FALSE. 492e5c31af7Sopenharmony_ci 493e5c31af7Sopenharmony_ciIf 494e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryInstancesDataKHR::pname:arrayOfPointers 495e5c31af7Sopenharmony_ciis ename:VK_TRUE, the pointer for any given element of the array of instance 496e5c31af7Sopenharmony_cipointers consists of 4 bits of 497e5c31af7Sopenharmony_ciename:VkAccelerationStructureMotionInstanceTypeNV in the low 4 bits of the 498e5c31af7Sopenharmony_cipointer identifying the type of structure at the pointer. 499e5c31af7Sopenharmony_ciThe device address accessed is the value in the array with the low 4 bits 500e5c31af7Sopenharmony_ciset to zero. 501e5c31af7Sopenharmony_ciThe structure at the pointer is one of 502e5c31af7Sopenharmony_cislink:VkAccelerationStructureInstanceKHR, 503e5c31af7Sopenharmony_cislink:VkAccelerationStructureMatrixMotionInstanceNV or 504e5c31af7Sopenharmony_cislink:VkAccelerationStructureSRTMotionInstanceNV, depending on the type 505e5c31af7Sopenharmony_civalue encoded in the low 4 bits. 506e5c31af7Sopenharmony_ci 507e5c31af7Sopenharmony_ciA top level acceleration structure with either motion instances or vertex 508e5c31af7Sopenharmony_cimotion in its instances must: set 509e5c31af7Sopenharmony_ciename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags. 510e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 511e5c31af7Sopenharmony_ci 512e5c31af7Sopenharmony_ciMembers pname:srcAccelerationStructure and pname:dstAccelerationStructure 513e5c31af7Sopenharmony_cimay: be the same or different for an update operation (when pname:mode is 514e5c31af7Sopenharmony_ciename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR). 515e5c31af7Sopenharmony_ciIf they are the same, the update happens in-place. 516e5c31af7Sopenharmony_ciOtherwise, the target acceleration structure is updated and the source is 517e5c31af7Sopenharmony_cinot modified. 518e5c31af7Sopenharmony_ci 519e5c31af7Sopenharmony_ci.Valid Usage 520e5c31af7Sopenharmony_ci**** 521e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03654]] 522e5c31af7Sopenharmony_ci pname:type must: not be ename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR 523e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-pGeometries-03788]] 524e5c31af7Sopenharmony_ci Only one of pname:pGeometries or pname:ppGeometries can: be a valid 525e5c31af7Sopenharmony_ci pointer, the other must: be `NULL` 526e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03789]] 527e5c31af7Sopenharmony_ci If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, the 528e5c31af7Sopenharmony_ci pname:geometryType member of elements of either pname:pGeometries or 529e5c31af7Sopenharmony_ci pname:ppGeometries must: be ename:VK_GEOMETRY_TYPE_INSTANCES_KHR 530e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03790]] 531e5c31af7Sopenharmony_ci If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, 532e5c31af7Sopenharmony_ci pname:geometryCount must: be `1` 533e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03791]] 534e5c31af7Sopenharmony_ci If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR 535e5c31af7Sopenharmony_ci the pname:geometryType member of elements of either pname:pGeometries or 536e5c31af7Sopenharmony_ci pname:ppGeometries must: not be ename:VK_GEOMETRY_TYPE_INSTANCES_KHR 537e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03792]] 538e5c31af7Sopenharmony_ci If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR 539e5c31af7Sopenharmony_ci then the pname:geometryType member of each geometry in either 540e5c31af7Sopenharmony_ci pname:pGeometries or pname:ppGeometries must: be the same 541e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03793]] 542e5c31af7Sopenharmony_ci If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR 543e5c31af7Sopenharmony_ci then pname:geometryCount must: be less than or equal to 544e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxGeometryCount 545e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03794]] 546e5c31af7Sopenharmony_ci If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR 547e5c31af7Sopenharmony_ci and the pname:geometryType member of either pname:pGeometries or 548e5c31af7Sopenharmony_ci pname:ppGeometries is ename:VK_GEOMETRY_TYPE_AABBS_KHR, the total number 549e5c31af7Sopenharmony_ci of AABBs in all geometries must: be less than or equal to 550e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxPrimitiveCount 551e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-03795]] 552e5c31af7Sopenharmony_ci If pname:type is ename:VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR 553e5c31af7Sopenharmony_ci and the pname:geometryType member of either pname:pGeometries or 554e5c31af7Sopenharmony_ci pname:ppGeometries is ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, the total 555e5c31af7Sopenharmony_ci number of triangles in all geometries must: be less than or equal to 556e5c31af7Sopenharmony_ci slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxPrimitiveCount 557e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-03796]] 558e5c31af7Sopenharmony_ci If pname:flags has the 559e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR bit set, 560e5c31af7Sopenharmony_ci then it must: not have the 561e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR bit set 562e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 563e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-dstAccelerationStructure-04927]] 564e5c31af7Sopenharmony_ci If pname:dstAccelerationStructure was created with 565e5c31af7Sopenharmony_ci ename:VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV set in 566e5c31af7Sopenharmony_ci slink:VkAccelerationStructureCreateInfoKHR::pname:flags, 567e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV must: be set in 568e5c31af7Sopenharmony_ci pname:flags 569e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-04928]] 570e5c31af7Sopenharmony_ci If ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV is set in 571e5c31af7Sopenharmony_ci pname:flags, pname:dstAccelerationStructure must: have been created with 572e5c31af7Sopenharmony_ci ename:VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV set in 573e5c31af7Sopenharmony_ci slink:VkAccelerationStructureCreateInfoKHR::pname:flags 574e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-04929]] 575e5c31af7Sopenharmony_ci If ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV is set in 576e5c31af7Sopenharmony_ci pname:flags, pname:type must: not be 577e5c31af7Sopenharmony_ci ename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR 578e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 579e5c31af7Sopenharmony_ci**** 580e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureBuildGeometryInfoKHR.txt[] 581e5c31af7Sopenharmony_ci-- 582e5c31af7Sopenharmony_ci 583e5c31af7Sopenharmony_ci[open,refpage='VkBuildAccelerationStructureModeKHR',desc='Enum specifying the type of build operation to perform',type='enums'] 584e5c31af7Sopenharmony_ci-- 585e5c31af7Sopenharmony_ci:refpage: VkBuildAccelerationStructureModeKHR 586e5c31af7Sopenharmony_ci 587e5c31af7Sopenharmony_ciThe ename:VkBuildAccelerationStructureModeKHR enumeration is defined as: 588e5c31af7Sopenharmony_ci 589e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkBuildAccelerationStructureModeKHR.txt[] 590e5c31af7Sopenharmony_ci 591e5c31af7Sopenharmony_ci * ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR specifies that the 592e5c31af7Sopenharmony_ci destination acceleration structure will be built using the specified 593e5c31af7Sopenharmony_ci geometries. 594e5c31af7Sopenharmony_ci * ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR specifies that the 595e5c31af7Sopenharmony_ci destination acceleration structure will be built using data in a source 596e5c31af7Sopenharmony_ci acceleration structure, updated by the specified geometries. 597e5c31af7Sopenharmony_ci-- 598e5c31af7Sopenharmony_ci 599e5c31af7Sopenharmony_ci[open,refpage='VkDeviceOrHostAddressKHR',desc='Union specifying a device or host address',type='structs'] 600e5c31af7Sopenharmony_ci-- 601e5c31af7Sopenharmony_ci:refpage: VkDeviceOrHostAddressKHR 602e5c31af7Sopenharmony_ci 603e5c31af7Sopenharmony_ciThe sname:VkDeviceOrHostAddressKHR union is defined as: 604e5c31af7Sopenharmony_ci 605e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceOrHostAddressKHR.txt[] 606e5c31af7Sopenharmony_ci 607e5c31af7Sopenharmony_ci * pname:deviceAddress is a buffer device address as returned by the 608e5c31af7Sopenharmony_ci flink:vkGetBufferDeviceAddressKHR command. 609e5c31af7Sopenharmony_ci * pname:hostAddress is a host memory address. 610e5c31af7Sopenharmony_ci 611e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceOrHostAddressKHR.txt[] 612e5c31af7Sopenharmony_ci-- 613e5c31af7Sopenharmony_ci 614e5c31af7Sopenharmony_ci[open,refpage='VkDeviceOrHostAddressConstKHR',desc='Union specifying a const device or host address',type='structs'] 615e5c31af7Sopenharmony_ci-- 616e5c31af7Sopenharmony_ci:refpage: VkDeviceOrHostAddressConstKHR 617e5c31af7Sopenharmony_ci 618e5c31af7Sopenharmony_ciThe sname:VkDeviceOrHostAddressConstKHR union is defined as: 619e5c31af7Sopenharmony_ci 620e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceOrHostAddressConstKHR.txt[] 621e5c31af7Sopenharmony_ci 622e5c31af7Sopenharmony_ci * pname:deviceAddress is a buffer device address as returned by the 623e5c31af7Sopenharmony_ci flink:vkGetBufferDeviceAddressKHR command. 624e5c31af7Sopenharmony_ci * pname:hostAddress is a const host memory address. 625e5c31af7Sopenharmony_ci 626e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceOrHostAddressConstKHR.txt[] 627e5c31af7Sopenharmony_ci-- 628e5c31af7Sopenharmony_ci 629e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureGeometryKHR',desc='Structure specifying geometries to be built into an acceleration structure',type='structs'] 630e5c31af7Sopenharmony_ci-- 631e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureGeometryKHR 632e5c31af7Sopenharmony_ci 633e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureGeometryKHR structure is defined as: 634e5c31af7Sopenharmony_ci 635e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureGeometryKHR.txt[] 636e5c31af7Sopenharmony_ci 637e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 638e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 639e5c31af7Sopenharmony_ci structure. 640e5c31af7Sopenharmony_ci * pname:geometryType describes which type of geometry this 641e5c31af7Sopenharmony_ci sname:VkAccelerationStructureGeometryKHR refers to. 642e5c31af7Sopenharmony_ci * pname:geometry is a slink:VkAccelerationStructureGeometryDataKHR union 643e5c31af7Sopenharmony_ci describing the geometry data for the relevant geometry type. 644e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkGeometryFlagBitsKHR values 645e5c31af7Sopenharmony_ci describing additional properties of how the geometry should be built. 646e5c31af7Sopenharmony_ci 647e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureGeometryKHR.txt[] 648e5c31af7Sopenharmony_ci-- 649e5c31af7Sopenharmony_ci 650e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureGeometryDataKHR',desc='Union specifying acceleration structure geometry data',type='structs'] 651e5c31af7Sopenharmony_ci-- 652e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureGeometryDataKHR 653e5c31af7Sopenharmony_ci 654e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureGeometryDataKHR union is defined as: 655e5c31af7Sopenharmony_ci 656e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureGeometryDataKHR.txt[] 657e5c31af7Sopenharmony_ci 658e5c31af7Sopenharmony_ci * pname:triangles is a 659e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR structure. 660e5c31af7Sopenharmony_ci * pname:aabbs is a slink:VkAccelerationStructureGeometryAabbsDataKHR 661e5c31af7Sopenharmony_ci struture. 662e5c31af7Sopenharmony_ci * pname:instances is a 663e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryInstancesDataKHR structure. 664e5c31af7Sopenharmony_ci 665e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureGeometryDataKHR.txt[] 666e5c31af7Sopenharmony_ci-- 667e5c31af7Sopenharmony_ci 668e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureGeometryTrianglesDataKHR',desc='Structure specifying a triangle geometry in a bottom-level acceleration structure',type='structs'] 669e5c31af7Sopenharmony_ci-- 670e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureGeometryTrianglesDataKHR 671e5c31af7Sopenharmony_ci 672e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureGeometryTrianglesDataKHR structure is 673e5c31af7Sopenharmony_cidefined as: 674e5c31af7Sopenharmony_ci 675e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureGeometryTrianglesDataKHR.txt[] 676e5c31af7Sopenharmony_ci 677e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 678e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 679e5c31af7Sopenharmony_ci structure. 680e5c31af7Sopenharmony_ci * pname:vertexFormat is the elink:VkFormat of each vertex element. 681e5c31af7Sopenharmony_ci * pname:vertexData is a device or host address to memory containing vertex 682e5c31af7Sopenharmony_ci data for this geometry. 683e5c31af7Sopenharmony_ci * pname:maxVertex is the highest index of a vertex that will be addressed 684e5c31af7Sopenharmony_ci by a build command using this structure. 685e5c31af7Sopenharmony_ci * pname:vertexStride is the stride in bytes between each vertex. 686e5c31af7Sopenharmony_ci * pname:indexType is the elink:VkIndexType of each index element. 687e5c31af7Sopenharmony_ci * pname:indexData is a device or host address to memory containing index 688e5c31af7Sopenharmony_ci data for this geometry. 689e5c31af7Sopenharmony_ci * pname:transformData is a device or host address to memory containing an 690e5c31af7Sopenharmony_ci optional reference to a slink:VkTransformMatrixKHR structure describing 691e5c31af7Sopenharmony_ci a transformation from the space in which the vertices in this geometry 692e5c31af7Sopenharmony_ci are described to the space in which the acceleration structure is 693e5c31af7Sopenharmony_ci defined. 694e5c31af7Sopenharmony_ci 695e5c31af7Sopenharmony_ci[NOTE] 696e5c31af7Sopenharmony_ci.Note 697e5c31af7Sopenharmony_ci==== 698e5c31af7Sopenharmony_ciUnlike the stride for vertex buffers in 699e5c31af7Sopenharmony_cislink:VkVertexInputBindingDescription for graphics pipelines which must not 700e5c31af7Sopenharmony_ciexceed pname:maxVertexInputBindingStride, pname:vertexStride for 701e5c31af7Sopenharmony_ciacceleration structure geometry is instead restricted to being a 32-bit 702e5c31af7Sopenharmony_civalue. 703e5c31af7Sopenharmony_ci==== 704e5c31af7Sopenharmony_ci 705e5c31af7Sopenharmony_ci.Valid Usage 706e5c31af7Sopenharmony_ci**** 707e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexStride-03735]] 708e5c31af7Sopenharmony_ci pname:vertexStride must: be a multiple of the size in bytes of the 709e5c31af7Sopenharmony_ci smallest component of pname:vertexFormat 710e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexStride-03819]] 711e5c31af7Sopenharmony_ci pname:vertexStride must: be less than or equal to [eq]#2^32^-1# 712e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexFormat-03797]] 713e5c31af7Sopenharmony_ci pname:vertexFormat must: support the 714e5c31af7Sopenharmony_ci ename:VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR in 715e5c31af7Sopenharmony_ci slink:VkFormatProperties::pname:bufferFeatures as returned by 716e5c31af7Sopenharmony_ci flink:vkGetPhysicalDeviceFormatProperties2 717e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureGeometryTrianglesDataKHR-indexType-03798]] 718e5c31af7Sopenharmony_ci pname:indexType must: be ename:VK_INDEX_TYPE_UINT16, 719e5c31af7Sopenharmony_ci ename:VK_INDEX_TYPE_UINT32, or ename:VK_INDEX_TYPE_NONE_KHR 720e5c31af7Sopenharmony_ci**** 721e5c31af7Sopenharmony_ci 722e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureGeometryTrianglesDataKHR.txt[] 723e5c31af7Sopenharmony_ci-- 724e5c31af7Sopenharmony_ci 725e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 726e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureGeometryMotionTrianglesDataNV',desc='Structure specifying vertex motion in a bottom-level acceleration structure',type='structs'] 727e5c31af7Sopenharmony_ci-- 728e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureGeometryMotionTrianglesDataNV 729e5c31af7Sopenharmony_ci 730e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureGeometryMotionTrianglesDataNV structure is 731e5c31af7Sopenharmony_cidefined as: 732e5c31af7Sopenharmony_ci 733e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureGeometryMotionTrianglesDataNV.txt[] 734e5c31af7Sopenharmony_ci 735e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 736e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 737e5c31af7Sopenharmony_ci structure. 738e5c31af7Sopenharmony_ci * pname:vertexData is a pointer to vertex data for this geometry at time 739e5c31af7Sopenharmony_ci 1.0 740e5c31af7Sopenharmony_ci 741e5c31af7Sopenharmony_ciIf sname:VkAccelerationStructureGeometryMotionTrianglesDataNV is included in 742e5c31af7Sopenharmony_cithe pname:pNext chain of a 743e5c31af7Sopenharmony_cislink:VkAccelerationStructureGeometryTrianglesDataKHR structure, the basic 744e5c31af7Sopenharmony_civertex positions are used for the position of the triangles in the geometry 745e5c31af7Sopenharmony_ciat time 0.0 and the pname:vertexData in 746e5c31af7Sopenharmony_cisname:VkAccelerationStructureGeometryMotionTrianglesDataNV is used for the 747e5c31af7Sopenharmony_civertex positions at time 1.0, with positions linearly interpolated at 748e5c31af7Sopenharmony_ciintermediate times. 749e5c31af7Sopenharmony_ci 750e5c31af7Sopenharmony_ciIndexing for sname:VkAccelerationStructureGeometryMotionTrianglesDataNV 751e5c31af7Sopenharmony_cipname:vertexData is equivalent to the basic vertex position data. 752e5c31af7Sopenharmony_ci 753e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureGeometryMotionTrianglesDataNV.txt[] 754e5c31af7Sopenharmony_ci-- 755e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 756e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 757e5c31af7Sopenharmony_ci 758e5c31af7Sopenharmony_ci[open,refpage='VkTransformMatrixKHR',desc='Structure specifying a 3x4 affine transformation matrix',type='structs',alias='VkTransformMatrixNV'] 759e5c31af7Sopenharmony_ci-- 760e5c31af7Sopenharmony_ci:refpage: VkTransformMatrixKHR 761e5c31af7Sopenharmony_ci 762e5c31af7Sopenharmony_ciThe sname:VkTransformMatrixKHR structure is defined as: 763e5c31af7Sopenharmony_ci 764e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkTransformMatrixKHR.txt[] 765e5c31af7Sopenharmony_ci 766e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 767e5c31af7Sopenharmony_cior the equivalent 768e5c31af7Sopenharmony_ci 769e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkTransformMatrixNV.txt[] 770e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 771e5c31af7Sopenharmony_ci 772e5c31af7Sopenharmony_ci * pname:matrix is a 3x4 row-major affine transformation matrix. 773e5c31af7Sopenharmony_ci 774e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkTransformMatrixKHR.txt[] 775e5c31af7Sopenharmony_ci 776e5c31af7Sopenharmony_ci.Valid Usage 777e5c31af7Sopenharmony_ci**** 778e5c31af7Sopenharmony_ci * [[VUID-VkTransformMatrixKHR-matrix-03799]] 779e5c31af7Sopenharmony_ci The first three columns of pname:matrix must: define an invertible 3x3 780e5c31af7Sopenharmony_ci matrix 781e5c31af7Sopenharmony_ci**** 782e5c31af7Sopenharmony_ci-- 783e5c31af7Sopenharmony_ci 784e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 785e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureGeometryAabbsDataKHR',desc='Structure specifying axis-aligned bounding box geometry in a bottom-level acceleration structure',type='structs'] 786e5c31af7Sopenharmony_ci-- 787e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureGeometryAabbsDataKHR 788e5c31af7Sopenharmony_ci 789e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureGeometryAabbsDataKHR structure is defined 790e5c31af7Sopenharmony_cias: 791e5c31af7Sopenharmony_ci 792e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureGeometryAabbsDataKHR.txt[] 793e5c31af7Sopenharmony_ci 794e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 795e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 796e5c31af7Sopenharmony_ci structure. 797e5c31af7Sopenharmony_ci * pname:data is a device or host address to memory containing 798e5c31af7Sopenharmony_ci slink:VkAabbPositionsKHR structures containing position data for each 799e5c31af7Sopenharmony_ci axis-aligned bounding box in the geometry. 800e5c31af7Sopenharmony_ci * pname:stride is the stride in bytes between each entry in pname:data. 801e5c31af7Sopenharmony_ci The stride must: be a multiple of `8`. 802e5c31af7Sopenharmony_ci 803e5c31af7Sopenharmony_ci.Valid Usage 804e5c31af7Sopenharmony_ci**** 805e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureGeometryAabbsDataKHR-stride-03545]] 806e5c31af7Sopenharmony_ci pname:stride must: be a multiple of `8` 807e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureGeometryAabbsDataKHR-stride-03820]] 808e5c31af7Sopenharmony_ci pname:stride must: be less than or equal to [eq]#2^32^-1# 809e5c31af7Sopenharmony_ci**** 810e5c31af7Sopenharmony_ci 811e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureGeometryAabbsDataKHR.txt[] 812e5c31af7Sopenharmony_ci-- 813e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 814e5c31af7Sopenharmony_ci 815e5c31af7Sopenharmony_ci[open,refpage='VkAabbPositionsKHR',desc='Structure specifying two opposing corners of an axis-aligned bounding box',type='structs',alias='VkAabbPositionsNV'] 816e5c31af7Sopenharmony_ci-- 817e5c31af7Sopenharmony_ci:refpage: VkAabbPositionsKHR 818e5c31af7Sopenharmony_ci 819e5c31af7Sopenharmony_ciThe sname:VkAabbPositionsKHR structure is defined as: 820e5c31af7Sopenharmony_ci 821e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAabbPositionsKHR.txt[] 822e5c31af7Sopenharmony_ci 823e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 824e5c31af7Sopenharmony_cior the equivalent 825e5c31af7Sopenharmony_ci 826e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAabbPositionsNV.txt[] 827e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 828e5c31af7Sopenharmony_ci 829e5c31af7Sopenharmony_ci 830e5c31af7Sopenharmony_ci * pname:minX is the x position of one opposing corner of a bounding box. 831e5c31af7Sopenharmony_ci * pname:minY is the y position of one opposing corner of a bounding box. 832e5c31af7Sopenharmony_ci * pname:minZ is the z position of one opposing corner of a bounding box. 833e5c31af7Sopenharmony_ci * pname:maxX is the x position of the other opposing corner of a bounding 834e5c31af7Sopenharmony_ci box. 835e5c31af7Sopenharmony_ci * pname:maxY is the y position of the other opposing corner of a bounding 836e5c31af7Sopenharmony_ci box. 837e5c31af7Sopenharmony_ci * pname:maxZ is the z position of the other opposing corner of a bounding 838e5c31af7Sopenharmony_ci box. 839e5c31af7Sopenharmony_ci 840e5c31af7Sopenharmony_ci.Valid Usage 841e5c31af7Sopenharmony_ci**** 842e5c31af7Sopenharmony_ci * [[VUID-VkAabbPositionsKHR-minX-03546]] 843e5c31af7Sopenharmony_ci pname:minX must: be less than or equal to pname:maxX 844e5c31af7Sopenharmony_ci * [[VUID-VkAabbPositionsKHR-minY-03547]] 845e5c31af7Sopenharmony_ci pname:minY must: be less than or equal to pname:maxY 846e5c31af7Sopenharmony_ci * [[VUID-VkAabbPositionsKHR-minZ-03548]] 847e5c31af7Sopenharmony_ci pname:minZ must: be less than or equal to pname:maxZ 848e5c31af7Sopenharmony_ci**** 849e5c31af7Sopenharmony_ci 850e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAabbPositionsKHR.txt[] 851e5c31af7Sopenharmony_ci-- 852e5c31af7Sopenharmony_ci 853e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 854e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureGeometryInstancesDataKHR',desc='Structure specifying a geometry consisting of instances of other acceleration structures',type='structs'] 855e5c31af7Sopenharmony_ci-- 856e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureGeometryInstancesDataKHR 857e5c31af7Sopenharmony_ci 858e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureGeometryInstancesDataKHR structure is 859e5c31af7Sopenharmony_cidefined as: 860e5c31af7Sopenharmony_ci 861e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureGeometryInstancesDataKHR.txt[] 862e5c31af7Sopenharmony_ci 863e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 864e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 865e5c31af7Sopenharmony_ci structure. 866e5c31af7Sopenharmony_ci * pname:arrayOfPointers specifies whether pname:data is used as an array 867e5c31af7Sopenharmony_ci of addresses or just an array. 868e5c31af7Sopenharmony_ci * pname:data is either the address of an array of device or host addresses 869e5c31af7Sopenharmony_ci referencing individual slink:VkAccelerationStructureInstanceKHR 870e5c31af7Sopenharmony_ci structures 871e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 872e5c31af7Sopenharmony_ci or packed motion instance information as described in 873e5c31af7Sopenharmony_ci <<acceleration-structure-motion-instances, motion instances>> 874e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 875e5c31af7Sopenharmony_ci if pname:arrayOfPointers is ename:VK_TRUE, or the address of an array of 876e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInstanceKHR 877e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 878e5c31af7Sopenharmony_ci or slink:VkAccelerationStructureMotionInstanceNV 879e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 880e5c31af7Sopenharmony_ci structures. 881e5c31af7Sopenharmony_ci Addresses and slink:VkAccelerationStructureInstanceKHR structures are 882e5c31af7Sopenharmony_ci tightly packed. 883e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 884e5c31af7Sopenharmony_ci slink:VkAccelerationStructureMotionInstanceNV structures have a stride 885e5c31af7Sopenharmony_ci of 160 bytes. 886e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 887e5c31af7Sopenharmony_ci 888e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureGeometryInstancesDataKHR.txt[] 889e5c31af7Sopenharmony_ci-- 890e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 891e5c31af7Sopenharmony_ci 892e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureInstanceKHR',desc='Structure specifying a single acceleration structure instance for building into an acceleration structure geometry',type='structs',alias='VkAccelerationStructureInstanceNV'] 893e5c31af7Sopenharmony_ci-- 894e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureInstanceKHR 895e5c31af7Sopenharmony_ci 896e5c31af7Sopenharmony_ci_Acceleration structure instances_ can: be built into top-level acceleration 897e5c31af7Sopenharmony_cistructures. 898e5c31af7Sopenharmony_ciEach acceleration structure instance is a separate entry in the top-level 899e5c31af7Sopenharmony_ciacceleration structure which includes all the geometry of a bottom-level 900e5c31af7Sopenharmony_ciacceleration structure at a transformed location. 901e5c31af7Sopenharmony_ciMultiple instances can: point to the same bottom level acceleration 902e5c31af7Sopenharmony_cistructure. 903e5c31af7Sopenharmony_ci 904e5c31af7Sopenharmony_ciAn acceleration structure instance is defined by the structure: 905e5c31af7Sopenharmony_ci 906e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureInstanceKHR.txt[] 907e5c31af7Sopenharmony_ci 908e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 909e5c31af7Sopenharmony_cior the equivalent 910e5c31af7Sopenharmony_ci 911e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureInstanceNV.txt[] 912e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 913e5c31af7Sopenharmony_ci 914e5c31af7Sopenharmony_ci * pname:transform is a slink:VkTransformMatrixKHR structure describing a 915e5c31af7Sopenharmony_ci transformation to be applied to the acceleration structure. 916e5c31af7Sopenharmony_ci * pname:instanceCustomIndex is a 24-bit user-specified index value 917e5c31af7Sopenharmony_ci accessible to ray shaders in the code:InstanceCustomIndexKHR built-in. 918e5c31af7Sopenharmony_ci * pname:mask is an 8-bit visibility mask for the geometry. 919e5c31af7Sopenharmony_ci The instance may: only be hit if `Cull Mask & instance.mask != 0` 920e5c31af7Sopenharmony_ci * pname:instanceShaderBindingTableRecordOffset is a 24-bit offset used in 921e5c31af7Sopenharmony_ci calculating the hit shader binding table index. 922e5c31af7Sopenharmony_ci * pname:flags is an 8-bit mask of elink:VkGeometryInstanceFlagBitsKHR 923e5c31af7Sopenharmony_ci values to apply to this instance. 924e5c31af7Sopenharmony_ci * pname:accelerationStructureReference is either: 925e5c31af7Sopenharmony_ci ** a device address containing the value obtained from 926e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[flink:vkGetAccelerationStructureDeviceAddressKHR] 927e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or] 928e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[flink:vkGetAccelerationStructureHandleNV] 929e5c31af7Sopenharmony_ci (used by device operations which reference acceleration structures) or, 930e5c31af7Sopenharmony_ci ** a slink:VkAccelerationStructureKHR object (used by host operations 931e5c31af7Sopenharmony_ci which reference acceleration structures). 932e5c31af7Sopenharmony_ci 933e5c31af7Sopenharmony_ciThe C language specification does not define the ordering of bit-fields, but 934e5c31af7Sopenharmony_ciin practice, this struct produces the correct layout with existing 935e5c31af7Sopenharmony_cicompilers. 936e5c31af7Sopenharmony_ciThe intended bit pattern is for the following: 937e5c31af7Sopenharmony_ci 938e5c31af7Sopenharmony_ci * pname:instanceCustomIndex and pname:mask occupy the same memory as if a 939e5c31af7Sopenharmony_ci single code:uint32_t was specified in their place 940e5c31af7Sopenharmony_ci ** pname:instanceCustomIndex occupies the 24 least significant bits of 941e5c31af7Sopenharmony_ci that memory 942e5c31af7Sopenharmony_ci ** pname:mask occupies the 8 most significant bits of that memory 943e5c31af7Sopenharmony_ci * pname:instanceShaderBindingTableRecordOffset and pname:flags occupy the 944e5c31af7Sopenharmony_ci same memory as if a single code:uint32_t was specified in their place 945e5c31af7Sopenharmony_ci ** pname:instanceShaderBindingTableRecordOffset occupies the 24 least 946e5c31af7Sopenharmony_ci significant bits of that memory 947e5c31af7Sopenharmony_ci ** pname:flags occupies the 8 most significant bits of that memory 948e5c31af7Sopenharmony_ci 949e5c31af7Sopenharmony_ciIf a compiler produces code that diverges from that pattern, applications 950e5c31af7Sopenharmony_cimust: employ another method to set values according to the correct bit 951e5c31af7Sopenharmony_cipattern. 952e5c31af7Sopenharmony_ci 953e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureInstanceKHR.txt[] 954e5c31af7Sopenharmony_ci-- 955e5c31af7Sopenharmony_ci 956e5c31af7Sopenharmony_ci[open,refpage='VkGeometryInstanceFlagBitsKHR',desc='Instance flag bits',type='enums',alias='VkGeometryInstanceFlagBitsNV'] 957e5c31af7Sopenharmony_ci-- 958e5c31af7Sopenharmony_ci:refpage: VkGeometryInstanceFlagBitsKHR 959e5c31af7Sopenharmony_ci 960e5c31af7Sopenharmony_ciPossible values of pname:flags in the instance modifying the behavior of 961e5c31af7Sopenharmony_cithat instance are: 962e5c31af7Sopenharmony_ci 963e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkGeometryInstanceFlagBitsKHR.txt[] 964e5c31af7Sopenharmony_ci 965e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 966e5c31af7Sopenharmony_cior the equivalent 967e5c31af7Sopenharmony_ci 968e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkGeometryInstanceFlagBitsNV.txt[] 969e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 970e5c31af7Sopenharmony_ci 971e5c31af7Sopenharmony_ci * ename:VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR disables 972e5c31af7Sopenharmony_ci face culling for this instance. 973e5c31af7Sopenharmony_ci * ename:VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR indicates that 974e5c31af7Sopenharmony_ci the <<ray-traversal-culling-face, facing determination>> for geometry in 975e5c31af7Sopenharmony_ci this instance is inverted. 976e5c31af7Sopenharmony_ci Because the facing is determined in object space, an instance transform 977e5c31af7Sopenharmony_ci does not change the winding, but a geometry transform does. 978e5c31af7Sopenharmony_ci * ename:VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR causes this instance to 979e5c31af7Sopenharmony_ci act as though ename:VK_GEOMETRY_OPAQUE_BIT_KHR were specified on all 980e5c31af7Sopenharmony_ci geometries referenced by this instance. 981e5c31af7Sopenharmony_ci This behavior can: be overridden by the SPIR-V code:NoOpaqueKHR ray 982e5c31af7Sopenharmony_ci flag. 983e5c31af7Sopenharmony_ci * ename:VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR causes this instance 984e5c31af7Sopenharmony_ci to act as though ename:VK_GEOMETRY_OPAQUE_BIT_KHR were not specified on 985e5c31af7Sopenharmony_ci all geometries referenced by this instance. 986e5c31af7Sopenharmony_ci This behavior can: be overridden by the SPIR-V code:OpaqueKHR ray flag. 987e5c31af7Sopenharmony_ci 988e5c31af7Sopenharmony_ciename:VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR and 989e5c31af7Sopenharmony_ciename:VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR must: not be used in the 990e5c31af7Sopenharmony_cisame flag. 991e5c31af7Sopenharmony_ci-- 992e5c31af7Sopenharmony_ci 993e5c31af7Sopenharmony_ci[open,refpage='VkGeometryInstanceFlagsKHR',desc='Bitmask of VkGeometryInstanceFlagBitsKHR',type='flags',alias='VkGeometryInstanceFlagsNV'] 994e5c31af7Sopenharmony_ci-- 995e5c31af7Sopenharmony_ci:refpage: VkGeometryInstanceFlagsKHR 996e5c31af7Sopenharmony_ci 997e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkGeometryInstanceFlagsKHR.txt[] 998e5c31af7Sopenharmony_ci 999e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 1000e5c31af7Sopenharmony_cior the equivalent 1001e5c31af7Sopenharmony_ci 1002e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkGeometryInstanceFlagsNV.txt[] 1003e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 1004e5c31af7Sopenharmony_ci 1005e5c31af7Sopenharmony_citname:VkGeometryInstanceFlagsKHR is a bitmask type for setting a mask of 1006e5c31af7Sopenharmony_cizero or more elink:VkGeometryInstanceFlagBitsKHR. 1007e5c31af7Sopenharmony_ci-- 1008e5c31af7Sopenharmony_ci 1009e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 1010e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMotionInstanceNV',desc='Structure specifying a single acceleration structure motion instance for building into an acceleration structure geometry',type='structs'] 1011e5c31af7Sopenharmony_ci-- 1012e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureMotionInstanceNV 1013e5c31af7Sopenharmony_ci 1014e5c31af7Sopenharmony_ci_Acceleration structure motion instances_ can: be built into top-level 1015e5c31af7Sopenharmony_ciacceleration structures. 1016e5c31af7Sopenharmony_ciEach acceleration structure instance is a separate entry in the top-level 1017e5c31af7Sopenharmony_ciacceleration structure which includes all the geometry of a bottom-level 1018e5c31af7Sopenharmony_ciacceleration structure at a transformed location including a type of motion 1019e5c31af7Sopenharmony_ciand parameters to determine the motion of the instance over time. 1020e5c31af7Sopenharmony_ci 1021e5c31af7Sopenharmony_ciAn acceleration structure motion instance is defined by the structure: 1022e5c31af7Sopenharmony_ci 1023e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureMotionInstanceNV.txt[] 1024e5c31af7Sopenharmony_ci 1025e5c31af7Sopenharmony_ci * pname:type is a elink:VkAccelerationStructureMotionInstanceTypeNV 1026e5c31af7Sopenharmony_ci enumerant identifying which type of motion instance this is and which 1027e5c31af7Sopenharmony_ci type of the union is valid. 1028e5c31af7Sopenharmony_ci * pname:flags is currently unused, but is required to keep natural 1029e5c31af7Sopenharmony_ci alignment of pname:data. 1030e5c31af7Sopenharmony_ci * pname:data is a slink:VkAccelerationStructureMotionInstanceDataNV 1031e5c31af7Sopenharmony_ci containing motion instance data for this instance. 1032e5c31af7Sopenharmony_ci 1033e5c31af7Sopenharmony_ci[NOTE] 1034e5c31af7Sopenharmony_ci.Note 1035e5c31af7Sopenharmony_ci==== 1036e5c31af7Sopenharmony_ciIf writing this other than with a standard C compiler, note that the final 1037e5c31af7Sopenharmony_cistructure should be 152 bytes in size. 1038e5c31af7Sopenharmony_ci==== 1039e5c31af7Sopenharmony_ci 1040e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureMotionInstanceNV.txt[] 1041e5c31af7Sopenharmony_ci-- 1042e5c31af7Sopenharmony_ci 1043e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMotionInstanceDataNV',desc='Union specifying a acceleration structure motion instance data for building into an acceleration structure geometry',type='structs'] 1044e5c31af7Sopenharmony_ci-- 1045e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureMotionInstanceDataNV 1046e5c31af7Sopenharmony_ci 1047e5c31af7Sopenharmony_ciAcceleration structure motion instance is defined by the union: 1048e5c31af7Sopenharmony_ci 1049e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureMotionInstanceDataNV.txt[] 1050e5c31af7Sopenharmony_ci 1051e5c31af7Sopenharmony_ci * pname:staticInstance is a slink:VkAccelerationStructureInstanceKHR 1052e5c31af7Sopenharmony_ci structure containing data for a static instance. 1053e5c31af7Sopenharmony_ci * pname:matrixMotionInstance is a 1054e5c31af7Sopenharmony_ci slink:VkAccelerationStructureMatrixMotionInstanceNV structure containing 1055e5c31af7Sopenharmony_ci data for a matrix motion instance. 1056e5c31af7Sopenharmony_ci * pname:srtMotionInstance is a 1057e5c31af7Sopenharmony_ci slink:VkAccelerationStructureSRTMotionInstanceNV structure containing 1058e5c31af7Sopenharmony_ci data for an SRT motion instance. 1059e5c31af7Sopenharmony_ci 1060e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureMotionInstanceDataNV.txt[] 1061e5c31af7Sopenharmony_ci-- 1062e5c31af7Sopenharmony_ci 1063e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMotionInstanceFlagsNV',desc='Reserved for future use',type='flags'] 1064e5c31af7Sopenharmony_ci-- 1065e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkAccelerationStructureMotionInstanceFlagsNV.txt[] 1066e5c31af7Sopenharmony_ci 1067e5c31af7Sopenharmony_citname:VkAccelerationStructureMotionInstanceFlagsNV is a bitmask type for 1068e5c31af7Sopenharmony_cisetting a mask, but is currently reserved for future use. 1069e5c31af7Sopenharmony_ci-- 1070e5c31af7Sopenharmony_ci 1071e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMotionInstanceTypeNV',desc='Enum specifying a type of acceleration structure motion instance data for building into an acceleration structure geometry',type='enums'] 1072e5c31af7Sopenharmony_ci-- 1073e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureMotionInstanceTypeNV 1074e5c31af7Sopenharmony_ci 1075e5c31af7Sopenharmony_ciThe ename:VkAccelerationStructureMotionInstanceTypeNV enumeration is defined 1076e5c31af7Sopenharmony_cias: 1077e5c31af7Sopenharmony_ci 1078e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAccelerationStructureMotionInstanceTypeNV.txt[] 1079e5c31af7Sopenharmony_ci 1080e5c31af7Sopenharmony_ci * ename:VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV specifies 1081e5c31af7Sopenharmony_ci that the instance is a static instance with no instance motion. 1082e5c31af7Sopenharmony_ci * ename:VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV 1083e5c31af7Sopenharmony_ci specifies that the instance is a motion instance with motion specified 1084e5c31af7Sopenharmony_ci by interpolation between two matrices. 1085e5c31af7Sopenharmony_ci * ename:VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV 1086e5c31af7Sopenharmony_ci specifies that the instance is a motion instance with motion specified 1087e5c31af7Sopenharmony_ci by interpolation in the SRT decomposition. 1088e5c31af7Sopenharmony_ci-- 1089e5c31af7Sopenharmony_ci 1090e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureMatrixMotionInstanceNV',desc='Structure specifying a single acceleration structure matrix motion instance for building into an acceleration structure geometry',type='structs'] 1091e5c31af7Sopenharmony_ci-- 1092e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureMatrixMotionInstanceNV 1093e5c31af7Sopenharmony_ci 1094e5c31af7Sopenharmony_ciAn acceleration structure matrix motion instance is defined by the 1095e5c31af7Sopenharmony_cistructure: 1096e5c31af7Sopenharmony_ci 1097e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureMatrixMotionInstanceNV.txt[] 1098e5c31af7Sopenharmony_ci 1099e5c31af7Sopenharmony_ci * pname:transformT0 is a slink:VkTransformMatrixKHR structure describing a 1100e5c31af7Sopenharmony_ci transformation to be applied to the acceleration structure at time 0. 1101e5c31af7Sopenharmony_ci * pname:transformT1 is a slink:VkTransformMatrixKHR structure describing a 1102e5c31af7Sopenharmony_ci transformation to be applied to the acceleration structure at time 1. 1103e5c31af7Sopenharmony_ci * pname:instanceCustomIndex is a 24-bit user-specified index value 1104e5c31af7Sopenharmony_ci accessible to ray shaders in the code:InstanceCustomIndexKHR built-in. 1105e5c31af7Sopenharmony_ci * pname:mask is an 8-bit visibility mask for the geometry. 1106e5c31af7Sopenharmony_ci The instance may: only be hit if `Cull Mask & instance.mask != 0` 1107e5c31af7Sopenharmony_ci * pname:instanceShaderBindingTableRecordOffset is a 24-bit offset used in 1108e5c31af7Sopenharmony_ci calculating the hit shader binding table index. 1109e5c31af7Sopenharmony_ci * pname:flags is an 8-bit mask of elink:VkGeometryInstanceFlagBitsKHR 1110e5c31af7Sopenharmony_ci values to apply to this instance. 1111e5c31af7Sopenharmony_ci * pname:accelerationStructureReference is either: 1112e5c31af7Sopenharmony_ci ** a device address containing the value obtained from 1113e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[flink:vkGetAccelerationStructureDeviceAddressKHR] 1114e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or] 1115e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[flink:vkGetAccelerationStructureHandleNV] 1116e5c31af7Sopenharmony_ci (used by device operations which reference acceleration structures) or, 1117e5c31af7Sopenharmony_ci ** a slink:VkAccelerationStructureKHR object (used by host operations 1118e5c31af7Sopenharmony_ci which reference acceleration structures). 1119e5c31af7Sopenharmony_ci 1120e5c31af7Sopenharmony_ciThe C language specification does not define the ordering of bit-fields, but 1121e5c31af7Sopenharmony_ciin practice, this struct produces the correct layout with existing 1122e5c31af7Sopenharmony_cicompilers. 1123e5c31af7Sopenharmony_ciThe intended bit pattern is for the following: 1124e5c31af7Sopenharmony_ci 1125e5c31af7Sopenharmony_ci * pname:instanceCustomIndex and pname:mask occupy the same memory as if a 1126e5c31af7Sopenharmony_ci single code:uint32_t was specified in their place 1127e5c31af7Sopenharmony_ci ** pname:instanceCustomIndex occupies the 24 least significant bits of 1128e5c31af7Sopenharmony_ci that memory 1129e5c31af7Sopenharmony_ci ** pname:mask occupies the 8 most significant bits of that memory 1130e5c31af7Sopenharmony_ci * pname:instanceShaderBindingTableRecordOffset and pname:flags occupy the 1131e5c31af7Sopenharmony_ci same memory as if a single code:uint32_t was specified in their place 1132e5c31af7Sopenharmony_ci ** pname:instanceShaderBindingTableRecordOffset occupies the 24 least 1133e5c31af7Sopenharmony_ci significant bits of that memory 1134e5c31af7Sopenharmony_ci ** pname:flags occupies the 8 most significant bits of that memory 1135e5c31af7Sopenharmony_ci 1136e5c31af7Sopenharmony_ciIf a compiler produces code that diverges from that pattern, applications 1137e5c31af7Sopenharmony_cimust: employ another method to set values according to the correct bit 1138e5c31af7Sopenharmony_cipattern. 1139e5c31af7Sopenharmony_ci 1140e5c31af7Sopenharmony_ciThe transform for a matrix motion instance at a point in time is derived by 1141e5c31af7Sopenharmony_cicomponent-wise linear interpolation of the two transforms. 1142e5c31af7Sopenharmony_ciThat is, for a code:time in [0,1] the resulting transform is 1143e5c31af7Sopenharmony_ci 1144e5c31af7Sopenharmony_ci {empty}:: [eq]#pname:transformT0 {times} (1 - code:time) {plus} 1145e5c31af7Sopenharmony_ci pname:transformT1 {times} code:time# 1146e5c31af7Sopenharmony_ci 1147e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureMatrixMotionInstanceNV.txt[] 1148e5c31af7Sopenharmony_ci-- 1149e5c31af7Sopenharmony_ci 1150e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureSRTMotionInstanceNV',desc='Structure specifying a single acceleration structure SRT motion instance for building into an acceleration structure geometry',type='structs'] 1151e5c31af7Sopenharmony_ci-- 1152e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureSRTMotionInstanceNV 1153e5c31af7Sopenharmony_ci 1154e5c31af7Sopenharmony_ciAn acceleration structure SRT motion instance is defined by the structure: 1155e5c31af7Sopenharmony_ci 1156e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureSRTMotionInstanceNV.txt[] 1157e5c31af7Sopenharmony_ci 1158e5c31af7Sopenharmony_ci * pname:transformT0 is a slink:VkSRTDataNV structure describing a 1159e5c31af7Sopenharmony_ci transformation to be applied to the acceleration structure at time 0. 1160e5c31af7Sopenharmony_ci * pname:transformT1 is a slink:VkSRTDataNV structure describing a 1161e5c31af7Sopenharmony_ci transformation to be applied to the acceleration structure at time 1. 1162e5c31af7Sopenharmony_ci * pname:instanceCustomIndex is a 24-bit user-specified index value 1163e5c31af7Sopenharmony_ci accessible to ray shaders in the code:InstanceCustomIndexKHR built-in. 1164e5c31af7Sopenharmony_ci * pname:mask is an 8-bit visibility mask for the geometry. 1165e5c31af7Sopenharmony_ci The instance may: only be hit if `Cull Mask & instance.mask != 0` 1166e5c31af7Sopenharmony_ci * pname:instanceShaderBindingTableRecordOffset is a 24-bit offset used in 1167e5c31af7Sopenharmony_ci calculating the hit shader binding table index. 1168e5c31af7Sopenharmony_ci * pname:flags is an 8-bit mask of elink:VkGeometryInstanceFlagBitsKHR 1169e5c31af7Sopenharmony_ci values to apply to this instance. 1170e5c31af7Sopenharmony_ci * pname:accelerationStructureReference is either: 1171e5c31af7Sopenharmony_ci ** a device address containing the value obtained from 1172e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[flink:vkGetAccelerationStructureDeviceAddressKHR] 1173e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or] 1174e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[flink:vkGetAccelerationStructureHandleNV] 1175e5c31af7Sopenharmony_ci (used by device operations which reference acceleration structures) or, 1176e5c31af7Sopenharmony_ci ** a slink:VkAccelerationStructureKHR object (used by host operations 1177e5c31af7Sopenharmony_ci which reference acceleration structures). 1178e5c31af7Sopenharmony_ci 1179e5c31af7Sopenharmony_ciThe C language specification does not define the ordering of bit-fields, but 1180e5c31af7Sopenharmony_ciin practice, this struct produces the correct layout with existing 1181e5c31af7Sopenharmony_cicompilers. 1182e5c31af7Sopenharmony_ciThe intended bit pattern is for the following: 1183e5c31af7Sopenharmony_ci 1184e5c31af7Sopenharmony_ci * pname:instanceCustomIndex and pname:mask occupy the same memory as if a 1185e5c31af7Sopenharmony_ci single code:uint32_t was specified in their place 1186e5c31af7Sopenharmony_ci ** pname:instanceCustomIndex occupies the 24 least significant bits of 1187e5c31af7Sopenharmony_ci that memory 1188e5c31af7Sopenharmony_ci ** pname:mask occupies the 8 most significant bits of that memory 1189e5c31af7Sopenharmony_ci * pname:instanceShaderBindingTableRecordOffset and pname:flags occupy the 1190e5c31af7Sopenharmony_ci same memory as if a single code:uint32_t was specified in their place 1191e5c31af7Sopenharmony_ci ** pname:instanceShaderBindingTableRecordOffset occupies the 24 least 1192e5c31af7Sopenharmony_ci significant bits of that memory 1193e5c31af7Sopenharmony_ci ** pname:flags occupies the 8 most significant bits of that memory 1194e5c31af7Sopenharmony_ci 1195e5c31af7Sopenharmony_ciIf a compiler produces code that diverges from that pattern, applications 1196e5c31af7Sopenharmony_cimust: employ another method to set values according to the correct bit 1197e5c31af7Sopenharmony_cipattern. 1198e5c31af7Sopenharmony_ci 1199e5c31af7Sopenharmony_ciThe transform for a SRT motion instance at a point in time is derived from 1200e5c31af7Sopenharmony_cicomponent-wise linear interpolation of the two SRT transforms. 1201e5c31af7Sopenharmony_ciThat is, for a code:time in [0,1] the resulting transform is 1202e5c31af7Sopenharmony_ci 1203e5c31af7Sopenharmony_ci {empty}:: [eq]#pname:transformT0 {times} (1 - code:time) {plus} 1204e5c31af7Sopenharmony_ci pname:transformT1 {times} code:time# 1205e5c31af7Sopenharmony_ci 1206e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureSRTMotionInstanceNV.txt[] 1207e5c31af7Sopenharmony_ci-- 1208e5c31af7Sopenharmony_ci 1209e5c31af7Sopenharmony_ci[open,refpage='VkSRTDataNV',desc='Structure specifying a transform in SRT decomposition',type='structs'] 1210e5c31af7Sopenharmony_ci-- 1211e5c31af7Sopenharmony_ci:refpage: VkSRTDataNV 1212e5c31af7Sopenharmony_ci 1213e5c31af7Sopenharmony_ciAn acceleration structure SRT transform is defined by the structure: 1214e5c31af7Sopenharmony_ci 1215e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSRTDataNV.txt[] 1216e5c31af7Sopenharmony_ci 1217e5c31af7Sopenharmony_ci * pname:sx is the x component of the scale of the transform 1218e5c31af7Sopenharmony_ci * pname:a is one component of the shear for the transform 1219e5c31af7Sopenharmony_ci * pname:b is one component of the shear for the transform 1220e5c31af7Sopenharmony_ci * pname:pvx is the x component of the pivot point of the transform 1221e5c31af7Sopenharmony_ci * pname:sy is the y component of the scale of the transform 1222e5c31af7Sopenharmony_ci * pname:c is one component of the shear for the transform 1223e5c31af7Sopenharmony_ci * pname:pvy is the y component of the pivot point of the transform 1224e5c31af7Sopenharmony_ci * pname:sz is the z component of the scale of the transform 1225e5c31af7Sopenharmony_ci * pname:pvz is the z component of the pivot point of the transform 1226e5c31af7Sopenharmony_ci * pname:qx is the x component of the rotation quaternion 1227e5c31af7Sopenharmony_ci * pname:qy is the y component of the rotation quaternion 1228e5c31af7Sopenharmony_ci * pname:qz is the z component of the rotation quaternion 1229e5c31af7Sopenharmony_ci * pname:qw is the w component of the rotation quaternion 1230e5c31af7Sopenharmony_ci * pname:tx is the x component of the post-rotation translation 1231e5c31af7Sopenharmony_ci * pname:ty is the y component of the post-rotation translation 1232e5c31af7Sopenharmony_ci * pname:tz is the z component of the post-rotation translation 1233e5c31af7Sopenharmony_ci 1234e5c31af7Sopenharmony_ciThis transform decomposition consists of three elements. 1235e5c31af7Sopenharmony_ciThe first is a matrix S, consisting of a scale, shear, and translation, 1236e5c31af7Sopenharmony_ciusually used to define the pivot point of the following rotation. 1237e5c31af7Sopenharmony_ciThis matrix is constructed from the parameters above by: 1238e5c31af7Sopenharmony_ci 1239e5c31af7Sopenharmony_ci[latexmath] 1240e5c31af7Sopenharmony_ci++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1241e5c31af7Sopenharmony_ciS = 1242e5c31af7Sopenharmony_ci\left( 1243e5c31af7Sopenharmony_ci \begin{matrix} 1244e5c31af7Sopenharmony_ci sx & a & b & pvx \\ 1245e5c31af7Sopenharmony_ci 0 & sy & c & pvy \\ 1246e5c31af7Sopenharmony_ci 0 & 0 & sz & pvz 1247e5c31af7Sopenharmony_ci \end{matrix} 1248e5c31af7Sopenharmony_ci\right) 1249e5c31af7Sopenharmony_ci++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1250e5c31af7Sopenharmony_ci 1251e5c31af7Sopenharmony_ciThe rotation quaternion is defined as: 1252e5c31af7Sopenharmony_ci 1253e5c31af7Sopenharmony_ci {empty}:: [eq]#code:R = [ pname:qx, pname:qy, pname:qz, pname:qw ]# 1254e5c31af7Sopenharmony_ci 1255e5c31af7Sopenharmony_ciThis is a rotation around a conceptual normalized axis [eq]#[ ax, ay, az ]# 1256e5c31af7Sopenharmony_ciof amount code:theta such that: 1257e5c31af7Sopenharmony_ci 1258e5c31af7Sopenharmony_ci {empty}:: [eq]#[ pname:qx, pname:qy, pname:qz ] = sin(code:theta/2) 1259e5c31af7Sopenharmony_ci {times} [ code:ax, code:ay, code:az ]# 1260e5c31af7Sopenharmony_ci 1261e5c31af7Sopenharmony_ciand 1262e5c31af7Sopenharmony_ci 1263e5c31af7Sopenharmony_ci {empty}:: [eq]#pname:qw = cos(code:theta/2)# 1264e5c31af7Sopenharmony_ci 1265e5c31af7Sopenharmony_ciFinally, the transform has a translation T constructed from the parameters 1266e5c31af7Sopenharmony_ciabove by: 1267e5c31af7Sopenharmony_ci 1268e5c31af7Sopenharmony_ci[latexmath] 1269e5c31af7Sopenharmony_ci++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1270e5c31af7Sopenharmony_ciT = 1271e5c31af7Sopenharmony_ci\left( 1272e5c31af7Sopenharmony_ci \begin{matrix} 1273e5c31af7Sopenharmony_ci 1 & 0 & 0 & tx \\ 1274e5c31af7Sopenharmony_ci 0 & 1 & 0 & ty \\ 1275e5c31af7Sopenharmony_ci 0 & 0 & 1 & tz 1276e5c31af7Sopenharmony_ci \end{matrix} 1277e5c31af7Sopenharmony_ci\right) 1278e5c31af7Sopenharmony_ci++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1279e5c31af7Sopenharmony_ci 1280e5c31af7Sopenharmony_ciThe effective derived transform is then given by 1281e5c31af7Sopenharmony_ci 1282e5c31af7Sopenharmony_ci {empty}:: [eq]#code:T {times} code:R {times} code:S# 1283e5c31af7Sopenharmony_ci 1284e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSRTDataNV.txt[] 1285e5c31af7Sopenharmony_ci-- 1286e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 1287e5c31af7Sopenharmony_ci 1288e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 1289e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureBuildRangeInfoKHR',desc='Structure specifying build offsets and counts for acceleration structure builds',type='structs'] 1290e5c31af7Sopenharmony_ci-- 1291e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureBuildOffsetInfoKHR 1292e5c31af7Sopenharmony_ci 1293e5c31af7Sopenharmony_cisname:VkAccelerationStructureBuildRangeInfoKHR is defined as: 1294e5c31af7Sopenharmony_ci 1295e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureBuildRangeInfoKHR.txt[] 1296e5c31af7Sopenharmony_ci 1297e5c31af7Sopenharmony_ci * pname:primitiveCount defines the number of primitives for a 1298e5c31af7Sopenharmony_ci corresponding acceleration structure geometry. 1299e5c31af7Sopenharmony_ci * pname:primitiveOffset defines an offset in bytes into the memory where 1300e5c31af7Sopenharmony_ci primitive data is defined. 1301e5c31af7Sopenharmony_ci * pname:firstVertex is the index of the first vertex to build from for 1302e5c31af7Sopenharmony_ci triangle geometry. 1303e5c31af7Sopenharmony_ci * pname:transformOffset defines an offset in bytes into the memory where a 1304e5c31af7Sopenharmony_ci transform matrix is defined. 1305e5c31af7Sopenharmony_ci 1306e5c31af7Sopenharmony_ciThe primitive count and primitive offset are interpreted differently 1307e5c31af7Sopenharmony_cidepending on the elink:VkGeometryTypeKHR used: 1308e5c31af7Sopenharmony_ci 1309e5c31af7Sopenharmony_ci * For geometries of type ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, 1310e5c31af7Sopenharmony_ci pname:primitiveCount is the number of triangles to be built, where each 1311e5c31af7Sopenharmony_ci triangle is treated as 3 vertices. 1312e5c31af7Sopenharmony_ci ** If the geometry uses indices, [eq]#pname:primitiveCount {times} 3# 1313e5c31af7Sopenharmony_ci indices are consumed from 1314e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:indexData, 1315e5c31af7Sopenharmony_ci starting at an offset of pname:primitiveOffset. 1316e5c31af7Sopenharmony_ci The value of pname:firstVertex is added to the index values before 1317e5c31af7Sopenharmony_ci fetching vertices. 1318e5c31af7Sopenharmony_ci ** If the geometry does not use indices, [eq]#pname:primitiveCount {times} 1319e5c31af7Sopenharmony_ci 3# vertices are consumed from 1320e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:vertexData, 1321e5c31af7Sopenharmony_ci starting at an offset of [eq]#pname:primitiveOffset {plus} 1322e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:vertexStride 1323e5c31af7Sopenharmony_ci {times} pname:firstVertex#. 1324e5c31af7Sopenharmony_ci ** If 1325e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:transformData 1326e5c31af7Sopenharmony_ci is not `NULL`, a single slink:VkTransformMatrixKHR structure is 1327e5c31af7Sopenharmony_ci consumed from 1328e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:transformData, 1329e5c31af7Sopenharmony_ci at an offset of pname:transformOffset. 1330e5c31af7Sopenharmony_ci This matrix describes a transformation from the space in which the 1331e5c31af7Sopenharmony_ci vertices for all triangles in this geometry are described to the space 1332e5c31af7Sopenharmony_ci in which the acceleration structure is defined. 1333e5c31af7Sopenharmony_ci * For geometries of type ename:VK_GEOMETRY_TYPE_AABBS_KHR, 1334e5c31af7Sopenharmony_ci pname:primitiveCount is the number of axis-aligned bounding boxes. 1335e5c31af7Sopenharmony_ci pname:primitiveCount slink:VkAabbPositionsKHR structures are consumed 1336e5c31af7Sopenharmony_ci from slink:VkAccelerationStructureGeometryAabbsDataKHR::pname:data, 1337e5c31af7Sopenharmony_ci starting at an offset of pname:primitiveOffset. 1338e5c31af7Sopenharmony_ci * For geometries of type ename:VK_GEOMETRY_TYPE_INSTANCES_KHR, 1339e5c31af7Sopenharmony_ci pname:primitiveCount is the number of acceleration structures. 1340e5c31af7Sopenharmony_ci pname:primitiveCount slink:VkAccelerationStructureInstanceKHR 1341e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 1342e5c31af7Sopenharmony_ci or slink:VkAccelerationStructureMotionInstanceNV 1343e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 1344e5c31af7Sopenharmony_ci structures are consumed from 1345e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryInstancesDataKHR::pname:data, 1346e5c31af7Sopenharmony_ci starting at an offset of pname:primitiveOffset. 1347e5c31af7Sopenharmony_ci 1348e5c31af7Sopenharmony_ci.Valid Usage 1349e5c31af7Sopenharmony_ci**** 1350e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03656]] 1351e5c31af7Sopenharmony_ci For geometries of type ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, if the 1352e5c31af7Sopenharmony_ci geometry uses indices, the offset pname:primitiveOffset from 1353e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:indexData 1354e5c31af7Sopenharmony_ci must: be a multiple of the element size of 1355e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:indexType 1356e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03657]] 1357e5c31af7Sopenharmony_ci For geometries of type ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, if the 1358e5c31af7Sopenharmony_ci geometry does not use indices, the offset pname:primitiveOffset from 1359e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:vertexData 1360e5c31af7Sopenharmony_ci must: be a multiple of the component size of 1361e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:vertexFormat 1362e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildRangeInfoKHR-transformOffset-03658]] 1363e5c31af7Sopenharmony_ci For geometries of type ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, the offset 1364e5c31af7Sopenharmony_ci pname:transformOffset from 1365e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryTrianglesDataKHR::pname:transformData 1366e5c31af7Sopenharmony_ci must: be a multiple of 16 1367e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03659]] 1368e5c31af7Sopenharmony_ci For geometries of type ename:VK_GEOMETRY_TYPE_AABBS_KHR, the offset 1369e5c31af7Sopenharmony_ci pname:primitiveOffset from 1370e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryAabbsDataKHR::pname:data must: be a 1371e5c31af7Sopenharmony_ci multiple of 8 1372e5c31af7Sopenharmony_ci * [[VUID-VkAccelerationStructureBuildRangeInfoKHR-primitiveOffset-03660]] 1373e5c31af7Sopenharmony_ci For geometries of type ename:VK_GEOMETRY_TYPE_INSTANCES_KHR, the offset 1374e5c31af7Sopenharmony_ci pname:primitiveOffset from 1375e5c31af7Sopenharmony_ci slink:VkAccelerationStructureGeometryInstancesDataKHR::pname:data must: 1376e5c31af7Sopenharmony_ci be a multiple of 16 1377e5c31af7Sopenharmony_ci**** 1378e5c31af7Sopenharmony_ci 1379e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureBuildRangeInfoKHR.txt[] 1380e5c31af7Sopenharmony_ci-- 1381e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 1382e5c31af7Sopenharmony_ci 1383e5c31af7Sopenharmony_ci 1384e5c31af7Sopenharmony_ci[[acceleration-structure-copying]] 1385e5c31af7Sopenharmony_ci=== Copying Acceleration Structures 1386e5c31af7Sopenharmony_ci 1387e5c31af7Sopenharmony_ciAn additional command exists for copying acceleration structures without 1388e5c31af7Sopenharmony_ciupdating their contents. 1389e5c31af7Sopenharmony_ciThe acceleration structure object can: be compacted in order to improve 1390e5c31af7Sopenharmony_ciperformance. 1391e5c31af7Sopenharmony_ciBefore copying, an application must: query the size of the resulting 1392e5c31af7Sopenharmony_ciacceleration structure. 1393e5c31af7Sopenharmony_ci 1394e5c31af7Sopenharmony_ci[open,refpage='vkCmdWriteAccelerationStructuresPropertiesKHR',desc='Write acceleration structure result parameters to query results.',type='protos'] 1395e5c31af7Sopenharmony_ci-- 1396e5c31af7Sopenharmony_ci:refpage: vkCmdWriteAccelerationStructuresPropertiesKHR 1397e5c31af7Sopenharmony_ci 1398e5c31af7Sopenharmony_ciTo query acceleration structure size parameters call: 1399e5c31af7Sopenharmony_ci 1400e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 1401e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdWriteAccelerationStructuresPropertiesKHR.txt[] 1402e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 1403e5c31af7Sopenharmony_ci 1404e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 1405e5c31af7Sopenharmony_ci recorded. 1406e5c31af7Sopenharmony_ci * pname:accelerationStructureCount is the count of acceleration structures 1407e5c31af7Sopenharmony_ci for which to query the property. 1408e5c31af7Sopenharmony_ci * pname:pAccelerationStructures is a pointer to an array of existing 1409e5c31af7Sopenharmony_ci previously built acceleration structures. 1410e5c31af7Sopenharmony_ci * pname:queryType is a elink:VkQueryType value specifying the type of 1411e5c31af7Sopenharmony_ci queries managed by the pool. 1412e5c31af7Sopenharmony_ci * pname:queryPool is the query pool that will manage the results of the 1413e5c31af7Sopenharmony_ci query. 1414e5c31af7Sopenharmony_ci * pname:firstQuery is the first query index within the query pool that 1415e5c31af7Sopenharmony_ci will contain the pname:accelerationStructureCount number of results. 1416e5c31af7Sopenharmony_ci 1417e5c31af7Sopenharmony_ciAccesses to any of the acceleration structures listed in 1418e5c31af7Sopenharmony_cipname:pAccelerationStructures must: be <<synchronization-dependencies, 1419e5c31af7Sopenharmony_cisynchronized>> with the 1420e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 1421e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 1422e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 1423e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR. 1424e5c31af7Sopenharmony_ci 1425e5c31af7Sopenharmony_ci * If pname:queryType is 1426e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR, then the 1427e5c31af7Sopenharmony_ci value written out is the number of bytes required by a compacted 1428e5c31af7Sopenharmony_ci acceleration structure. 1429e5c31af7Sopenharmony_ci * If pname:queryType is 1430e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR, then 1431e5c31af7Sopenharmony_ci the value written out is the number of bytes required by a serialized 1432e5c31af7Sopenharmony_ci acceleration structure. 1433e5c31af7Sopenharmony_ci 1434e5c31af7Sopenharmony_ci.Valid Usage 1435e5c31af7Sopenharmony_ci**** 1436e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryPool-02493]] 1437e5c31af7Sopenharmony_ci pname:queryPool must: have been created with a pname:queryType matching 1438e5c31af7Sopenharmony_ci pname:queryType 1439e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryPool-02494]] 1440e5c31af7Sopenharmony_ci The queries identified by pname:queryPool and pname:firstQuery must: be 1441e5c31af7Sopenharmony_ci _unavailable_ 1442e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-buffer-03736]] 1443e5c31af7Sopenharmony_ci The pname:buffer used to create each acceleration structure in 1444e5c31af7Sopenharmony_ci pname:pAccelerationStructures must: be bound to device memory 1445e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-query-04880]] 1446e5c31af7Sopenharmony_ci The sum of pname:query plus pname:accelerationStructureCount must: be 1447e5c31af7Sopenharmony_ci less than or equal to the number of queries in pname:queryPool 1448e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/write_acceleration_structure_properties_common.txt[] 1449e5c31af7Sopenharmony_ci**** 1450e5c31af7Sopenharmony_ci 1451e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdWriteAccelerationStructuresPropertiesKHR.txt[] 1452e5c31af7Sopenharmony_ci-- 1453e5c31af7Sopenharmony_ci 1454e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 1455e5c31af7Sopenharmony_ci[open,refpage='vkCmdWriteAccelerationStructuresPropertiesNV',desc='Write acceleration structure result parameters to query results.',type='protos'] 1456e5c31af7Sopenharmony_ci-- 1457e5c31af7Sopenharmony_ci:refpage: vkCmdWriteAccelerationStructuresPropertiesNV 1458e5c31af7Sopenharmony_ci 1459e5c31af7Sopenharmony_ciTo query acceleration structure size parameters call: 1460e5c31af7Sopenharmony_ci 1461e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdWriteAccelerationStructuresPropertiesNV.txt[] 1462e5c31af7Sopenharmony_ci 1463e5c31af7Sopenharmony_ci 1464e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 1465e5c31af7Sopenharmony_ci recorded. 1466e5c31af7Sopenharmony_ci * pname:accelerationStructureCount is the count of acceleration structures 1467e5c31af7Sopenharmony_ci for which to query the property. 1468e5c31af7Sopenharmony_ci * pname:pAccelerationStructures is a pointer to an array of existing 1469e5c31af7Sopenharmony_ci previously built acceleration structures. 1470e5c31af7Sopenharmony_ci * pname:queryType is a elink:VkQueryType value specifying the type of 1471e5c31af7Sopenharmony_ci queries managed by the pool. 1472e5c31af7Sopenharmony_ci * pname:queryPool is the query pool that will manage the results of the 1473e5c31af7Sopenharmony_ci query. 1474e5c31af7Sopenharmony_ci * pname:firstQuery is the first query index within the query pool that 1475e5c31af7Sopenharmony_ci will contain the pname:accelerationStructureCount number of results. 1476e5c31af7Sopenharmony_ci 1477e5c31af7Sopenharmony_ciAccesses to any of the acceleration structures listed in 1478e5c31af7Sopenharmony_cipname:pAccelerationStructures must: be <<synchronization-dependencies, 1479e5c31af7Sopenharmony_cisynchronized>> with the 1480e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 1481e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 1482e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 1483e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR. 1484e5c31af7Sopenharmony_ci 1485e5c31af7Sopenharmony_ci.Valid Usage 1486e5c31af7Sopenharmony_ci**** 1487e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryPool-03755]] 1488e5c31af7Sopenharmony_ci pname:queryPool must: have been created with a pname:queryType matching 1489e5c31af7Sopenharmony_ci pname:queryType 1490e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryPool-03756]] 1491e5c31af7Sopenharmony_ci The queries identified by pname:queryPool and pname:firstQuery must: be 1492e5c31af7Sopenharmony_ci _unavailable_ 1493e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesNV-accelerationStructure-03757]] 1494e5c31af7Sopenharmony_ci pname:accelerationStructure must: be bound completely and contiguously 1495e5c31af7Sopenharmony_ci to a single sname:VkDeviceMemory object via 1496e5c31af7Sopenharmony_ci flink:vkBindAccelerationStructureMemoryNV 1497e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesNV-pAccelerationStructures-04958]] 1498e5c31af7Sopenharmony_ci All acceleration structures in pname:pAccelerationStructures must: have 1499e5c31af7Sopenharmony_ci been built prior to the execution of this command 1500e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesNV-pAccelerationStructures-06215]] 1501e5c31af7Sopenharmony_ci All acceleration structures in pname:pAccelerationStructures must: have 1502e5c31af7Sopenharmony_ci been built with 1503e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR if 1504e5c31af7Sopenharmony_ci pname:queryType is 1505e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV 1506e5c31af7Sopenharmony_ci * [[VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryType-06216]] 1507e5c31af7Sopenharmony_ci pname:queryType must: be 1508e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV 1509e5c31af7Sopenharmony_ci**** 1510e5c31af7Sopenharmony_ci 1511e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdWriteAccelerationStructuresPropertiesNV.txt[] 1512e5c31af7Sopenharmony_ci-- 1513e5c31af7Sopenharmony_ci 1514e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyAccelerationStructureNV',desc='Copy an acceleration structure',type='protos'] 1515e5c31af7Sopenharmony_ci-- 1516e5c31af7Sopenharmony_ci:refpage: vkCmdCopyAccelerationStructureNV 1517e5c31af7Sopenharmony_ci 1518e5c31af7Sopenharmony_ciTo copy an acceleration structure call: 1519e5c31af7Sopenharmony_ci 1520e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyAccelerationStructureNV.txt[] 1521e5c31af7Sopenharmony_ci 1522e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 1523e5c31af7Sopenharmony_ci recorded. 1524e5c31af7Sopenharmony_ci * pname:dst is the target acceleration structure for the copy. 1525e5c31af7Sopenharmony_ci * pname:src is the source acceleration structure for the copy. 1526e5c31af7Sopenharmony_ci * pname:mode is a elink:VkCopyAccelerationStructureModeKHR value 1527e5c31af7Sopenharmony_ci specifying additional operations to perform during the copy. 1528e5c31af7Sopenharmony_ci 1529e5c31af7Sopenharmony_ciAccesses to pname:src and pname:dst must: be <<synchronization-dependencies, 1530e5c31af7Sopenharmony_cisynchronized>> with the 1531e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 1532e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 1533e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 1534e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR or 1535e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR as appropriate. 1536e5c31af7Sopenharmony_ci 1537e5c31af7Sopenharmony_ci.Valid Usage 1538e5c31af7Sopenharmony_ci**** 1539e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_acceleration_structure_common.txt[] 1540e5c31af7Sopenharmony_ci**** 1541e5c31af7Sopenharmony_ci 1542e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyAccelerationStructureNV.txt[] 1543e5c31af7Sopenharmony_ci-- 1544e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 1545e5c31af7Sopenharmony_ci 1546e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 1547e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyAccelerationStructureKHR',desc='Copy an acceleration structure',type='protos'] 1548e5c31af7Sopenharmony_ci-- 1549e5c31af7Sopenharmony_ci:refpage: vkCmdCopyAccelerationStructureKHR 1550e5c31af7Sopenharmony_ci 1551e5c31af7Sopenharmony_ciTo copy an acceleration structure call: 1552e5c31af7Sopenharmony_ci 1553e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyAccelerationStructureKHR.txt[] 1554e5c31af7Sopenharmony_ci 1555e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 1556e5c31af7Sopenharmony_ci recorded. 1557e5c31af7Sopenharmony_ci * pname:pInfo is a pointer to a slink:VkCopyAccelerationStructureInfoKHR 1558e5c31af7Sopenharmony_ci structure defining the copy operation. 1559e5c31af7Sopenharmony_ci 1560e5c31af7Sopenharmony_ciThis command copies the pname:pInfo->src acceleration structure to the 1561e5c31af7Sopenharmony_cipname:pInfo->dst acceleration structure in the manner specified by 1562e5c31af7Sopenharmony_cipname:pInfo->mode. 1563e5c31af7Sopenharmony_ci 1564e5c31af7Sopenharmony_ciAccesses to pname:pInfo->src and pname:pInfo->dst must: be 1565e5c31af7Sopenharmony_ci<<synchronization-dependencies, synchronized>> with the 1566e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 1567e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 1568e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 1569e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR or 1570e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR as appropriate. 1571e5c31af7Sopenharmony_ci 1572e5c31af7Sopenharmony_ci.Valid Usage 1573e5c31af7Sopenharmony_ci**** 1574e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyAccelerationStructureKHR-buffer-03737]] 1575e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->src must: be bound to 1576e5c31af7Sopenharmony_ci device memory 1577e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyAccelerationStructureKHR-buffer-03738]] 1578e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->dst must: be bound to 1579e5c31af7Sopenharmony_ci device memory 1580e5c31af7Sopenharmony_ci**** 1581e5c31af7Sopenharmony_ci 1582e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyAccelerationStructureKHR.txt[] 1583e5c31af7Sopenharmony_ci-- 1584e5c31af7Sopenharmony_ci 1585e5c31af7Sopenharmony_ci[open,refpage='VkCopyAccelerationStructureInfoKHR',desc='Parameters for copying an acceleration structure',type='structs'] 1586e5c31af7Sopenharmony_ci-- 1587e5c31af7Sopenharmony_ci:refpage: VkCopyAccelerationStructureInfoKHR 1588e5c31af7Sopenharmony_ci 1589e5c31af7Sopenharmony_ciThe sname:VkCopyAccelerationStructureInfoKHR structure is defined as: 1590e5c31af7Sopenharmony_ci 1591e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyAccelerationStructureInfoKHR.txt[] 1592e5c31af7Sopenharmony_ci 1593e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 1594e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1595e5c31af7Sopenharmony_ci structure. 1596e5c31af7Sopenharmony_ci * pname:src is the source acceleration structure for the copy. 1597e5c31af7Sopenharmony_ci * pname:dst is the target acceleration structure for the copy. 1598e5c31af7Sopenharmony_ci * pname:mode is a elink:VkCopyAccelerationStructureModeKHR value 1599e5c31af7Sopenharmony_ci specifying additional operations to perform during the copy. 1600e5c31af7Sopenharmony_ci 1601e5c31af7Sopenharmony_ci.Valid Usage 1602e5c31af7Sopenharmony_ci**** 1603e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/copy_acceleration_structure_common.txt[] 1604e5c31af7Sopenharmony_ci**** 1605e5c31af7Sopenharmony_ci 1606e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyAccelerationStructureInfoKHR.txt[] 1607e5c31af7Sopenharmony_ci-- 1608e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 1609e5c31af7Sopenharmony_ci 1610e5c31af7Sopenharmony_ci[open,refpage='VkCopyAccelerationStructureModeKHR',desc='Acceleration structure copy mode',type='enums',alias='VkCopyAccelerationStructureModeNV'] 1611e5c31af7Sopenharmony_ci-- 1612e5c31af7Sopenharmony_ci:refpage: VkCopyAccelerationStructureModeKHR 1613e5c31af7Sopenharmony_ci 1614e5c31af7Sopenharmony_ciPossible values of pname:mode specifying additional operations to perform 1615e5c31af7Sopenharmony_ciduring the copy, are: 1616e5c31af7Sopenharmony_ci 1617e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCopyAccelerationStructureModeKHR.txt[] 1618e5c31af7Sopenharmony_ci 1619e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[] 1620e5c31af7Sopenharmony_cior the equivalent 1621e5c31af7Sopenharmony_ci 1622e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCopyAccelerationStructureModeNV.txt[] 1623e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[] 1624e5c31af7Sopenharmony_ci 1625e5c31af7Sopenharmony_ci * ename:VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR creates a direct 1626e5c31af7Sopenharmony_ci copy of the acceleration structure specified in pname:src into the one 1627e5c31af7Sopenharmony_ci specified by pname:dst. 1628e5c31af7Sopenharmony_ci The pname:dst acceleration structure must: have been created with the 1629e5c31af7Sopenharmony_ci same parameters as pname:src. 1630e5c31af7Sopenharmony_ci If pname:src contains references to other acceleration structures, 1631e5c31af7Sopenharmony_ci pname:dst will reference the same acceleration structures. 1632e5c31af7Sopenharmony_ci * ename:VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR creates a more 1633e5c31af7Sopenharmony_ci compact version of an acceleration structure pname:src into pname:dst. 1634e5c31af7Sopenharmony_ci The acceleration structure pname:dst must: have been created with a size 1635e5c31af7Sopenharmony_ci at least as large as that returned by 1636e5c31af7Sopenharmony_ci flink:vkCmdWriteAccelerationStructuresPropertiesKHR 1637e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[] 1638e5c31af7Sopenharmony_ci or flink:vkWriteAccelerationStructuresPropertiesKHR 1639e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[] 1640e5c31af7Sopenharmony_ci after the build of the acceleration structure specified by pname:src. 1641e5c31af7Sopenharmony_ci If pname:src contains references to other acceleration structures, 1642e5c31af7Sopenharmony_ci pname:dst will reference the same acceleration structures. 1643e5c31af7Sopenharmony_ci * ename:VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR serializes the 1644e5c31af7Sopenharmony_ci acceleration structure to a semi-opaque format which can be reloaded on 1645e5c31af7Sopenharmony_ci a compatible implementation. 1646e5c31af7Sopenharmony_ci * ename:VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR deserializes 1647e5c31af7Sopenharmony_ci the semi-opaque serialization format in the buffer to the acceleration 1648e5c31af7Sopenharmony_ci structure. 1649e5c31af7Sopenharmony_ci-- 1650e5c31af7Sopenharmony_ci 1651e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyAccelerationStructureToMemoryKHR',desc='Copy an acceleration structure to device memory',type='protos'] 1652e5c31af7Sopenharmony_ci-- 1653e5c31af7Sopenharmony_ci:refpage: vkCmdCopyAccelerationStructureToMemoryKHR 1654e5c31af7Sopenharmony_ci 1655e5c31af7Sopenharmony_ciTo copy an acceleration structure to device memory call: 1656e5c31af7Sopenharmony_ci 1657e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyAccelerationStructureToMemoryKHR.txt[] 1658e5c31af7Sopenharmony_ci 1659e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 1660e5c31af7Sopenharmony_ci recorded. 1661e5c31af7Sopenharmony_ci * pname:pInfo is an a pointer to a 1662e5c31af7Sopenharmony_ci slink:VkCopyAccelerationStructureToMemoryInfoKHR structure defining the 1663e5c31af7Sopenharmony_ci copy operation. 1664e5c31af7Sopenharmony_ci 1665e5c31af7Sopenharmony_ciAccesses to pname:pInfo->src must: be <<synchronization-dependencies, 1666e5c31af7Sopenharmony_cisynchronized>> with the 1667e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 1668e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 1669e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 1670e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR. 1671e5c31af7Sopenharmony_ciAccesses to the buffer indicated by pname:pInfo->dst.deviceAddress must: be 1672e5c31af7Sopenharmony_cisynchronized with the 1673e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR pipeline stage 1674e5c31af7Sopenharmony_ciand an access type of ename:VK_ACCESS_TRANSFER_WRITE_BIT. 1675e5c31af7Sopenharmony_ci 1676e5c31af7Sopenharmony_ciThis command produces the same results as 1677e5c31af7Sopenharmony_ciflink:vkCopyAccelerationStructureToMemoryKHR, but writes its result to a 1678e5c31af7Sopenharmony_cidevice address, and is executed on the device rather than the host. 1679e5c31af7Sopenharmony_ciThe output may: not necessarily be bit-for-bit identical, but it can be 1680e5c31af7Sopenharmony_ciequally used by either flink:vkCmdCopyMemoryToAccelerationStructureKHR or 1681e5c31af7Sopenharmony_ciflink:vkCopyMemoryToAccelerationStructureKHR. 1682e5c31af7Sopenharmony_ci 1683e5c31af7Sopenharmony_ciThe defined header structure for the serialized data consists of: 1684e5c31af7Sopenharmony_ci 1685e5c31af7Sopenharmony_ci * ename:VK_UUID_SIZE bytes of data matching 1686e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceIDProperties::pname:driverUUID 1687e5c31af7Sopenharmony_ci * ename:VK_UUID_SIZE bytes of data identifying the compatibility for 1688e5c31af7Sopenharmony_ci comparison using flink:vkGetDeviceAccelerationStructureCompatibilityKHR 1689e5c31af7Sopenharmony_ci * A 64-bit integer of the total size matching the value queried using 1690e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR 1691e5c31af7Sopenharmony_ci * A 64-bit integer of the deserialized size to be passed in to 1692e5c31af7Sopenharmony_ci sname:VkAccelerationStructureCreateInfoKHR::pname:size 1693e5c31af7Sopenharmony_ci * A 64-bit integer of the count of the number of acceleration structure 1694e5c31af7Sopenharmony_ci handles following. 1695e5c31af7Sopenharmony_ci This will be zero for a bottom-level acceleration structure. 1696e5c31af7Sopenharmony_ci For top-level acceleration structures this number is 1697e5c31af7Sopenharmony_ci implementation-dependent; the number of and ordering of the handles may 1698e5c31af7Sopenharmony_ci not match the instance descriptions which were used to build the 1699e5c31af7Sopenharmony_ci acceleration structure. 1700e5c31af7Sopenharmony_ci 1701e5c31af7Sopenharmony_ciThe corresponding handles matching the values returned by 1702e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[flink:vkGetAccelerationStructureDeviceAddressKHR] 1703e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or] 1704e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[flink:vkGetAccelerationStructureHandleNV] 1705e5c31af7Sopenharmony_ciare tightly packed in the buffer following the count. 1706e5c31af7Sopenharmony_ciThe application is expected to store a mapping between those handles and the 1707e5c31af7Sopenharmony_cioriginal application-generated bottom-level acceleration structures to 1708e5c31af7Sopenharmony_ciprovide when deserializing. 1709e5c31af7Sopenharmony_ciThe serialized data is written to the buffer (or read from the buffer) 1710e5c31af7Sopenharmony_ciaccording to the host endianness. 1711e5c31af7Sopenharmony_ci 1712e5c31af7Sopenharmony_ci.Valid Usage 1713e5c31af7Sopenharmony_ci**** 1714e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-03739]] 1715e5c31af7Sopenharmony_ci pname:pInfo->dst.deviceAddress must: be a valid device address for a 1716e5c31af7Sopenharmony_ci buffer bound to device memory 1717e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-03740]] 1718e5c31af7Sopenharmony_ci pname:pInfo->dst.deviceAddress must: be aligned to `256` bytes 1719e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-03741]] 1720e5c31af7Sopenharmony_ci If the buffer pointed to by pname:pInfo->dst.deviceAddress is non-sparse 1721e5c31af7Sopenharmony_ci then it must: be bound completely and contiguously to a single 1722e5c31af7Sopenharmony_ci slink:VkDeviceMemory object 1723e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyAccelerationStructureToMemoryKHR-None-03559]] 1724e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->src must: be bound to 1725e5c31af7Sopenharmony_ci device memory 1726e5c31af7Sopenharmony_ci**** 1727e5c31af7Sopenharmony_ci 1728e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyAccelerationStructureToMemoryKHR.txt[] 1729e5c31af7Sopenharmony_ci-- 1730e5c31af7Sopenharmony_ci 1731e5c31af7Sopenharmony_ci[open,refpage='VkCopyAccelerationStructureToMemoryInfoKHR',desc='Parameters for serializing an acceleration structure',type='structs'] 1732e5c31af7Sopenharmony_ci-- 1733e5c31af7Sopenharmony_ci:refpage: VkCopyAccelerationStructureToMemoryInfoKHR 1734e5c31af7Sopenharmony_ci 1735e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyAccelerationStructureToMemoryInfoKHR.txt[] 1736e5c31af7Sopenharmony_ci 1737e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 1738e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1739e5c31af7Sopenharmony_ci structure. 1740e5c31af7Sopenharmony_ci * pname:src is the source acceleration structure for the copy 1741e5c31af7Sopenharmony_ci * pname:dst is the device or host address to memory which is the target 1742e5c31af7Sopenharmony_ci for the copy 1743e5c31af7Sopenharmony_ci * pname:mode is a elink:VkCopyAccelerationStructureModeKHR value 1744e5c31af7Sopenharmony_ci specifying additional operations to perform during the copy. 1745e5c31af7Sopenharmony_ci 1746e5c31af7Sopenharmony_ci.Valid Usage 1747e5c31af7Sopenharmony_ci**** 1748e5c31af7Sopenharmony_ci * [[VUID-VkCopyAccelerationStructureToMemoryInfoKHR-src-04959]] 1749e5c31af7Sopenharmony_ci The source acceleration structure pname:src must: have been constructed 1750e5c31af7Sopenharmony_ci prior to the execution of this command 1751e5c31af7Sopenharmony_ci * [[VUID-VkCopyAccelerationStructureToMemoryInfoKHR-dst-03561]] 1752e5c31af7Sopenharmony_ci The memory pointed to by pname:dst must: be at least as large as the 1753e5c31af7Sopenharmony_ci serialization size of pname:src, as reported by 1754e5c31af7Sopenharmony_ci flink:vkWriteAccelerationStructuresPropertiesKHR or 1755e5c31af7Sopenharmony_ci flink:vkCmdWriteAccelerationStructuresPropertiesKHR with a query type of 1756e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR 1757e5c31af7Sopenharmony_ci * [[VUID-VkCopyAccelerationStructureToMemoryInfoKHR-mode-03412]] 1758e5c31af7Sopenharmony_ci pname:mode must: be 1759e5c31af7Sopenharmony_ci ename:VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR 1760e5c31af7Sopenharmony_ci**** 1761e5c31af7Sopenharmony_ci 1762e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyAccelerationStructureToMemoryInfoKHR.txt[] 1763e5c31af7Sopenharmony_ci-- 1764e5c31af7Sopenharmony_ci 1765e5c31af7Sopenharmony_ci[open,refpage='vkCmdCopyMemoryToAccelerationStructureKHR',desc='Copy device memory to an acceleration structure',type='protos'] 1766e5c31af7Sopenharmony_ci-- 1767e5c31af7Sopenharmony_ci:refpage: vkCmdCopyMemoryToAccelerationStructureKHR 1768e5c31af7Sopenharmony_ci 1769e5c31af7Sopenharmony_ciTo copy device memory to an acceleration structure call: 1770e5c31af7Sopenharmony_ci 1771e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdCopyMemoryToAccelerationStructureKHR.txt[] 1772e5c31af7Sopenharmony_ci 1773e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer into which the command will be 1774e5c31af7Sopenharmony_ci recorded. 1775e5c31af7Sopenharmony_ci * pname:pInfo is a pointer to a 1776e5c31af7Sopenharmony_ci slink:VkCopyMemoryToAccelerationStructureInfoKHR structure defining the 1777e5c31af7Sopenharmony_ci copy operation. 1778e5c31af7Sopenharmony_ci 1779e5c31af7Sopenharmony_ciAccesses to pname:pInfo->dst must: be <<synchronization-dependencies, 1780e5c31af7Sopenharmony_cisynchronized>> with the 1781e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR 1782e5c31af7Sopenharmony_ci<<synchronization-pipeline-stages, pipeline stage>> and an 1783e5c31af7Sopenharmony_ci<<synchronization-access-types, access type>> of 1784e5c31af7Sopenharmony_ciename:VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR. 1785e5c31af7Sopenharmony_ciAccesses to the buffer indicated by pname:pInfo->src.deviceAddress must: be 1786e5c31af7Sopenharmony_cisynchronized with the 1787e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR pipeline stage 1788e5c31af7Sopenharmony_ciand an access type of ename:VK_ACCESS_TRANSFER_READ_BIT. 1789e5c31af7Sopenharmony_ci 1790e5c31af7Sopenharmony_ciThis command can accept acceleration structures produced by either 1791e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureToMemoryKHR or 1792e5c31af7Sopenharmony_ciflink:vkCopyAccelerationStructureToMemoryKHR. 1793e5c31af7Sopenharmony_ci 1794e5c31af7Sopenharmony_ciThe structure provided as input to deserialize is as described in 1795e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureToMemoryKHR, with any acceleration 1796e5c31af7Sopenharmony_cistructure handles filled in with the newly-queried handles to bottom level 1797e5c31af7Sopenharmony_ciacceleration structures created before deserialization. 1798e5c31af7Sopenharmony_ciThese do not need to be built at deserialize time, but must: be created. 1799e5c31af7Sopenharmony_ci 1800e5c31af7Sopenharmony_ci.Valid Usage 1801e5c31af7Sopenharmony_ci**** 1802e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03742]] 1803e5c31af7Sopenharmony_ci pname:pInfo->src.deviceAddress must: be a valid device address for a 1804e5c31af7Sopenharmony_ci buffer bound to device memory 1805e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03743]] 1806e5c31af7Sopenharmony_ci pname:pInfo->src.deviceAddress must: be aligned to `256` bytes 1807e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-03744]] 1808e5c31af7Sopenharmony_ci If the buffer pointed to by pname:pInfo->src.deviceAddress is non-sparse 1809e5c31af7Sopenharmony_ci then it must: be bound completely and contiguously to a single 1810e5c31af7Sopenharmony_ci slink:VkDeviceMemory object 1811e5c31af7Sopenharmony_ci * [[VUID-vkCmdCopyMemoryToAccelerationStructureKHR-buffer-03745]] 1812e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->dst must: be bound to 1813e5c31af7Sopenharmony_ci device memory 1814e5c31af7Sopenharmony_ci**** 1815e5c31af7Sopenharmony_ci 1816e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdCopyMemoryToAccelerationStructureKHR.txt[] 1817e5c31af7Sopenharmony_ci-- 1818e5c31af7Sopenharmony_ci 1819e5c31af7Sopenharmony_ci[open,refpage='VkCopyMemoryToAccelerationStructureInfoKHR',desc='Parameters for deserializing an acceleration structure',type='structs'] 1820e5c31af7Sopenharmony_ci-- 1821e5c31af7Sopenharmony_ci:refpage: VkCopyMemoryToAccelerationStructureInfoKHR 1822e5c31af7Sopenharmony_ci 1823e5c31af7Sopenharmony_ciThe sname:VkCopyMemoryToAccelerationStructureInfoKHR structure is defined 1824e5c31af7Sopenharmony_cias: 1825e5c31af7Sopenharmony_ci 1826e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCopyMemoryToAccelerationStructureInfoKHR.txt[] 1827e5c31af7Sopenharmony_ci 1828e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 1829e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1830e5c31af7Sopenharmony_ci structure. 1831e5c31af7Sopenharmony_ci * pname:src is the device or host address to memory containing the source 1832e5c31af7Sopenharmony_ci data for the copy. 1833e5c31af7Sopenharmony_ci * pname:dst is the target acceleration structure for the copy. 1834e5c31af7Sopenharmony_ci * pname:mode is a elink:VkCopyAccelerationStructureModeKHR value 1835e5c31af7Sopenharmony_ci specifying additional operations to perform during the copy. 1836e5c31af7Sopenharmony_ci 1837e5c31af7Sopenharmony_ci.Valid Usage 1838e5c31af7Sopenharmony_ci**** 1839e5c31af7Sopenharmony_ci * [[VUID-VkCopyMemoryToAccelerationStructureInfoKHR-src-04960]] 1840e5c31af7Sopenharmony_ci The source memory pointed to by pname:src must: contain data previously 1841e5c31af7Sopenharmony_ci serialized using flink:vkCmdCopyAccelerationStructureToMemoryKHR, 1842e5c31af7Sopenharmony_ci potentially modified to relocate acceleration structure references as 1843e5c31af7Sopenharmony_ci described in that command 1844e5c31af7Sopenharmony_ci * [[VUID-VkCopyMemoryToAccelerationStructureInfoKHR-mode-03413]] 1845e5c31af7Sopenharmony_ci pname:mode must: be 1846e5c31af7Sopenharmony_ci ename:VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR 1847e5c31af7Sopenharmony_ci * [[VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pInfo-03414]] 1848e5c31af7Sopenharmony_ci The data in pname:src must: have a format compatible with the 1849e5c31af7Sopenharmony_ci destination physical device as returned by 1850e5c31af7Sopenharmony_ci flink:vkGetDeviceAccelerationStructureCompatibilityKHR 1851e5c31af7Sopenharmony_ci * [[VUID-VkCopyMemoryToAccelerationStructureInfoKHR-dst-03746]] 1852e5c31af7Sopenharmony_ci pname:dst must: have been created with a pname:size greater than or 1853e5c31af7Sopenharmony_ci equal to that used to serialize the data in pname:src 1854e5c31af7Sopenharmony_ci**** 1855e5c31af7Sopenharmony_ci 1856e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCopyMemoryToAccelerationStructureInfoKHR.txt[] 1857e5c31af7Sopenharmony_ci-- 1858e5c31af7Sopenharmony_ci 1859e5c31af7Sopenharmony_ci[open,refpage='vkGetDeviceAccelerationStructureCompatibilityKHR',desc='Check if a serialized acceleration structure is compatible with the current device',type='protos'] 1860e5c31af7Sopenharmony_ci-- 1861e5c31af7Sopenharmony_ci:refpage: vkGetDeviceAccelerationStructureCompatibilityKHR 1862e5c31af7Sopenharmony_ci 1863e5c31af7Sopenharmony_ciTo check if a serialized acceleration structure is compatible with the 1864e5c31af7Sopenharmony_cicurrent device call: 1865e5c31af7Sopenharmony_ci 1866e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetDeviceAccelerationStructureCompatibilityKHR.txt[] 1867e5c31af7Sopenharmony_ci 1868e5c31af7Sopenharmony_ci * pname:device is the device to check the version against. 1869e5c31af7Sopenharmony_ci * pname:pVersionInfo is a pointer to a 1870e5c31af7Sopenharmony_ci slink:VkAccelerationStructureVersionInfoKHR structure specifying version 1871e5c31af7Sopenharmony_ci information to check against the device. 1872e5c31af7Sopenharmony_ci * pname:pCompatibility is a pointer to a 1873e5c31af7Sopenharmony_ci elink:VkAccelerationStructureCompatibilityKHR value in which 1874e5c31af7Sopenharmony_ci compatibility information is returned. 1875e5c31af7Sopenharmony_ci 1876e5c31af7Sopenharmony_ci.Valid Usage 1877e5c31af7Sopenharmony_ci**** 1878e5c31af7Sopenharmony_ci// TBD 1879e5c31af7Sopenharmony_ci * [[VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-rayTracingPipeline-03661]] 1880e5c31af7Sopenharmony_ci The <<features-rayTracingPipeline, pname:rayTracingPipeline>> or 1881e5c31af7Sopenharmony_ci <<features-rayQuery, pname:rayQuery>> feature must: be enabled 1882e5c31af7Sopenharmony_ci**** 1883e5c31af7Sopenharmony_ci 1884e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetDeviceAccelerationStructureCompatibilityKHR.txt[] 1885e5c31af7Sopenharmony_ci-- 1886e5c31af7Sopenharmony_ci 1887e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureVersionInfoKHR',desc='Acceleration structure version information',type='structs'] 1888e5c31af7Sopenharmony_ci-- 1889e5c31af7Sopenharmony_ci:refpage: VkAccelerationStructureVersionKHR 1890e5c31af7Sopenharmony_ci 1891e5c31af7Sopenharmony_ciThe sname:VkAccelerationStructureVersionInfoKHR structure is defined as: 1892e5c31af7Sopenharmony_ci 1893e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAccelerationStructureVersionInfoKHR.txt[] 1894e5c31af7Sopenharmony_ci 1895e5c31af7Sopenharmony_ci * pname:sType is the type of this structure. 1896e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 1897e5c31af7Sopenharmony_ci structure. 1898e5c31af7Sopenharmony_ci * pname:pVersionData is a pointer to the version header of an acceleration 1899e5c31af7Sopenharmony_ci structure as defined in flink:vkCmdCopyAccelerationStructureToMemoryKHR 1900e5c31af7Sopenharmony_ci 1901e5c31af7Sopenharmony_ci[NOTE] 1902e5c31af7Sopenharmony_ci.Note 1903e5c31af7Sopenharmony_ci==== 1904e5c31af7Sopenharmony_cipname:pVersionData is a _pointer_ to an array of 2*ename:VK_UUID_SIZE 1905e5c31af7Sopenharmony_cicode:uint8_t values instead of two ename:VK_UUID_SIZE arrays as the expected 1906e5c31af7Sopenharmony_ciuse case for this member is to be pointed at the header of an previously 1907e5c31af7Sopenharmony_ciserialized acceleration structure (via 1908e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureToMemoryKHR or 1909e5c31af7Sopenharmony_ciflink:vkCopyAccelerationStructureToMemoryKHR) that is loaded in memory. 1910e5c31af7Sopenharmony_ciUsing arrays would necessitate extra memory copies of the UUIDs. 1911e5c31af7Sopenharmony_ci==== 1912e5c31af7Sopenharmony_ci 1913e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAccelerationStructureVersionInfoKHR.txt[] 1914e5c31af7Sopenharmony_ci-- 1915e5c31af7Sopenharmony_ci 1916e5c31af7Sopenharmony_ci[open,refpage='VkAccelerationStructureCompatibilityKHR',desc='Acceleration structure compatibility',type='enums'] 1917e5c31af7Sopenharmony_ci-- 1918e5c31af7Sopenharmony_ciPossible values of pname:pCompatibility returned by 1919e5c31af7Sopenharmony_ciflink:vkGetDeviceAccelerationStructureCompatibilityKHR are: 1920e5c31af7Sopenharmony_ci 1921e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkAccelerationStructureCompatibilityKHR.txt[] 1922e5c31af7Sopenharmony_ci 1923e5c31af7Sopenharmony_ci * ename:VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR if the 1924e5c31af7Sopenharmony_ci pname:pVersionData version acceleration structure is compatible with 1925e5c31af7Sopenharmony_ci pname:device. 1926e5c31af7Sopenharmony_ci * ename:VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR if the 1927e5c31af7Sopenharmony_ci pname:pVersionData version acceleration structure is not compatible with 1928e5c31af7Sopenharmony_ci pname:device. 1929e5c31af7Sopenharmony_ci-- 1930e5c31af7Sopenharmony_ci 1931e5c31af7Sopenharmony_ci 1932e5c31af7Sopenharmony_ci[[host-acceleration-structure]] 1933e5c31af7Sopenharmony_ci== Host Acceleration Structure Operations 1934e5c31af7Sopenharmony_ci 1935e5c31af7Sopenharmony_ciImplementations are also required to provide host implementations of the 1936e5c31af7Sopenharmony_ciacceleration structure operations if the 1937e5c31af7Sopenharmony_ci<<features-accelerationStructureHostCommands,pname:accelerationStructureHostCommands>> 1938e5c31af7Sopenharmony_cifeature is enabled: 1939e5c31af7Sopenharmony_ci 1940e5c31af7Sopenharmony_ci * flink:vkBuildAccelerationStructuresKHR corresponding to 1941e5c31af7Sopenharmony_ci flink:vkCmdBuildAccelerationStructuresKHR 1942e5c31af7Sopenharmony_ci * flink:vkCopyAccelerationStructureKHR corresponding to 1943e5c31af7Sopenharmony_ci flink:vkCmdCopyAccelerationStructureKHR 1944e5c31af7Sopenharmony_ci * flink:vkCopyAccelerationStructureToMemoryKHR corresponding to 1945e5c31af7Sopenharmony_ci flink:vkCmdCopyAccelerationStructureToMemoryKHR 1946e5c31af7Sopenharmony_ci * flink:vkCopyMemoryToAccelerationStructureKHR corresponding to 1947e5c31af7Sopenharmony_ci flink:vkCmdCopyMemoryToAccelerationStructureKHR 1948e5c31af7Sopenharmony_ci * flink:vkWriteAccelerationStructuresPropertiesKHR corresponding to 1949e5c31af7Sopenharmony_ci flink:vkCmdWriteAccelerationStructuresPropertiesKHR 1950e5c31af7Sopenharmony_ci 1951e5c31af7Sopenharmony_ciThese commands are functionally equivalent to their device counterparts, 1952e5c31af7Sopenharmony_ciexcept that they are executed on the host timeline, rather than being 1953e5c31af7Sopenharmony_cienqueued into command buffers. 1954e5c31af7Sopenharmony_ci 1955e5c31af7Sopenharmony_ciAll acceleration structures used by the host commands must: be bound to 1956e5c31af7Sopenharmony_cihost-visible memory, and all input data for acceleration structure builds 1957e5c31af7Sopenharmony_cimust: be referenced using host addresses instead of device addresses. 1958e5c31af7Sopenharmony_ciApplications are not required to map acceleration structure memory when 1959e5c31af7Sopenharmony_ciusing the host commands. 1960e5c31af7Sopenharmony_ci 1961e5c31af7Sopenharmony_ci 1962e5c31af7Sopenharmony_ci[NOTE] 1963e5c31af7Sopenharmony_ci.Note 1964e5c31af7Sopenharmony_ci==== 1965e5c31af7Sopenharmony_ciThe flink:vkBuildAccelerationStructuresKHR and 1966e5c31af7Sopenharmony_ciflink:vkCmdBuildAccelerationStructuresKHR may: use different algorithms, and 1967e5c31af7Sopenharmony_cithus are not required to produce identical structures. 1968e5c31af7Sopenharmony_ciThe structures produced by these two commands may: exhibit different memory 1969e5c31af7Sopenharmony_cifootprints or traversal performance, but should strive to be similar where 1970e5c31af7Sopenharmony_cipossible. 1971e5c31af7Sopenharmony_ci 1972e5c31af7Sopenharmony_ciApart from these details, the host and device operations are interchangable. 1973e5c31af7Sopenharmony_ciFor example, an application can: use flink:vkBuildAccelerationStructuresKHR 1974e5c31af7Sopenharmony_cito build a structure, compact it on the device using 1975e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureKHR, and serialize the result using 1976e5c31af7Sopenharmony_ciflink:vkCopyAccelerationStructureToMemoryKHR. 1977e5c31af7Sopenharmony_ci==== 1978e5c31af7Sopenharmony_ci 1979e5c31af7Sopenharmony_ci[NOTE] 1980e5c31af7Sopenharmony_ci.Note 1981e5c31af7Sopenharmony_ci==== 1982e5c31af7Sopenharmony_ciFor efficient execution, acceleration structures manipulated using these 1983e5c31af7Sopenharmony_cicommands should always be bound to host cached memory, as the implementation 1984e5c31af7Sopenharmony_cimay need to repeatedly read and write this memory during the execution of 1985e5c31af7Sopenharmony_cithe command. 1986e5c31af7Sopenharmony_ci==== 1987e5c31af7Sopenharmony_ci 1988e5c31af7Sopenharmony_ci[open,refpage='vkBuildAccelerationStructuresKHR',desc='Build an acceleration structure on the host',type='protos'] 1989e5c31af7Sopenharmony_ci-- 1990e5c31af7Sopenharmony_ci:refpage: vkBuildAccelerationStructuresKHR 1991e5c31af7Sopenharmony_ci:maxinstancecheck: pname:ppBuildRangeInfos[i][j].pname:primitiveCount 1992e5c31af7Sopenharmony_ci 1993e5c31af7Sopenharmony_ciTo build acceleration structures on the host, call: 1994e5c31af7Sopenharmony_ci 1995e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBuildAccelerationStructuresKHR.txt[] 1996e5c31af7Sopenharmony_ci 1997e5c31af7Sopenharmony_ci * pname:device is the sname:VkDevice for which the acceleration structures 1998e5c31af7Sopenharmony_ci are being built. 1999e5c31af7Sopenharmony_ci * pname:deferredOperation is an optional slink:VkDeferredOperationKHR to 2000e5c31af7Sopenharmony_ci <<deferred-host-operations-requesting, request deferral>> for this 2001e5c31af7Sopenharmony_ci command. 2002e5c31af7Sopenharmony_ci * pname:infoCount is the number of acceleration structures to build. 2003e5c31af7Sopenharmony_ci It specifies the number of the pname:pInfos structures and 2004e5c31af7Sopenharmony_ci pname:ppBuildRangeInfos pointers that must: be provided. 2005e5c31af7Sopenharmony_ci * pname:pInfos is a pointer to an array of pname:infoCount 2006e5c31af7Sopenharmony_ci slink:VkAccelerationStructureBuildGeometryInfoKHR structures defining 2007e5c31af7Sopenharmony_ci the geometry used to build each acceleration structure. 2008e5c31af7Sopenharmony_ci * pname:ppBuildRangeInfos is a pointer to an array of pname:infoCount 2009e5c31af7Sopenharmony_ci pointers to arrays of slink:VkAccelerationStructureBuildRangeInfoKHR 2010e5c31af7Sopenharmony_ci structures. 2011e5c31af7Sopenharmony_ci Each pname:ppBuildRangeInfos[i] is a pointer to an array of 2012e5c31af7Sopenharmony_ci pname:pInfos[i].pname:geometryCount 2013e5c31af7Sopenharmony_ci slink:VkAccelerationStructureBuildRangeInfoKHR structures defining 2014e5c31af7Sopenharmony_ci dynamic offsets to the addresses where geometry data is stored, as 2015e5c31af7Sopenharmony_ci defined by pname:pInfos[i]. 2016e5c31af7Sopenharmony_ci 2017e5c31af7Sopenharmony_ciThis command fulfills the same task as 2018e5c31af7Sopenharmony_ciflink:vkCmdBuildAccelerationStructuresKHR but is executed by the host. 2019e5c31af7Sopenharmony_ci 2020e5c31af7Sopenharmony_ciThe fname:vkBuildAccelerationStructuresKHR command provides the ability to 2021e5c31af7Sopenharmony_ciinitiate multiple acceleration structures builds, however there is no 2022e5c31af7Sopenharmony_ciordering or synchronization implied between any of the individual 2023e5c31af7Sopenharmony_ciacceleration structure builds. 2024e5c31af7Sopenharmony_ci 2025e5c31af7Sopenharmony_ci[NOTE] 2026e5c31af7Sopenharmony_ci.Note 2027e5c31af7Sopenharmony_ci==== 2028e5c31af7Sopenharmony_ciThis means that an application cannot: build a top-level acceleration 2029e5c31af7Sopenharmony_cistructure in the same flink:vkBuildAccelerationStructuresKHR call as the 2030e5c31af7Sopenharmony_ciassociated bottom-level or instance acceleration structures are being built. 2031e5c31af7Sopenharmony_ciThere also cannot: be any memory aliasing between any acceleration structure 2032e5c31af7Sopenharmony_cimemories or scratch memories being used by any of the builds. 2033e5c31af7Sopenharmony_ci==== 2034e5c31af7Sopenharmony_ci 2035e5c31af7Sopenharmony_ci.Valid Usage 2036e5c31af7Sopenharmony_ci**** 2037e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/build_acceleration_structure_common.txt[] 2038e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/build_acceleration_structure_nonindirect_common.txt[] 2039e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/deferred_operations_common.txt[] 2040e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03722]] 2041e5c31af7Sopenharmony_ci For each element of pname:pInfos, the pname:buffer used to create its 2042e5c31af7Sopenharmony_ci pname:dstAccelerationStructure member must: be bound to host-visible 2043e5c31af7Sopenharmony_ci device memory 2044e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03723]] 2045e5c31af7Sopenharmony_ci For each element of pname:pInfos, if its pname:mode member is 2046e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR the pname:buffer 2047e5c31af7Sopenharmony_ci used to create its pname:srcAccelerationStructure member must: be bound 2048e5c31af7Sopenharmony_ci to host-visible device memory 2049e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03724]] 2050e5c31af7Sopenharmony_ci For each element of pname:pInfos, the pname:buffer used to create each 2051e5c31af7Sopenharmony_ci acceleration structure referenced by the pname:geometry.instances.data 2052e5c31af7Sopenharmony_ci member of any element of pname:pGeometries or pname:ppGeometries with a 2053e5c31af7Sopenharmony_ci pname:geometryType of ename:VK_GEOMETRY_TYPE_INSTANCES_KHR must: be 2054e5c31af7Sopenharmony_ci bound to host-visible device memory 2055e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-accelerationStructureHostCommands-03581]] 2056e5c31af7Sopenharmony_ci The <<features-accelerationStructureHostCommands, 2057e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:accelerationStructureHostCommands>> 2058e5c31af7Sopenharmony_ci feature must: be enabled 2059e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03725]] 2060e5c31af7Sopenharmony_ci If pname:pInfos[i].pname:mode is 2061e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR, all addresses 2062e5c31af7Sopenharmony_ci between pname:pInfos[i].pname:scratchData.hostAddress and 2063e5c31af7Sopenharmony_ci pname:pInfos[i].pname:scratchData.hostAddress + N - 1 must: be valid 2064e5c31af7Sopenharmony_ci host memory, where N is given by the pname:buildScratchSize member of 2065e5c31af7Sopenharmony_ci the slink:VkAccelerationStructureBuildSizesInfoKHR structure returned 2066e5c31af7Sopenharmony_ci from a call to flink:vkGetAccelerationStructureBuildSizesKHR with an 2067e5c31af7Sopenharmony_ci identical slink:VkAccelerationStructureBuildGeometryInfoKHR structure 2068e5c31af7Sopenharmony_ci and primitive count 2069e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03726]] 2070e5c31af7Sopenharmony_ci If pname:pInfos[i].pname:mode is 2071e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, all addresses 2072e5c31af7Sopenharmony_ci between pname:pInfos[i].pname:scratchData.hostAddress and 2073e5c31af7Sopenharmony_ci pname:pInfos[i].pname:scratchData.hostAddress + N - 1 must: be valid 2074e5c31af7Sopenharmony_ci host memory, where N is given by the pname:updateScratchSize member of 2075e5c31af7Sopenharmony_ci the slink:VkAccelerationStructureBuildSizesInfoKHR structure returned 2076e5c31af7Sopenharmony_ci from a call to flink:vkGetAccelerationStructureBuildSizesKHR with an 2077e5c31af7Sopenharmony_ci identical slink:VkAccelerationStructureBuildGeometryInfoKHR structure 2078e5c31af7Sopenharmony_ci and primitive count 2079e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03771]] 2080e5c31af7Sopenharmony_ci For any element of pname:pInfos[i].pname:pGeometries or 2081e5c31af7Sopenharmony_ci pname:pInfos[i].pname:ppGeometries with a pname:geometryType of 2082e5c31af7Sopenharmony_ci ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, 2083e5c31af7Sopenharmony_ci pname:geometry.triangles.vertexData.hostAddress must: be a valid host 2084e5c31af7Sopenharmony_ci address 2085e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03772]] 2086e5c31af7Sopenharmony_ci For any element of pname:pInfos[i].pname:pGeometries or 2087e5c31af7Sopenharmony_ci pname:pInfos[i].pname:ppGeometries with a pname:geometryType of 2088e5c31af7Sopenharmony_ci ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, if 2089e5c31af7Sopenharmony_ci pname:geometry.triangles.indexType is not ename:VK_INDEX_TYPE_NONE_KHR, 2090e5c31af7Sopenharmony_ci pname:geometry.triangles.indexData.hostAddress must: be a valid host 2091e5c31af7Sopenharmony_ci address 2092e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03773]] 2093e5c31af7Sopenharmony_ci For any element of pname:pInfos[i].pname:pGeometries or 2094e5c31af7Sopenharmony_ci pname:pInfos[i].pname:ppGeometries with a pname:geometryType of 2095e5c31af7Sopenharmony_ci ename:VK_GEOMETRY_TYPE_TRIANGLES_KHR, if 2096e5c31af7Sopenharmony_ci pname:geometry.triangles.transformData.hostAddress is not `0`, it must: 2097e5c31af7Sopenharmony_ci be a valid host address 2098e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03774]] 2099e5c31af7Sopenharmony_ci For any element of pname:pInfos[i].pname:pGeometries or 2100e5c31af7Sopenharmony_ci pname:pInfos[i].pname:ppGeometries with a pname:geometryType of 2101e5c31af7Sopenharmony_ci ename:VK_GEOMETRY_TYPE_AABBS_KHR, pname:geometry.aabbs.data.hostAddress 2102e5c31af7Sopenharmony_ci must: be a valid host address 2103e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group,VK_VERSION_1_1[] 2104e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03775]] 2105e5c31af7Sopenharmony_ci For each element of pname:pInfos, the pname:buffer used to create its 2106e5c31af7Sopenharmony_ci pname:dstAccelerationStructure member must: be bound to memory that was 2107e5c31af7Sopenharmony_ci not allocated with multiple instances 2108e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03776]] 2109e5c31af7Sopenharmony_ci For each element of pname:pInfos, if its pname:mode member is 2110e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR the pname:buffer 2111e5c31af7Sopenharmony_ci used to create its pname:srcAccelerationStructure member must: be bound 2112e5c31af7Sopenharmony_ci to memory that was not allocated with multiple instances 2113e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03777]] 2114e5c31af7Sopenharmony_ci For each element of pname:pInfos, the pname:buffer used to create each 2115e5c31af7Sopenharmony_ci acceleration structure referenced by the pname:geometry.instances.data 2116e5c31af7Sopenharmony_ci member of any element of pname:pGeometries or pname:ppGeometries with a 2117e5c31af7Sopenharmony_ci pname:geometryType of ename:VK_GEOMETRY_TYPE_INSTANCES_KHR must: be 2118e5c31af7Sopenharmony_ci bound to memory that was not allocated with multiple instances 2119e5c31af7Sopenharmony_ciendif::VK_KHR_device_group,VK_VERSION_1_1[] 2120e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03778]] 2121e5c31af7Sopenharmony_ci For any element of pname:pInfos[i].pname:pGeometries or 2122e5c31af7Sopenharmony_ci pname:pInfos[i].pname:ppGeometries with a pname:geometryType of 2123e5c31af7Sopenharmony_ci ename:VK_GEOMETRY_TYPE_INSTANCES_KHR, 2124e5c31af7Sopenharmony_ci pname:geometry.instances.data.hostAddress must: be a valid host address 2125e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-03779]] 2126e5c31af7Sopenharmony_ci For any element of pname:pInfos[i].pname:pGeometries or 2127e5c31af7Sopenharmony_ci pname:pInfos[i].pname:ppGeometries with a pname:geometryType of 2128e5c31af7Sopenharmony_ci ename:VK_GEOMETRY_TYPE_INSTANCES_KHR, each 2129e5c31af7Sopenharmony_ci slink:VkAccelerationStructureInstanceKHR::pname:accelerationStructureReference 2130e5c31af7Sopenharmony_ci value in pname:geometry.instances.data.hostAddress must be a valid 2131e5c31af7Sopenharmony_ci slink:VkAccelerationStructureKHR object 2132e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing_motion_blur[] 2133e5c31af7Sopenharmony_ci * [[VUID-vkBuildAccelerationStructuresKHR-pInfos-04930]] 2134e5c31af7Sopenharmony_ci For any element of pname:pInfos[i].pname:pGeometries or 2135e5c31af7Sopenharmony_ci pname:pInfos[i].pname:ppGeometries with a pname:geometryType of 2136e5c31af7Sopenharmony_ci ename:VK_GEOMETRY_TYPE_INSTANCES_KHR with 2137e5c31af7Sopenharmony_ci ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV set, each 2138e5c31af7Sopenharmony_ci pname:accelerationStructureReference in any structure in 2139e5c31af7Sopenharmony_ci slink:VkAccelerationStructureMotionInstanceNV value in 2140e5c31af7Sopenharmony_ci pname:geometry.instances.data.hostAddress must be a valid 2141e5c31af7Sopenharmony_ci slink:VkAccelerationStructureKHR object 2142e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing_motion_blur[] 2143e5c31af7Sopenharmony_ci**** 2144e5c31af7Sopenharmony_ci 2145e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkBuildAccelerationStructuresKHR.txt[] 2146e5c31af7Sopenharmony_ci-- 2147e5c31af7Sopenharmony_ci 2148e5c31af7Sopenharmony_ci[open,refpage='vkCopyAccelerationStructureKHR',desc='Copy an acceleration structure on the host',type='protos'] 2149e5c31af7Sopenharmony_ci-- 2150e5c31af7Sopenharmony_ci:refpage: vkCopyAccelerationStructureKHR 2151e5c31af7Sopenharmony_ci 2152e5c31af7Sopenharmony_ciTo copy or compact an acceleration structure on the host, call: 2153e5c31af7Sopenharmony_ci 2154e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCopyAccelerationStructureKHR.txt[] 2155e5c31af7Sopenharmony_ci 2156e5c31af7Sopenharmony_ci * pname:device is the device which owns the acceleration structures. 2157e5c31af7Sopenharmony_ci * pname:deferredOperation is an optional slink:VkDeferredOperationKHR to 2158e5c31af7Sopenharmony_ci <<deferred-host-operations-requesting, request deferral>> for this 2159e5c31af7Sopenharmony_ci command. 2160e5c31af7Sopenharmony_ci * pname:pInfo is a pointer to a slink:VkCopyAccelerationStructureInfoKHR 2161e5c31af7Sopenharmony_ci structure defining the copy operation. 2162e5c31af7Sopenharmony_ci 2163e5c31af7Sopenharmony_ciThis command fulfills the same task as 2164e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureKHR but is executed by the host. 2165e5c31af7Sopenharmony_ci 2166e5c31af7Sopenharmony_ci.Valid Usage 2167e5c31af7Sopenharmony_ci**** 2168e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/deferred_operations_common.txt[] 2169e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureKHR-buffer-03727]] 2170e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->src must: be bound to 2171e5c31af7Sopenharmony_ci host-visible device memory 2172e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureKHR-buffer-03728]] 2173e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->dst must: be bound to 2174e5c31af7Sopenharmony_ci host-visible device memory 2175e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureKHR-accelerationStructureHostCommands-03582]] 2176e5c31af7Sopenharmony_ci The <<features-accelerationStructureHostCommands, 2177e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:accelerationStructureHostCommands>> 2178e5c31af7Sopenharmony_ci feature must: be enabled 2179e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group,VK_VERSION_1_1[] 2180e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureKHR-buffer-03780]] 2181e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->src must: be bound to 2182e5c31af7Sopenharmony_ci memory that was not allocated with multiple instances 2183e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureKHR-buffer-03781]] 2184e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->dst must: be bound to 2185e5c31af7Sopenharmony_ci memory that was not allocated with multiple instances 2186e5c31af7Sopenharmony_ciendif::VK_KHR_device_group,VK_VERSION_1_1[] 2187e5c31af7Sopenharmony_ci**** 2188e5c31af7Sopenharmony_ci 2189e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCopyAccelerationStructureKHR.txt[] 2190e5c31af7Sopenharmony_ci-- 2191e5c31af7Sopenharmony_ci 2192e5c31af7Sopenharmony_ci[open,refpage='vkCopyMemoryToAccelerationStructureKHR',desc='Deserialize an acceleration structure on the host',type='protos'] 2193e5c31af7Sopenharmony_ci-- 2194e5c31af7Sopenharmony_ci:refpage: vkCopyMemoryToAccelerationStructureKHR 2195e5c31af7Sopenharmony_ci 2196e5c31af7Sopenharmony_ciTo copy host accessible memory to an acceleration structure, call: 2197e5c31af7Sopenharmony_ci 2198e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCopyMemoryToAccelerationStructureKHR.txt[] 2199e5c31af7Sopenharmony_ci 2200e5c31af7Sopenharmony_ci * pname:device is the device which owns pname:pInfo->dst. 2201e5c31af7Sopenharmony_ci * pname:deferredOperation is an optional slink:VkDeferredOperationKHR to 2202e5c31af7Sopenharmony_ci <<deferred-host-operations-requesting, request deferral>> for this 2203e5c31af7Sopenharmony_ci command. 2204e5c31af7Sopenharmony_ci * pname:pInfo is a pointer to a 2205e5c31af7Sopenharmony_ci slink:VkCopyMemoryToAccelerationStructureInfoKHR structure defining the 2206e5c31af7Sopenharmony_ci copy operation. 2207e5c31af7Sopenharmony_ci 2208e5c31af7Sopenharmony_ciThis command fulfills the same task as 2209e5c31af7Sopenharmony_ciflink:vkCmdCopyMemoryToAccelerationStructureKHR but is executed by the host. 2210e5c31af7Sopenharmony_ci 2211e5c31af7Sopenharmony_ciThis command can accept acceleration structures produced by either 2212e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureToMemoryKHR or 2213e5c31af7Sopenharmony_ciflink:vkCopyAccelerationStructureToMemoryKHR. 2214e5c31af7Sopenharmony_ci 2215e5c31af7Sopenharmony_ci.Valid Usage 2216e5c31af7Sopenharmony_ci**** 2217e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/deferred_operations_common.txt[] 2218e5c31af7Sopenharmony_ci * [[VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-03729]] 2219e5c31af7Sopenharmony_ci pname:pInfo->src.hostAddress must: be a valid host pointer 2220e5c31af7Sopenharmony_ci * [[VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-03750]] 2221e5c31af7Sopenharmony_ci pname:pInfo->src.hostAddress must: be aligned to 16 bytes 2222e5c31af7Sopenharmony_ci * [[VUID-vkCopyMemoryToAccelerationStructureKHR-buffer-03730]] 2223e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->dst must: be bound to 2224e5c31af7Sopenharmony_ci host-visible device memory 2225e5c31af7Sopenharmony_ci * [[VUID-vkCopyMemoryToAccelerationStructureKHR-accelerationStructureHostCommands-03583]] 2226e5c31af7Sopenharmony_ci The <<features-accelerationStructureHostCommands, 2227e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:accelerationStructureHostCommands>> 2228e5c31af7Sopenharmony_ci feature must: be enabled 2229e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group,VK_VERSION_1_1[] 2230e5c31af7Sopenharmony_ci * [[VUID-vkCopyMemoryToAccelerationStructureKHR-buffer-03782]] 2231e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->dst must: be bound to 2232e5c31af7Sopenharmony_ci memory that was not allocated with multiple instances 2233e5c31af7Sopenharmony_ciendif::VK_KHR_device_group,VK_VERSION_1_1[] 2234e5c31af7Sopenharmony_ci**** 2235e5c31af7Sopenharmony_ci 2236e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCopyMemoryToAccelerationStructureKHR.txt[] 2237e5c31af7Sopenharmony_ci-- 2238e5c31af7Sopenharmony_ci 2239e5c31af7Sopenharmony_ci[open,refpage='vkCopyAccelerationStructureToMemoryKHR',desc='Serialize an acceleration structure on the host',type='protos'] 2240e5c31af7Sopenharmony_ci-- 2241e5c31af7Sopenharmony_ci:refpage: vkCopyAccelerationStructureToMemoryKHR 2242e5c31af7Sopenharmony_ci 2243e5c31af7Sopenharmony_ciTo copy an acceleration structure to host accessible memory, call: 2244e5c31af7Sopenharmony_ci 2245e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCopyAccelerationStructureToMemoryKHR.txt[] 2246e5c31af7Sopenharmony_ci 2247e5c31af7Sopenharmony_ci * pname:device is the device which owns pname:pInfo->src. 2248e5c31af7Sopenharmony_ci * pname:deferredOperation is an optional slink:VkDeferredOperationKHR to 2249e5c31af7Sopenharmony_ci <<deferred-host-operations-requesting, request deferral>> for this 2250e5c31af7Sopenharmony_ci command. 2251e5c31af7Sopenharmony_ci * pname:pInfo is a pointer to a 2252e5c31af7Sopenharmony_ci slink:VkCopyAccelerationStructureToMemoryInfoKHR structure defining the 2253e5c31af7Sopenharmony_ci copy operation. 2254e5c31af7Sopenharmony_ci 2255e5c31af7Sopenharmony_ciThis command fulfills the same task as 2256e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureToMemoryKHR but is executed by the host. 2257e5c31af7Sopenharmony_ci 2258e5c31af7Sopenharmony_ciThis command produces the same results as 2259e5c31af7Sopenharmony_ciflink:vkCmdCopyAccelerationStructureToMemoryKHR, but writes its result 2260e5c31af7Sopenharmony_cidirectly to a host pointer, and is executed on the host rather than the 2261e5c31af7Sopenharmony_cidevice. 2262e5c31af7Sopenharmony_ciThe output may: not necessarily be bit-for-bit identical, but it can be 2263e5c31af7Sopenharmony_ciequally used by either flink:vkCmdCopyMemoryToAccelerationStructureKHR or 2264e5c31af7Sopenharmony_ciflink:vkCopyMemoryToAccelerationStructureKHR. 2265e5c31af7Sopenharmony_ci 2266e5c31af7Sopenharmony_ci.Valid Usage 2267e5c31af7Sopenharmony_ci**** 2268e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/deferred_operations_common.txt[] 2269e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureToMemoryKHR-buffer-03731]] 2270e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->src must: be bound to 2271e5c31af7Sopenharmony_ci host-visible device memory 2272e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03732]] 2273e5c31af7Sopenharmony_ci pname:pInfo->dst.hostAddress must: be a valid host pointer 2274e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03751]] 2275e5c31af7Sopenharmony_ci pname:pInfo->dst.hostAddress must: be aligned to 16 bytes 2276e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureToMemoryKHR-accelerationStructureHostCommands-03584]] 2277e5c31af7Sopenharmony_ci The <<features-accelerationStructureHostCommands, 2278e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:accelerationStructureHostCommands>> 2279e5c31af7Sopenharmony_ci feature must: be enabled 2280e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group,VK_VERSION_1_1[] 2281e5c31af7Sopenharmony_ci * [[VUID-vkCopyAccelerationStructureToMemoryKHR-buffer-03783]] 2282e5c31af7Sopenharmony_ci The pname:buffer used to create pname:pInfo->src must: be bound to 2283e5c31af7Sopenharmony_ci memory that was not allocated with multiple instances 2284e5c31af7Sopenharmony_ciendif::VK_KHR_device_group,VK_VERSION_1_1[] 2285e5c31af7Sopenharmony_ci**** 2286e5c31af7Sopenharmony_ci 2287e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCopyAccelerationStructureToMemoryKHR.txt[] 2288e5c31af7Sopenharmony_ci-- 2289e5c31af7Sopenharmony_ci 2290e5c31af7Sopenharmony_ci[open,refpage='vkWriteAccelerationStructuresPropertiesKHR',desc='Query acceleration structure meta-data on the host',type='protos'] 2291e5c31af7Sopenharmony_ci-- 2292e5c31af7Sopenharmony_ci:refpage: vkWriteAccelerationStructuresPropertiesKHR 2293e5c31af7Sopenharmony_ci 2294e5c31af7Sopenharmony_ciTo query acceleration structure size parameters on the host, call: 2295e5c31af7Sopenharmony_ci 2296e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkWriteAccelerationStructuresPropertiesKHR.txt[] 2297e5c31af7Sopenharmony_ci 2298e5c31af7Sopenharmony_ci * pname:device is the device which owns the acceleration structures in 2299e5c31af7Sopenharmony_ci pname:pAccelerationStructures. 2300e5c31af7Sopenharmony_ci * pname:accelerationStructureCount is the count of acceleration structures 2301e5c31af7Sopenharmony_ci for which to query the property. 2302e5c31af7Sopenharmony_ci * pname:pAccelerationStructures is a pointer to an array of existing 2303e5c31af7Sopenharmony_ci previously built acceleration structures. 2304e5c31af7Sopenharmony_ci * pname:queryType is a elink:VkQueryType value specifying the property to 2305e5c31af7Sopenharmony_ci be queried. 2306e5c31af7Sopenharmony_ci * pname:dataSize is the size in bytes of the buffer pointed to by 2307e5c31af7Sopenharmony_ci pname:pData. 2308e5c31af7Sopenharmony_ci * pname:pData is a pointer to a user-allocated buffer where the results 2309e5c31af7Sopenharmony_ci will be written. 2310e5c31af7Sopenharmony_ci * pname:stride is the stride in bytes between results for individual 2311e5c31af7Sopenharmony_ci queries within pname:pData. 2312e5c31af7Sopenharmony_ci 2313e5c31af7Sopenharmony_ciThis command fulfills the same task as 2314e5c31af7Sopenharmony_ciflink:vkCmdWriteAccelerationStructuresPropertiesKHR but is executed by the 2315e5c31af7Sopenharmony_cihost. 2316e5c31af7Sopenharmony_ci 2317e5c31af7Sopenharmony_ci.Valid Usage 2318e5c31af7Sopenharmony_ci**** 2319e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/write_acceleration_structure_properties_common.txt[] 2320e5c31af7Sopenharmony_ci * [[VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03448]] 2321e5c31af7Sopenharmony_ci If pname:queryType is 2322e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR, then 2323e5c31af7Sopenharmony_ci pname:stride must: be a multiple of the size of basetype:VkDeviceSize 2324e5c31af7Sopenharmony_ci * [[VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03449]] 2325e5c31af7Sopenharmony_ci If pname:queryType is 2326e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR, then 2327e5c31af7Sopenharmony_ci pname:data must: point to a basetype:VkDeviceSize 2328e5c31af7Sopenharmony_ci * [[VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03450]] 2329e5c31af7Sopenharmony_ci If pname:queryType is 2330e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR, then 2331e5c31af7Sopenharmony_ci pname:stride must: be a multiple of the size of basetype:VkDeviceSize 2332e5c31af7Sopenharmony_ci * [[VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-03451]] 2333e5c31af7Sopenharmony_ci If pname:queryType is 2334e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR, then 2335e5c31af7Sopenharmony_ci pname:data must: point to a basetype:VkDeviceSize 2336e5c31af7Sopenharmony_ci * [[VUID-vkWriteAccelerationStructuresPropertiesKHR-dataSize-03452]] 2337e5c31af7Sopenharmony_ci pname:dataSize must: be greater than or equal to 2338e5c31af7Sopenharmony_ci [eq]#pname:accelerationStructureCount*pname:stride# 2339e5c31af7Sopenharmony_ci * [[VUID-vkWriteAccelerationStructuresPropertiesKHR-buffer-03733]] 2340e5c31af7Sopenharmony_ci The pname:buffer used to create each acceleration structure in 2341e5c31af7Sopenharmony_ci pname:pAccelerationStructures must: be bound to host-visible device 2342e5c31af7Sopenharmony_ci memory 2343e5c31af7Sopenharmony_ci * [[VUID-vkWriteAccelerationStructuresPropertiesKHR-accelerationStructureHostCommands-03585]] 2344e5c31af7Sopenharmony_ci The <<features-accelerationStructureHostCommands, 2345e5c31af7Sopenharmony_ci sname:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:accelerationStructureHostCommands>> 2346e5c31af7Sopenharmony_ci feature must: be enabled 2347e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group,VK_VERSION_1_1[] 2348e5c31af7Sopenharmony_ci * [[VUID-vkWriteAccelerationStructuresPropertiesKHR-buffer-03784]] 2349e5c31af7Sopenharmony_ci The pname:buffer used to create each acceleration structure in 2350e5c31af7Sopenharmony_ci pname:pAccelerationStructures must: be bound to memory that was not 2351e5c31af7Sopenharmony_ci allocated with multiple instances 2352e5c31af7Sopenharmony_ciendif::VK_KHR_device_group,VK_VERSION_1_1[] 2353e5c31af7Sopenharmony_ci**** 2354e5c31af7Sopenharmony_ci 2355e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkWriteAccelerationStructuresPropertiesKHR.txt[] 2356e5c31af7Sopenharmony_ci-- 2357