blob: f8995f9c93df53fc078df41697e345b1d4f55ffd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// parameter-block.slang
struct CB
{
uint4 value;
}
struct MaterialSystem
{
CB cb;
StructuredBuffer<uint4> data;
}
struct Scene
{
CB sceneCb;
StructuredBuffer<uint4> data;
ParameterBlock<MaterialSystem> material;
}
cbuffer PerView
{
uint4 value;
}
ParameterBlock<Scene> scene;
RWStructuredBuffer<uint4> resultBuffer;
// Main entry-point. Applies the transformation encoded by `transformer`
// to all elements in `buffer`.
[shader("compute")]
[numthreads(4,1,1)]
void computeMain(uint3 sv_dispatchThreadID : SV_DispatchThreadID)
{
resultBuffer[sv_dispatchThreadID.x] = value.x + scene.sceneCb.value.x + scene.data[0].x + scene.material.cb.value.x + scene.material.data[0].x;
}
|