summaryrefslogtreecommitdiffstats
path: root/tests/bugs/rwstructuredbuffer-existential-in-struct.slang
blob: 2b5be80aed4b647446b36d1ac898b62c94cb1cda (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
//DISABLE_TEST(compute):COMPARE_COMPUTE:-dx11 -shaderobj
// TODO: disable this test to get new gfx checked in, need to re-enable
// after shader-object binding model is fixed.

[anyValueSize(8)]
interface IMaterial
{
    float eval();
}

struct MaterialImpl : IMaterial
{
    float eval() { return 0.0f; }
};

struct Parameters
{
    uint ordinary;

//TEST_INPUT: entryPointExistentialType MaterialImpl
//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0], stride=4):name=params.materials
    RWStructuredBuffer<IMaterial> materials;

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=params.result
    RWStructuredBuffer<float> result;
};

[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID, uniform Parameters params, uniform int id)
{
    uint tid = dispatchThreadID.x;
    float rs = params.materials[0].eval();
    params.result[tid] = rs;
}