-
Notifications
You must be signed in to change notification settings - Fork 0
/
BasicCompute11.hlsl
42 lines (38 loc) · 983 Bytes
/
BasicCompute11.hlsl
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
38
39
40
41
42
struct BufType
{
matrix<float, 4, 4> f[10];
};
StructuredBuffer<BufType> Buffer0 : register(t0);
StructuredBuffer<BufType> Buffer1 : register(t1);
RWStructuredBuffer<BufType> BufferOut : register(u0);
[numthreads(1, 1, 1)]
void CSMain( uint3 DTid : SV_DispatchThreadID )
{
for (int j = 0; j < 256; j++)
{
for (int i = 0; i < 9; i++)
{
BufferOut[DTid.x * 256 + j].f[i] = Buffer0[DTid.x *256 + j].f[i] * Buffer1[DTid.x *256 + j].f[i];
}
}
for (int m = 0; m < 256; m++)
{
for (int n = 0; n < 9; n++)
{
for (int p = n; p < 9; p++)
{
BufferOut[DTid.x * 256 + m].f[n] *= Buffer0[DTid.x *256 + m].f[p] * Buffer1[DTid.x *256 + m].f[p];
}
}
}
for (int m = 0; m < 256; m++)
{
for (int n = 0; n < 9; n++)
{
for (int p = n; p < 9; p++)
{
BufferOut[DTid.x * 256 + m].f[n] *= Buffer0[DTid.x *256 + m].f[p] * Buffer1[DTid.x *256 + m].f[p];
}
}
}
}