21.06.2014 Views

OpenGL 4.1 (Compatibility Profile) - July 25, 2010

OpenGL 4.1 (Compatibility Profile) - July 25, 2010

OpenGL 4.1 (Compatibility Profile) - July 25, 2010

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.15. TESSELLATION 148<br />

The number of vertices in the output patch is fixed when the program is linked,<br />

and is specified in tessellation control shader source code using the output layout<br />

qualifier vertices, as described in the <strong>OpenGL</strong> Shading Language Specification.<br />

A program will fail to link if the output patch vertex count is not specified by<br />

any tessellation control shader object attached to the program, if it is specified<br />

differently by multiple tessellation control shader objects, if it is less than or equal<br />

to zero, or if it is greater than the implementation-dependent maximum patch size.<br />

The output patch vertex count may be queried by calling GetProgramiv with the<br />

symbolic constant TESS_CONTROL_OUTPUT_VERTICES.<br />

Tessellation control shaders are created as described in section 2.1<strong>4.1</strong>, using a<br />

type of TESS_CONTROL_SHADER. When a new input patch is received, the tessellation<br />

control shader is run once for each vertex in the output patch. The tessellation<br />

control shader invocations collectively specify the per-vertex and per-patch<br />

attributes of the output patch. The per-vertex attributes are obtained from the pervertex<br />

output variables written by each invocation. Each tessellation control shader<br />

invocation may only write to per-vertex output variables corresponding to its own<br />

output patch vertex. The output patch vertex number corresponding to a given<br />

tessellation control point shader invocation is given by the built-in variable gl_-<br />

InvocationID. Per-patch attributes are taken from the per-patch output variables,<br />

which may be written by any tessellation control shader invocation. While tessellation<br />

control shader invocations may read any per-vertex and per-patch output variable<br />

and write any per-patch output variable, reading or writing output variables<br />

also written by other invocations has ordering hazards discussed below.<br />

Tessellation Control Shader Variables<br />

Tessellation control shaders can access uniforms belonging to the current program<br />

object. The amount of storage available for uniform variables in the<br />

default uniform block accessed by a tessellation control shader is specified<br />

by the value of the implementation-dependent constant MAX_TESS_CONTROL_-<br />

UNIFORM_COMPONENTS. The total amount of combined storage available for uniform<br />

variables in all uniform blocks accessed by a tessellation control shader (including<br />

the default uniform block) is specified by the value of the implementationdependent<br />

constant MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS.<br />

These values represent the numbers of individual floating-point, integer, or boolean<br />

values that can be held in uniform variable storage for a tessellation evaluation<br />

shader. A link error is generated if an attempt is made to utilize more than the<br />

space available for tessellation control shader uniform variables. Uniforms are manipulated<br />

as described in section 2.14.7. Tessellation control shaders also have<br />

access to samplers to perform texturing operations, as described in section 2.14.9.<br />

<strong>OpenGL</strong> <strong>4.1</strong> (<strong>Compatibility</strong> <strong>Profile</strong>) - <strong>July</strong> <strong>25</strong>, <strong>2010</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!