include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / manglsl / barrier.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="barrier">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>barrier</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>barrier</refname>
17 <refpurpose>synchronize execution of multiple shader invocations</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>barrier</function></funcdef>
23 <paramdef>void</paramdef>
24 </funcprototype>
25 </funcsynopsis>
26 </refsynopsisdiv>
27 <refsect1 id="description"><title>Description</title>
28 <para>
29 <emphasis>Available only in the Tessellation Control and Compute Shaders</emphasis>, <function>barrier</function> provides
30 a partially defined order of execution between shader invocations. For any given static instance of <function>barrier</function>,
31 in a tessellation control shader, all invocations for a single input patch must enter it before any will be allowed
32 to continue beyond it. For any given static instance of <function>barrier</function> in a compute shader, all invocations
33 within a single work group must enter it before any are allowed to continue beyond it.
34 This ensures that values written by one invocation prior to a given static instance
35 of <function>barrier</function> can be safely read by other invocations after their call to the same static
36 instance of <function>barrier</function>. Because invocations may execute in undefined order between these
37 <function>barrier</function> calls, the values of a per-vertex or per-patch output variable, or any shared variable will be undefined
38 in a number of cases.
39 </para>
40 <para>
41 <function>barrier</function> may only be placed inside the function <code>main()</code> of the tessellation
42 control shader, but may be placed anywhere in a compute shader. Calls to <function>barrier</function> may not
43 be placed within any control flow. Barriers are also disallowed after a return
44 statement in the function <code>main()</code>.
45 </para>
46 </refsect1>
47 <refsect1 id="versions"><title>Version Support</title>
48 <informaltable frame="topbot">
49 #VARTABLECOLS#
50 <thead>
51 #FUNCTABLEHEADER#
52 <row>
53 <entry>barrier</entry>#newin40#
54 </row>
55 </thead>
56 </tgroup>
57 </informaltable>
58 </refsect1>
59 <refsect1 id="Copyright"><title>Copyright</title>
60 <para>
61 Copyright <trademark class="copyright"></trademark> 2011-2012 Khronos Group.
62 This material may be distributed subject to the terms and conditions set forth in
63 the Open Publication License, v 1.0, 8 June 1999.
64 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
65 </para>
66 </refsect1>
67 </refentry>