blob: 63b6db4fe2eb327686dad3bcb452fd55581fc247 (
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
38
39
40
|
//TEST(compute):COMPARE_COMPUTE:-xslang -use-ir
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
// test specialization of nested generic functions
RWStructuredBuffer<int> outputBuffer;
interface IGetF
{
float getF();
}
struct GetFImpl : IGetF
{
float getF() { return 1.0; }
};
struct GetFImpl2 : IGetF
{
float getF() { return -1.0; }
};
struct GenStruct<T : IGetF>
{
T x;
float genGet<U : IGetF>(U y)
{
return x.getF() + y.getF();
}
};
[numthreads(1, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
uint tid = dispatchThreadID.x;
GenStruct<GetFImpl> obj1;
GetFImpl2 obj2;
float outVal = obj1.genGet(obj2);
outputBuffer[tid] = int(outVal);
}
|