'\" t .\" Title: gl_ViewportIndex .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 05/21/2015 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GL_VIEWPORTINDEX" "3G" "05/21/2015" "[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" gl_ViewportIndex \- contains the index of the viewport to be used in viewport transformation and scissoring .SH "DECLARATION" .PP .nf // In geometry shaders .fi .sp out\ \&int\ \&gl_ViewportIndex\ \&; .PP .nf // In fragment shaders .fi .sp in\ \&int\ \&gl_ViewportIndex\ \&; .SH "DESCRIPTION" .PP In the geometry language, \fIgl_ViewportIndex\fR is used to specify the index of the viewport to which the next primitive emitted from the shader should be drawn\&. Primitives generated by the geometry shader will undergo viewport transformation and scissor testing using the viewport transformation and scissor rectangle selected by the value of \fIgl_ViewportIndex\fR\&. The viewport index used will come from one of the vertices in the primitive being shaded\&. However, which vertex the viewport index comes from is implementation\-defined, and so it is recommended to use the same viewport index for all vertices of a primitive\&. If a geometry shader does not assign a value to \fIgl_ViewportIndex\fR, viewport transform and scissor rectangle zero will be used\&. If a geometry shader statically assigns a value to \fIgl_ViewportIndex\fR and there is a path through the shader that does not assign a value to \fIgl_ViewportIndex\fR, the value of \fIgl_ViewportIndex\fR is undefined for executions of the shader that take that path\&. .PP In the fragment language, \fIgl_ViewportIndex\fR will have the same value that was written to the output variable \fIgl_ViewportIndex\fR in the geometry stage\&. If the geometry stage does not dynamically assign to \fIgl_ViewportIndex\fR, the value of \fIgl_ViewportIndex\fR in the fragment shader will be undefined\&. If the geometry stage makes no static assignment to \fIgl_ViewportIndex\fR, the fragment stage will read zero\&. Otherwise, the fragment stage will read the same value written by the geometry stage, even if that value is out of range\&. If a fragment shader contains a static access to \fIgl_ViewportIndex\fR, it will count against the implementation defined limit for the maximum number of inputs to the fragment stage\&. .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 l c c c c c c c c c c c c. T{ gl_ViewportIndex (geometry stage) 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} T{ gl_ViewportIndex (fragment stage) 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 .SH "SEE ALSO" .PP \fBgl_Layer\fR() .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