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

48 lines
958 B
Plaintext
Raw Normal View History

2024-03-29 08:49:03 +01:00
import Bounding;
2023-10-24 15:01:09 +02:00
2023-10-07 19:29:53 +02:00
struct MeshletDescription
{
2024-04-08 20:51:28 +02:00
BoundingSphere bounding;
2023-10-07 19:29:53 +02:00
uint32_t vertexCount;
uint32_t primitiveCount;
uint32_t vertexOffset;
uint32_t primitiveOffset;
2023-12-23 18:26:54 +01:00
float3 color;
float pad;
2023-10-07 19:29:53 +02:00
};
2023-10-24 15:01:09 +02:00
struct MeshData
{
2024-04-08 20:51:28 +02:00
BoundingSphere bounding;
2024-04-17 14:33:06 +02:00
uint32_t numMeshlets;
uint32_t meshletOffset;
uint32_t firstIndex;
uint32_t numIndices;
uint32_t indicesOffset;
uint32_t pad0[3];
2023-10-24 15:01:09 +02:00
};
2023-12-22 19:46:07 +01: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;
2024-04-17 14:33:06 +02:00
// uint8_t is not valid in DXIL
StructuredBuffer<uint32_t> primitiveIndices;
2024-04-07 16:33:32 +02:00
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