namespace Brutal.VulkanApi { /// /// VkClusterAccelerationStructureBuildTriangleClusterInfoNV - Parameters describing build operation for a cluster acceleration structure /// /// /// /// :refpage: VkClusterAccelerationStructureBuildTriangleClusterInfoNV /// /// /// The VkClusterAccelerationStructureBuildTriangleClusterInfoNV structure /// is defined as: /// /// /// // Provided by VK_NV_cluster_acceleration_structure /// typedef struct VkClusterAccelerationStructureBuildTriangleClusterInfoNV { /// 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; /// } VkClusterAccelerationStructureBuildTriangleClusterInfoNV; /// /// [StructLayout(LayoutKind.Explicit, Size = 64)] public partial struct VkClusterAccelerationStructureBuildTriangleClusterInfoNV() { /// /// ClusterID is a user specified identifier assigned to this cluster. /// [FieldOffset(0)] public int ClusterID; /// /// ClusterFlags is a bitmask of VkClusterAccelerationStructureClusterFlagsNV values describing flags how the cluster 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. /// [FieldOffset(12)] public VkClusterAccelerationStructureGeometryIndexAndGeometryFlagsNV BaseGeometryIndexAndGeometryFlags; /// /// IndexBufferStride is the stride in bytes in indexBuffer with `0` meaning the values are tightly-packed. /// [FieldOffset(16)] public ushort IndexBufferStride; /// /// VertexBufferStride is the stride in bytes in vertexBuffer with `0` meaning the values are tightly-packed. /// [FieldOffset(18)] public ushort VertexBufferStride; /// /// GeometryIndexAndFlagsBufferStride is the stride in bytes in geometryIndexAndFlagsBuffer with `0` meaning the values are tightly-packed. /// [FieldOffset(20)] public ushort GeometryIndexAndFlagsBufferStride; /// /// OpacityMicromapIndexBufferStride is the stride in bytes in opacityMicromapIndexBuffer with `0` meaning the values are tightly-packed. /// [FieldOffset(22)] public ushort OpacityMicromapIndexBufferStride; /// /// IndexBuffer is a device address containing the indices of the vertices in the cluster and are of type indexType. /// [FieldOffset(24)] public VkDeviceAddress IndexBuffer; /// /// VertexBuffer is a device address containing the vertex data of the triangles in the cluster with format specified in VkClusterAccelerationStructureTriangleClusterInputNV::vertexFormat. /// [FieldOffset(32)] public VkDeviceAddress VertexBuffer; /// /// GeometryIndexAndFlagsBuffer /// [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; } public partial struct VkClusterAccelerationStructureBuildTriangleClusterInfoNV { /// 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); } } }