4 // require_extensions: GL_ARB_fragment_shader_interlock
8 /* The GL_ARB_fragment_shader_interlock spec says:
10 * The beginInvocationInterlockARB() and endInvocationInterlockARB() may
11 * only be placed inside the function main() of a fragment shader and may
12 * not be called within any flow control. These functions may not be
13 * called after a return statement in the function main(), but may be
14 * called after a discard statement.
18 * (8) What restrictions should be imposed on the use of the
19 * beginInvocationInterlockARB() and endInvocationInterlockARB()
20 * functions delimiting a critical section?
22 * RESOLVED: We impose restrictions similar to those on the barrier()
23 * built-in function in tessellation control shaders to ensure that any
24 * shader using this functionality has a single critical section that can
25 * be easily identified during compilation...
27 * The GLSL 4.60 spec says:
29 * For tessellation control shaders, the barrier() function may only be
30 * placed inside the function main() of the tessellation control shader and
31 * may not be called within any control flow. Barriers are also disallowed
32 * after a return statement in the function main(). Any such misplaced
33 * barriers result in a compile-time error.
35 * From this we infer that the first errors mentioned in the
36 * GL_ARB_fragment_shader_interlock spec are intended to generate compile-time
40 #extension GL_ARB_fragment_shader_interlock: require
45 beginInvocationInterlockARB();
49 endInvocationInterlockARB();