1 // 2 // Copyright (C) 2009-2021 Intel Corporation 3 // 4 // SPDX-License-Identifier: MIT 5 // 6 // 7 8 #pragma once 9 10 #include "GRLIntTypes.h" 11 12 GRL_NAMESPACE_BEGIN(GRL) 13 GRL_NAMESPACE_BEGIN(_INTERNAL) 14 15 struct GeometryTriangles 16 { 17 gpuva_t pTransformBuffer; 18 gpuva_t pIndexBuffer; 19 gpuva_t pVertexBuffer; 20 qword VertexBufferByteStride; 21 dword IndexCount; 22 dword VertexCount; 23 IndexFormat IndexFormat; 24 VertexFormat VertexFormat; 25 }; 26 27 struct GeometryProcedural 28 { 29 gpuva_t pAABBs_GPUVA; ///<elements of pAABBs_GPUVA are gpuAABB format. 30 qword AABBByteStride; 31 dword AABBCount; 32 }; 33 34 // TODO we miss 'unsigned int ShaderIndex_Mask; // extension' field 35 struct Geo 36 { 37 union 38 { 39 struct GeometryTriangles Triangles; 40 struct GeometryProcedural Procedural; 41 } Desc; 42 43 GeometryType Type; 44 uint8_t Flags; 45 }; 46 47 // Matches the Vulkan VkAccelerationStructureBuildRangeInfoKHR structure 48 // See Vulkan spec for data access rules: 49 // https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAccelerationStructureBuildRangeInfoKHR.html 50 // 51 struct IndirectBuildRangeInfo 52 { 53 dword primitiveCount; // Number of primitives 54 dword primitiveOffset; // Byte offset to primitive data 55 dword firstVertex; // Index of first vertex 56 dword transformOffset; // Byte offset to transform data (for triangle Geo with non-null transform) 57 }; 58 59 GRL_NAMESPACE_END(_INTERNAL) 60 GRL_NAMESPACE_END(GRL)