diff options
Diffstat (limited to 'tests/compute/global-type-param.slang')
| -rw-r--r-- | tests/compute/global-type-param.slang | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/compute/global-type-param.slang b/tests/compute/global-type-param.slang new file mode 100644 index 000000000..301ef1021 --- /dev/null +++ b/tests/compute/global-type-param.slang @@ -0,0 +1,30 @@ +//TEST(smoke,compute):COMPARE_COMPUTE:-xslang -use-ir +//TEST_INPUT:ubuffer(data=[0], stride=4):dxbinding(0),glbinding(0),out +//TEST_INPUT:type Impl + +RWStructuredBuffer<float> outputBuffer; + +interface IBase +{ + float compute(); +} + +struct Impl : IBase +{ + float compute() + { + return 1.0; + } +}; + +__generic_param TImpl : IBase; + +TImpl impl; + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + float outVal = impl.compute(); + outputBuffer[tid] = outVal; +}
\ No newline at end of file |
