yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
83bc342a
main
1#version 450 2#extension GL_KHR_memory_scope_semantics : require 3 4layout ( local_size_x = 1 ) in ; 5layout ( binding = 0 ) buffer BufferU { coherent uint x ; } bufferu ; 6layout ( binding = 1 , r32ui ) coherent uniform uimage2D imageu ; 7 8void main () 9{ 10// The Scope, storage-class-semantics and semantics operands of these 11// operations must be compile-time constants. Passing a non-constant used to 12// crash the front end (null TIntermConstantUnion) or trip an id/immediate 13// assert in SPIR-V generation for the Scope; each must now be diagnosed. 14int dyn = int ( gl_GlobalInvocationID . x ) ; 15 16uint origu = atomicAdd ( bufferu . x , 1u , gl_ScopeDevice , gl_StorageSemanticsBuffer , dyn ) ; 17origu = atomicLoad ( bufferu . x , gl_ScopeDevice , dyn , 0 ) ; 18atomicStore ( bufferu . x , 1u , dyn , gl_StorageSemanticsBuffer , gl_SemanticsRelease ) ; 19origu = atomicCompSwap ( bufferu . x , 0u , 1u , gl_ScopeDevice , gl_StorageSemanticsBuffer , 20gl_SemanticsAcquireRelease , gl_StorageSemanticsBuffer , dyn ) ; 21imageAtomicAdd ( imageu , ivec2 ( 0 , 0 ) , 1u , gl_ScopeDevice , gl_StorageSemanticsImage , dyn ) ; 22memoryBarrier ( gl_ScopeWorkgroup , gl_StorageSemanticsBuffer , dyn ) ; 23controlBarrier ( dyn , gl_ScopeWorkgroup , gl_StorageSemanticsBuffer , gl_SemanticsAcquireRelease ) ; 24}