blob: 73f739095cdcbdf0244e6f618990d4398c5fa2fd (
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
|
//TEST:COMPARE_COMPUTE_EX: -slang -compute
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;
struct SomeType
{
float2x2 v;
};
float mul(SomeType a, float2 v) { return mul(a.v, v).x; }
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
uint tid = dispatchThreadID.x;
float inVal = float(tid);
float2 v = float2(inVal, inVal + 2);
SomeType t = { inVal + 1, 0, 1, 0 };
outputBuffer[tid] = mul(t, v).x;
}
|