summaryrefslogtreecommitdiffstats
path: root/tests/bugs/func-type-specialize.slang
blob: 7e17c5c3de1d64dcd33953748534277a8441688e (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
//TEST:SIMPLE(filecheck=CHECK):-target hlsl -entry computeMain -profile cs_6_5 -validate-ir
//TEST_INPUT:ubuffer(data=[0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;

// CHECK: void computeMain
// CHECK: RayQuery<0
interface IFoo
{
    int doThing<let f : int>(RayQuery<f> arr);
}


struct HitInfo
{
    static int makeHitInfo<let f : int>(RayQuery<f> q)
    {
        return 0;
    }
}

struct Impl : IFoo
{
    int doThing<let f : int>(RayQuery<f> arr)
    {
        return HitInfo.makeHitInfo(arr);
    }
}

RWStructuredBuffer<int> outVal;
[numthreads(1, 1, 1)]
void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
{
    Impl impl;
    RayQuery<0> q;
    outVal[dispatchThreadID.x] = impl.doThing(q);
}