summaryrefslogtreecommitdiff
path: root/tests/compute/generics-constructor.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2017-11-03 09:38:02 -0400
committerYong He <yonghe@outlook.com>2017-11-03 09:38:02 -0400
commita0458266d7cd5d802b8c51e6a997b4bf0d9beb82 (patch)
tree39f16538178907240e59b8e531ae153391805833 /tests/compute/generics-constructor.slang
parentd5e2319c33115d0241dd9d2047c0a5f029553dde (diff)
in-progress work
Diffstat (limited to 'tests/compute/generics-constructor.slang')
-rw-r--r--tests/compute/generics-constructor.slang17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/compute/generics-constructor.slang b/tests/compute/generics-constructor.slang
new file mode 100644
index 000000000..c7473cc8b
--- /dev/null
+++ b/tests/compute/generics-constructor.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