2023-10-24 15:01:09 +02:00
|
|
|
import AABB;
|
|
|
|
|
|
2023-10-07 19:29:53 +02:00
|
|
|
struct MeshletDescription
|
|
|
|
|
{
|
2023-10-24 15:01:09 +02:00
|
|
|
AABB boundingBox;
|
2023-10-07 19:29:53 +02:00
|
|
|
uint32_t vertexCount;
|
|
|
|
|
uint32_t primitiveCount;
|
|
|
|
|
uint32_t vertexOffset;
|
|
|
|
|
uint32_t primitiveOffset;
|
|
|
|
|
};
|
|
|
|
|
|
2023-10-24 15:01:09 +02:00
|
|
|
struct MeshData
|
|
|
|
|
{
|
|
|
|
|
uint numMeshlets;
|
|
|
|
|
uint meshletOffset;
|
2023-10-31 16:16:23 +01:00
|
|
|
uint indicesOffset;
|
2023-10-24 15:01:09 +02:00
|
|
|
};
|
|
|
|
|
|
2023-10-07 19:29:53 +02:00
|
|
|
static const uint MAX_VERTICES = 64;
|
|
|
|
|
static const uint MAX_PRIMITIVES = 126;
|
2023-11-26 11:27:39 +01:00
|
|
|
static const uint TASK_GROUP_SIZE = 128;
|
2023-10-24 15:01:09 +02:00
|
|
|
static const uint MESH_GROUP_SIZE = 32;
|
|
|
|
|
static const uint MAX_MESHLETS_PER_MESH = 512;
|
|
|
|
|
|
|
|
|
|
struct InstanceData
|
|
|
|
|
{
|
|
|
|
|
float4x4 transformMatrix;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Scene
|
|
|
|
|
{
|
|
|
|
|
StructuredBuffer<InstanceData> instances;
|
|
|
|
|
StructuredBuffer<MeshData> meshData;
|
2023-10-31 16:16:23 +01:00
|
|
|
StructuredBuffer<MeshletDescription> meshletInfos;
|
|
|
|
|
StructuredBuffer<uint8_t> primitiveIndices;
|
|
|
|
|
StructuredBuffer<uint32_t> vertexIndices;
|
2023-10-24 15:01:09 +02:00
|
|
|
};
|
|
|
|
|
|
2023-11-08 23:27:21 +01:00
|
|
|
ParameterBlock<Scene> pScene;
|
2023-10-07 19:29:53 +02:00
|
|
|
|