summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pipeline/compute/compute-system-values.slang28
-rw-r--r--tests/pipeline/compute/compute-system-values.slang.expected.txt8
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/pipeline/compute/compute-system-values.slang b/tests/pipeline/compute/compute-system-values.slang
new file mode 100644
index 000000000..16a5ed85b
--- /dev/null
+++ b/tests/pipeline/compute/compute-system-values.slang
@@ -0,0 +1,28 @@
+// compute-system-values.slang
+
+//TEST(compute):COMPARE_COMPUTE:
+//TEST(compute):COMPARE_COMPUTE: -cpu
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer
+RWStructuredBuffer<int> outputBuffer;
+
+[numthreads(4, 2, 1)]
+void computeMain(
+ uint2 groupThreadID : SV_GroupThreadID,
+ int groupIndex : SV_GroupIndex,
+ uint3 dispatchThreadID : SV_DispatchThreadID,
+ int2 groupID : SV_GroupID)
+{
+ int tid = groupID.x + groupIndex;
+
+ int value = 0;
+ value = value*16 + groupIndex;
+ value = value*16 + groupID.x;
+ value = value*16 + groupID.y;
+ value = value*16 + groupThreadID.x;
+ value = value*16 + groupThreadID.y;
+ value = value*16 + dispatchThreadID.x;
+ value = value*16 + dispatchThreadID.y;
+
+ outputBuffer[tid] = value;
+} \ No newline at end of file
diff --git a/tests/pipeline/compute/compute-system-values.slang.expected.txt b/tests/pipeline/compute/compute-system-values.slang.expected.txt
new file mode 100644
index 000000000..85f58f88b
--- /dev/null
+++ b/tests/pipeline/compute/compute-system-values.slang.expected.txt
@@ -0,0 +1,8 @@
+0
+1001010
+2002020
+3003030
+4000101
+5001111
+6002121
+7003131