summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/resource-type-in-dynamic-dispatch.slang
blob: 114eb800b4ced15abff3ab3287b4c6b61aa619d4 (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
//TEST:SIMPLE(filecheck=CHECK): -target spirv
// CHECK: type 'FooImpl' contains fields that cannot be packed into ordinary bytes for dynamic dispatch.
interface IFoo
{
    float get();
}

export struct FooImpl : IFoo
{
    Texture2D t;
    float get() { return 1.0; }
}

export struct FooImpl2 : IFoo
{
    float v;
    float get() { return v; }
}


RWStructuredBuffer<float> outputBuffer;

[numthreads(1,1,1)]
void computeMain()
{
    IFoo f = createDynamicObject<IFoo>(0, 5);
    outputBuffer[0] = f.get();
}