diff options
| author | YONGH\yongh <yonghe@outlook.com> | 2017-11-02 19:21:15 -0400 |
|---|---|---|
| committer | YONGH\yongh <yonghe@outlook.com> | 2017-11-02 19:21:15 -0400 |
| commit | d5e2319c33115d0241dd9d2047c0a5f029553dde (patch) | |
| tree | b89aef27f2330e7c568b0f799f0902015fdd4f18 /tests/compute | |
| parent | e2b97607977977fd2dbe298c2bb4512f4715dd4c (diff) | |
work inprogress
Diffstat (limited to 'tests/compute')
| -rw-r--r-- | tests/compute/assoctype-complex.slang (renamed from tests/compute/assoctype-complex.slang._ignore) | 25 | ||||
| -rw-r--r-- | tests/compute/generics-constraint1.slang | 17 |
2 files changed, 37 insertions, 5 deletions
diff --git a/tests/compute/assoctype-complex.slang._ignore b/tests/compute/assoctype-complex.slang index 3e590b2e0..de3f1a103 100644 --- a/tests/compute/assoctype-complex.slang._ignore +++ b/tests/compute/assoctype-complex.slang @@ -1,3 +1,6 @@ +//TEST(smoke, compute):COMPARE_COMPUTE:-xslang -use-ir +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out + RWStructuredBuffer<float> outputBuffer; interface IBase { @@ -27,18 +30,30 @@ struct Simple : ISimple return v0.sub(4, v1.sub(1,2)); } }; - +/* __generic<T:ISimple> T.U.V test(T simple, T.U v0, T.U v1) { return simple.add(v0, v1); } +__generic<T:__BuiltinArithmeticType> +T test(T v0, T v1) +{ + return v0 + v1; +} +*/ +__generic<T:__BuiltinFloatingPointType> +T test(T v0, T v1) +{ + return T(3.0); +} [numthreads(4, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) { - Simple s; - Val v0, v1; - float outVal = test<Simple>(s, v0, v1); // == 1.0 - outputBuffer[0] = outVal; + //Simple s; + //Val v0, v1; + //float outVal = test(s, v0, v1); // == 1.0 + float outVal = test<float>(1.0, 2.0); + outputBuffer[dispatchThreadID.x] = outVal; }
\ No newline at end of file diff --git a/tests/compute/generics-constraint1.slang b/tests/compute/generics-constraint1.slang new file mode 100644 index 000000000..ff90c1cc9 --- /dev/null +++ b/tests/compute/generics-constraint1.slang @@ -0,0 +1,17 @@ +//TEST(smoke, compute):COMPARE_COMPUTE:-xslang -use-ir +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out + +RWStructuredBuffer<float> outputBuffer; + +__generic<T:__BuiltinFloatingPointType> +T test(T v0, T v1) +{ + return T(3.0); +} + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + float outVal = test<float>(1.0, 2.0); + outputBuffer[dispatchThreadID.x] = outVal; +}
\ No newline at end of file |
