1#version 450 2#extension GL_ARB_fragment_shader_interlock : require 3 4layout(pixel_interlock_ordered) in; 5 6layout(binding = 0, rgba8) uniform writeonly image2D img; 7layout(binding = 1, r32ui) uniform uimage2D img2; 8layout(binding = 2) coherent buffer Buffer 9{ 10 int foo; 11 uint bar; 12}; 13 14void main() 15{ 16 beginInvocationInterlockARB(); 17 imageStore(img, ivec2(0, 0), vec4(1.0, 0.0, 0.0, 1.0)); 18 imageAtomicAdd(img2, ivec2(0, 0), 1u); 19 foo += 42; 20 atomicAnd(bar, 0xff); 21 endInvocationInterlockARB(); 22} 23