Bump github/codeql-action from 3.27.1 to 3.27.4
[glslang.git] / Test / spv.memoryScopeSemantics_Error.comp
blob1b856717a1dd707dbf9156ad8f1ea2ebce5ece55
1 #version 450\r
2 #extension GL_KHR_memory_scope_semantics : require\r
3 \r
4 \r
5 shared uint value;\r
6 shared int atomi;\r
7 shared uint atomu;\r
8 layout(binding = 0, r32ui) workgroupcoherent uniform uimage2D imageu;\r
9 layout(binding = 1, r32i) coherent uniform iimage2D imagei;\r
10 layout (binding = 2) buffer BufferU { workgroupcoherent uint x; } bufferu;\r
11 layout (binding = 3) subgroupcoherent buffer BufferI { uint x; } bufferi;\r
13 void main()\r
14 {\r
15     atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire);\r
16     int origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease);\r
17     atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquireRelease);\r
18     atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_StorageSemanticsBuffer);\r
19     origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_SemanticsAcquire, gl_SemanticsAcquire);\r
20     memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, 0);\r
21     memoryBarrier(gl_ScopeWorkgroup, 0, gl_SemanticsRelease);\r
22     memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease | gl_SemanticsAcquire);\r
23     atomicAdd(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsAcquire);\r
24     uint origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquireRelease);\r
25     memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsMakeVisible);\r
26     memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsMakeAvailable);\r
27     memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsVolatile);\r
28     atomicCompSwap(bufferi.x, 10u, 10u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsVolatile, gl_StorageSemanticsBuffer, gl_SemanticsAcquire);\r
29 }\r