namespace Brutal.VulkanApi { /// /// VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV - Parameters describing build operation for a template cluster acceleration structure /// /// /// /// :refpage: VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV /// /// /// The VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV /// structure is defined as: /// /// /// // Provided by VK_NV_cluster_acceleration_structure /// typedef struct VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV { /// uint32_t clusterID; /// VkClusterAccelerationStructureClusterFlagsNV clusterFlags; /// uint32_t triangleCount:9; /// uint32_t vertexCount:9; /// uint32_t positionTruncateBitCount:6; /// uint32_t indexType:4; /// uint32_t opacityMicromapIndexType:4; /// VkClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV baseGeometryIndexAndGeometryFlags; /// uint16_t indexBufferStride; /// uint16_t vertexBufferStride; /// uint16_t geometryIndexAndFlagsBufferStride; /// uint16_t opacityMicromapIndexBufferStride; /// VkDeviceAddress indexBuffer; /// VkDeviceAddress vertexBuffer; /// VkDeviceAddress geometryIndexAndFlagsBuffer; /// VkDeviceAddress opacityMicromapArray; /// VkDeviceAddress opacityMicromapIndexBuffer; /// VkDeviceAddress instantiationBoundingBoxLimit; /// } VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV; /// /// [StructLayout(LayoutKind.Explicit, Size = 72)] public partial struct VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV() { /// /// ClusterID is a user specified identifier assigned to this cluster template. /// [FieldOffset(0)] public int ClusterID; /// /// ClusterFlags is a bitmask of VkClusterAccelerationStructureClusterFlagsNV values describing flags how the cluster template should be built. /// [FieldOffset(4)] public VkClusterAccelerationStructureClusterFlagsNV ClusterFlags; /// /// TriangleCount is the number of triangles in this cluster. /// [FieldOffset(8)] private int _triangleCount; /// /// VertexCount is the number of unique vertices in this cluster. /// [FieldOffset(8)] private int _vertexCount; /// /// PositionTruncateBitCount is the number of bits starting at the lowest bit (i.e. the LSBs of the mantissa), of each vertex position that will be truncated to zero to improve floating-point compression. /// [FieldOffset(8)] private int _positionTruncateBitCount; /// /// IndexType is a single VkClusterAccelerationStructureIndexFormatFlagsNV value specifying the index type in indexBuffer. /// [FieldOffset(8)] private int _indexType; /// /// OpacityMicromapIndexType is a single VkClusterAccelerationStructureIndexFormatFlagsNV value specifying the index type in opacityMicromapIndexBuffer. /// [FieldOffset(8)] private int _opacityMicromapIndexType; /// /// BaseGeometryIndexAndGeometryFlags is a VkClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV value specifying the base geometry index and flags for all triangles in the cluster template. /// [FieldOffset(12)] public VkClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV BaseGeometryIndexAndGeometryFlags; /// /// IndexBufferStride is the stride in bytes in indexBuffer. /// [FieldOffset(16)] public ushort IndexBufferStride; /// /// VertexBufferStride is the stride in bytes in vertexBuffer. /// [FieldOffset(18)] public ushort VertexBufferStride; /// /// GeometryIndexAndFlagsBufferStride is the stride in bytes in geometryIndexAndFlagsBuffer. /// [FieldOffset(20)] public ushort GeometryIndexAndFlagsBufferStride; /// /// OpacityMicromapIndexBufferStride is the stride in bytes in opacityMicromapIndexBuffer. /// [FieldOffset(22)] public ushort OpacityMicromapIndexBufferStride; /// /// IndexBuffer contains the indices of vertices in the cluster and is of type indexType. /// [FieldOffset(24)] public VkDeviceAddress IndexBuffer; /// /// VertexBuffer is either `0` or specifies the vertex data of the triangles in the cluster template with format specified in VkClusterAccelerationStructureTriangleClusterInputNV::vertexFormat. /// [FieldOffset(32)] public VkDeviceAddress VertexBuffer; /// /// GeometryIndexAndFlagsBuffer is either `0` or an address containing strided VkClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV values specifying the geometry index and flag for every triangle in the cluster. /// [FieldOffset(40)] public VkDeviceAddress GeometryIndexAndFlagsBuffer; /// /// OpacityMicromapArray is either `0` or specifies the address of a valid opacity micromap array to reference from the cluster acceleration structure. If it is `0`, then opacity micromaps will be disabled for this cluster acceleration structure. /// [FieldOffset(48)] public VkDeviceAddress OpacityMicromapArray; /// /// OpacityMicromapIndexBuffer is either `0` or specifies the address of a strided array with size equal to the number of triangles or indices into the opacity micromap array. If opacityMicromapIndexBuffer is `0` then the index used is the index of the triangle in the geometry. /// [FieldOffset(56)] public VkDeviceAddress OpacityMicromapIndexBuffer; /// /// InstantiationBoundingBoxLimit is either `0` or specifies the address of a bounding box within which all instantiated clusters must lie. The bounding box is specified by six 32-bit floating-point values in the order MinX, MinY, MinZ, MaxX, MaxY, MaxZ. /// [FieldOffset(64)] public VkDeviceAddress InstantiationBoundingBoxLimit; } public partial struct VkClusterAccelerationStructureBuildTriangleClusterTemplateInfoNV { /// public int TriangleCount { get => BitFields.ExtractRange(_triangleCount, start: 0, length: 9); set => BitFields.SetRange(ref _triangleCount, start: 0, length: 9, value); } /// public int VertexCount { get => BitFields.ExtractRange(_vertexCount, start: 9, length: 9); set => BitFields.SetRange(ref _vertexCount, start: 9, length: 9, value); } /// public int PositionTruncateBitCount { get => BitFields.ExtractRange(_positionTruncateBitCount, start: 18, length: 6); set => BitFields.SetRange(ref _positionTruncateBitCount, start: 18, length: 6, value); } /// public int IndexType { get => BitFields.ExtractRange(_indexType, start: 24, length: 4); set => BitFields.SetRange(ref _indexType, start: 24, length: 4, value); } /// public int OpacityMicromapIndexType { get => BitFields.ExtractRange(_opacityMicromapIndexType, start: 28, length: 4); set => BitFields.SetRange(ref _opacityMicromapIndexType, start: 28, length: 4, value); } } }