diff options
| author | Yong He <yonghe@outlook.com> | 2018-01-21 10:48:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-21 10:48:31 -0800 |
| commit | 4044a1d3a0605198465a7eb6e0e3c1f8b1a3c298 (patch) | |
| tree | 62927d4d2722b36c8e7eb4060e741b9032686835 /tests/compute/global-type-param-array.slang | |
| parent | 2079b941bc5849b6ab33774fb90cefe9c2d624cb (diff) | |
| parent | f681a1505c98995683a7fbae7ce208dc5e444b9b (diff) | |
Merge pull request #372 from csyonghe/master
Allow type expression as type argument, fix global param enum order
Diffstat (limited to 'tests/compute/global-type-param-array.slang')
| -rw-r--r-- | tests/compute/global-type-param-array.slang | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/compute/global-type-param-array.slang b/tests/compute/global-type-param-array.slang new file mode 100644 index 000000000..74e52d5d4 --- /dev/null +++ b/tests/compute/global-type-param-array.slang @@ -0,0 +1,24 @@ +//TEST(compute):COMPARE_COMPUTE:-xslang -use-ir +//TEST_INPUT: cbuffer(data=[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0], stride=4):dxbinding(0),glbinding(0) +//TEST_INPUT: ubuffer(data=[0], stride=4):dxbinding(0),glbinding(0),out +//TEST_INPUT: type Pair<Arr<Base,1>, Pair<Arr<Base,2> , Base> > + +RWStructuredBuffer<float> outputBuffer; +import globalTypeParamArrayShared; + +__generic_param TImpl : IBase; + +ParameterBlock<TImpl> impl; + +float doCompute<T:IBase>(T t) +{ + return t.compute(1.0); +} + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + float outVal = doCompute<TImpl>(impl); + outputBuffer[tid] = outVal; +}
\ No newline at end of file |
