Files
Seele/res/shaders/ComputeFrustums.slang
T

32 lines
751 B
Plaintext
Raw Normal View History

2020-06-02 11:46:18 +02:00
import Common;
struct ComputeShaderInput
{
uint3 groupID : SV_GroupID;
uint3 groupThreadID : SV_GroupThreadID;
uint3 dispatchThreadID : SV_DispatchThreadID;
uint groupIndex : SV_GroupIndex;
};
2023-11-05 10:36:01 +01:00
struct DispatchParams
2020-06-02 11:46:18 +02:00
{
uint3 numThreadGroups;
uint pad0;
uint3 numThreads;
uint pad1;
2023-11-08 23:27:21 +01:00
RWStructuredBuffer<Frustum> frustums;
2020-06-02 11:46:18 +02:00
}
2023-11-08 23:27:21 +01:00
ParameterBlock<DispatchParams> pDispatchParams;
2020-06-02 11:46:18 +02:00
[numthreads(BLOCK_SIZE, BLOCK_SIZE, 1)]
[shader("compute")]
void computeFrustums(ComputeShaderInput in)
{
2023-11-08 23:27:21 +01:00
if(in.dispatchThreadID.x < pDispatchParams.numThreads.x && in.dispatchThreadID.y < pDispatchParams.numThreads.y)
2020-06-02 11:46:18 +02:00
{
2023-11-08 23:27:21 +01:00
uint index = in.dispatchThreadID.x + (in.dispatchThreadID.y * pDispatchParams.numThreads.x);
//pDispatchParams.frustums[index] = frustum;
2020-06-02 11:46:18 +02:00
}
}