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