Files
Seele/res/shaders/terrain/Parameters.slang
T

92 lines
2.0 KiB
Plaintext
Raw Normal View History

2024-10-07 20:14:00 +02:00
import Common;
import Bisector;
struct GeometryCB
{
uint32_t totalNumElements;
uint32_t baseDepth;
uint32_t totalNumVertices;
};
struct DeformationCB
{
float4 patchSize;
float4 patchRoughness;
float choppiness;
int attenuation;
float amplification;
uint32_t patchFlags;
};
struct UpdateCB
{
float triangleSize;
uint32_t maxSubdivisionDepth;
float fov;
float farPlaneDistance;
}
2024-10-14 18:14:08 +02:00
struct DebugStruct
{
2024-10-19 11:54:04 +02:00
uint4 indices;
uint baseHeapID;
uint subdivision;
uint propagateLocation;
uint numSiblings;
2024-10-18 19:01:04 +02:00
};
2024-10-14 18:14:08 +02:00
2024-10-07 20:14:00 +02:00
struct ComputeParams
{
2024-10-19 11:54:04 +02:00
// 0
2024-10-07 20:14:00 +02:00
ConstantBuffer<GeometryCB> geometry;
2024-10-19 11:54:04 +02:00
// 1
2024-10-07 20:14:00 +02:00
ConstantBuffer<UpdateCB> update;
2024-10-19 11:54:04 +02:00
// 2
2024-10-15 21:35:52 +02:00
RWStructuredBuffer<float4> currentVertexBuffer;
2024-10-19 11:54:04 +02:00
// 3
2024-10-07 20:14:00 +02:00
StructuredBuffer<uint> indexedBisectorBuffer;
2024-10-19 11:54:04 +02:00
// 4
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> indirectDrawBuffer;
2024-10-19 11:54:04 +02:00
// 5
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint64_t> heapIDBuffer;
2024-10-19 11:54:04 +02:00
// 6
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<BisectorData> bisectorDataBuffer;
2024-10-19 11:54:04 +02:00
// 7
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> classificationBuffer;
2024-10-19 11:54:04 +02:00
// 8
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<int> allocateBuffer;
2024-10-19 11:54:04 +02:00
// 9
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> indirectDispatchBuffer;
2024-10-19 11:54:04 +02:00
// 10
2024-10-15 21:35:52 +02:00
RWStructuredBuffer<uint4> neighboursBuffer;
2024-10-19 11:54:04 +02:00
// 11
2024-10-15 21:35:52 +02:00
RWStructuredBuffer<uint4> neighboursOutputBuffer;
2024-10-19 11:54:04 +02:00
// 12
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<int> memoryBuffer;
2024-10-19 11:54:04 +02:00
// 13
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> cbtBuffer;
2024-10-19 11:54:04 +02:00
// 14
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint64_t> bitFieldBuffer;
2024-10-19 11:54:04 +02:00
// 15
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<int> propagateBuffer;
2024-10-19 11:54:04 +02:00
// 16
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> simplifyBuffer;
2024-10-19 11:54:04 +02:00
// 17
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> validationBuffer;
2024-10-19 11:54:04 +02:00
// 18
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> bisectorIndicesBuffer;
2024-10-19 11:54:04 +02:00
// 19
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> visibleBisectorIndices;
2024-10-19 11:54:04 +02:00
// 20
2024-10-07 20:14:00 +02:00
RWStructuredBuffer<uint> modifiedBisectorIndices;
2024-10-19 11:54:04 +02:00
// 21
2024-10-15 21:35:52 +02:00
RWStructuredBuffer<float4> lebPositionBuffer;
2024-10-19 11:54:04 +02:00
// 22
2024-10-07 20:14:00 +02:00
StructuredBuffer<float3x3> lebMatrixCache;
2024-10-19 11:54:04 +02:00
// 23
2024-10-18 19:01:04 +02:00
globallycoherent RWStructuredBuffer<DebugStruct> debugBuffer;
2024-10-07 20:14:00 +02:00
};
ParameterBlock<ComputeParams> pParams;