summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/glsl/storage-buffer-side-effect.slang24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/glsl/storage-buffer-side-effect.slang b/tests/glsl/storage-buffer-side-effect.slang
new file mode 100644
index 000000000..3209f763e
--- /dev/null
+++ b/tests/glsl/storage-buffer-side-effect.slang
@@ -0,0 +1,24 @@
+//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl
+#version 430
+precision highp float;
+precision highp int;
+
+//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer
+
+buffer MyBlockName2
+{
+ uint data[1];
+} outputBuffer;
+
+layout(local_size_x = 4) in;
+
+void sideEffectInit(int val)
+{
+ outputBuffer.data[0] = val;
+}
+void computeMain()
+{
+ outputBuffer.data[0] = 1000;
+ sideEffectInit(4);
+ // BUF: 4
+}