blob: 177466c9c3d5f77e0b2cc1dbe91c55cbcde62c87 (
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
41
42
43
44
|
//TEST(compute):COMPARE_COMPUTE: -shaderobj
//TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj
// test specialization of nested generic functions
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<int> outputBuffer;
interface IBRDF
{
float getF();
}
interface ILight
{
float illum<B:IBRDF>(B b);
};
struct B0 : IBRDF
{
float getF() { return 1.0; }
};
struct L0 : ILight
{
float illum<B:IBRDF>(B b) { return b.getF(); }
};
struct L1<L:ILight> : ILight
{
L l;
float illum<BXX:IBRDF>(BXX bxx) { return l.illum<BXX>(bxx); }
};
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
uint tid = dispatchThreadID.x;
L1<L0> light;
B0 b0;
float outVal = light.illum<B0>(b0);
outputBuffer[tid] = int(outVal);
}
|