Files
Seele/res/shaders/lib/Meshlet.slang
T

42 lines
778 B
Plaintext
Raw Normal View History

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-10-24 15:01:09 +02:00
static const uint TASK_GROUP_SIZE = 128;
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
};
ParameterBlock<Scene> scene;
2023-10-07 19:29:53 +02:00