summaryrefslogtreecommitdiff
path: root/tests/compute/array-param.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-01-21 10:48:31 -0800
committerGitHub <noreply@github.com>2018-01-21 10:48:31 -0800
commit4044a1d3a0605198465a7eb6e0e3c1f8b1a3c298 (patch)
tree62927d4d2722b36c8e7eb4060e741b9032686835 /tests/compute/array-param.slang
parent2079b941bc5849b6ab33774fb90cefe9c2d624cb (diff)
parentf681a1505c98995683a7fbae7ce208dc5e444b9b (diff)
Merge pull request #372 from csyonghe/master
Allow type expression as type argument, fix global param enum order
Diffstat (limited to 'tests/compute/array-param.slang')
-rw-r--r--tests/compute/array-param.slang19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/compute/array-param.slang b/tests/compute/array-param.slang
new file mode 100644
index 000000000..78ca52518
--- /dev/null
+++ b/tests/compute/array-param.slang
@@ -0,0 +1,19 @@
+//TEST(compute):COMPARE_COMPUTE:-xslang -use-ir
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
+
+RWStructuredBuffer<int> outputBuffer;
+void writeArray(inout float3 a[4])
+{
+ a[0] = float3(1, 1, 1);
+ a[1] = float3(1, 1, 1);
+ a[2] = float3(1, 1, 1);
+ a[3] = float3(1, 1, 1);
+}
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ float3 b[4];
+ writeArray(b);
+ outputBuffer[dispatchThreadID.x] = b[0].x;
+} \ No newline at end of file