summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/glslang/src/Test/spv.atomic.comp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/glslang/src/Test/spv.atomic.comp')
-rw-r--r--chromium/third_party/glslang/src/Test/spv.atomic.comp47
1 files changed, 47 insertions, 0 deletions
diff --git a/chromium/third_party/glslang/src/Test/spv.atomic.comp b/chromium/third_party/glslang/src/Test/spv.atomic.comp
new file mode 100644
index 00000000000..827adefe2b2
--- /dev/null
+++ b/chromium/third_party/glslang/src/Test/spv.atomic.comp
@@ -0,0 +1,47 @@
+#version 310 es
+
+#extension GL_ARB_gl_spirv : enable
+
+layout(binding = 0) uniform atomic_uint counter;
+
+layout(binding = 0, offset = 4) uniform atomic_uint countArr[4];
+shared uint value;
+
+int arrX[gl_WorkGroupSize.x];
+int arrY[gl_WorkGroupSize.y];
+int arrZ[gl_WorkGroupSize.z];
+
+uint func(atomic_uint c)
+{
+ return atomicCounterIncrement(c);
+}
+
+void main()
+{
+ memoryBarrierAtomicCounter();
+ func(counter);
+ uint val = atomicCounter(countArr[2]);
+ atomicCounterDecrement(counter);
+}
+
+shared int atomi;
+shared uint atomu;
+
+layout (std140, binding = 0) restrict buffer dataSSB
+{
+ float f;
+ ivec4 n_frames_rendered;
+} result;
+
+void atoms()
+{
+ int origi = atomicAdd(atomi, 3);
+ uint origu = atomicAnd(atomu, value);
+ origu = atomicOr(atomu, 7u);
+ origu = atomicXor(atomu, 7u);
+ origu = atomicMin(atomu, value);
+ origi = atomicMax(atomi, 7);
+ origi = atomicExchange(atomi, origi);
+ origu = atomicCompSwap(atomu, 10u, value);
+ atomicAdd(result.n_frames_rendered.z, 1);
+}