'\" t .\" Title: barrier .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 01/03/2018 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "BARRIER" "3G" "01/03/2018" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" barrier \- synchronize execution of multiple shader invocations .SH "DECLARATION" .HP \w'void\ barrier('u .BI "void barrier(void);" .SH "DESCRIPTION" .PP \fIAvailable only in the Tessellation Control and Compute Shaders\fR, \fBbarrier\fR provides a partially defined order of execution between shader invocations\&. For any given static instance of \fBbarrier\fR, in a tessellation control shader, all invocations for a single input patch must enter it before any will be allowed to continue beyond it\&. For any given static instance of \fBbarrier\fR in a compute shader, all invocations within a single work group must enter it before any are allowed to continue beyond it\&. This ensures that values written by one invocation prior to a given static instance of \fBbarrier\fR can be safely read by other invocations after their call to the same static instance of \fBbarrier\fR\&. Because invocations may execute in undefined order between these \fBbarrier\fR calls, the values of a per\-vertex or per\-patch output variable, or any shared variable will be undefined in a number of cases\&. .PP \fBbarrier\fR may only be placed inside the function main() of the tessellation control shader, but may be placed anywhere in a compute shader\&. Calls to \fBbarrier\fR may not be placed within any control flow\&. Barriers are also disallowed after a return statement in the function main()\&. .SH "VERSION SUPPORT" .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ \fBOpenGL Shading Language Version\fR T} T{ \fBFunction Name\fR T}:T{ \fB1\&.10\fR T}:T{ \fB1\&.20\fR T}:T{ \fB1\&.30\fR T}:T{ \fB1\&.40\fR T}:T{ \fB1\&.50\fR T}:T{ \fB3\&.30\fR T}:T{ \fB4\&.00\fR T}:T{ \fB4\&.10\fR T}:T{ \fB4\&.20\fR T}:T{ \fB4\&.30\fR T}:T{ \fB4\&.40\fR T}:T{ \fB4\&.50\fR T} .T& l c c c c c c c c c c c c. T{ barrier T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} .TE .sp 1 .SH "COPYRIGHT" .PP Copyright \(co 2011\-2014 Khronos Group\&. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1\&.0, 8 June 1999\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&. .SH "COPYRIGHT" .br Copyright \(co 2011-2014 Khronos Group .br