| 1 |
#version 450 |
| 2 |
#extension GL_ARB_fragment_shader_interlock : require |
| 3 |
|
| 4 |
layout(sample_interlock_unordered) in; |
| 5 |
|
| 6 |
layout(binding = 0, rgba8) uniform writeonly image2D img; |
| 7 |
layout(binding = 1, r32ui) uniform uimage2D img2; |
| 8 |
layout(binding = 2) coherent buffer Buffer |
| 9 |
{ |
| 10 |
int foo; |
| 11 |
uint bar; |
| 12 |
}; |
| 13 |
|
| 14 |
void 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 |
} |