Opentk/Source/Bind/Specifications/Docs/glTransformFeedbackVaryings.xml
2010-11-21 14:34:29 +00:00

158 lines
7.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glTransformFeedbackVaryings">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glTransformFeedbackVaryings</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glTransformFeedbackVaryings</refname>
<refpurpose>specify values to record in transform feedback buffers</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glTransformFeedbackVaryings</function></funcdef>
<paramdef>GLuint<parameter>program</parameter></paramdef>
<paramdef>GLsizei<parameter>count</parameter></paramdef>
<paramdef>const char **<parameter>varyings</parameter></paramdef>
<paramdef>GLenum<parameter>bufferMode</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>
The name of the target program object.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>count</parameter></term>
<listitem>
<para>
The number of varying variables used for transform feedback.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>varyings</parameter></term>
<listitem>
<para>
An array of <parameter>count</parameter> zero-terminated strings specifying the
names of the varying variables to use for transform feedback.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bufferMode</parameter></term>
<listitem>
<para>
Identifies the mode used to capture the varying variables when transform feedback is active.
<parameter>bufferMode</parameter> must be <constant>GL_INTERLEAVED_ATTRIBS</constant> or <constant>GL_SEPARATE_ATTRIBS</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
The names of the vertex or geometry shader outputs to be recorded in transform feedback mode
are specified using <function>glTransformFeedbackVaryings</function>. When a geometry shader
is active, transform feedback records the values of selected geometry shader output variables
from the emitted vertices. Otherwise, the values of the selected vertex shader outputs are
recorded.
</para>
<para>
The state set by <function>glTranformFeedbackVaryings</function> is stored and takes effect
next time <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> is called
on <parameter>program</parameter>. When <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
is called, <parameter>program</parameter> is linked so that the values of the specified varying variables
for the vertices of each primitive generated by the GL are written to a single buffer
object if <parameter>bufferMode</parameter> is <constant>GL_INTERLEAVED_ATTRIBS</constant> or multiple
buffer objects if <parameter>bufferMode</parameter> is <constant>GL_SEPARATE_ATTRIBS</constant>.
</para>
<para>
In addition to the errors generated by <function>glTransformFeedbackVaryings</function>, the
program <parameter>program</parameter> will fail to link if:
<itemizedlist>
<listitem>
<para>
The count specified by <function>glTransformFeedbackVaryings</function> is non-zero, but the
program object has no vertex or geometry shader.
</para>
</listitem>
<listitem>
<para>
Any variable name specified in the <parameter>varyings</parameter> array is not declared as an output
in the vertex shader (or the geometry shader, if active).
</para>
</listitem>
<listitem>
<para>
Any two entries in the <parameter>varyings</parameter> array specify the same varying variable.
</para>
</listitem>
<listitem>
<para>
The total number of components to capture in any varying variable in <parameter>varyings</parameter>
is greater than the constant <constant>GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS</constant>
and the buffer mode is <constant>GL_SEPARATE_ATTRIBS</constant>.
</para>
</listitem>
<listitem>
<para>
The total number of components to capture is greater than the constant
<constant>GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS</constant> and the buffer
mode is <constant>GL_INTERLEAVED_ATTRIBS</constant>.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glGetTransformFeedbackVarying</function> is available only if the GL version is 3.0 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter> is not
the name of a program object.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>bufferMode</parameter> is <constant>GL_SEPARATE_ATTRIBS</constant>
and <parameter>count</parameter> is greater than the implementation-dependent limit <constant>GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS</constant>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGetTransformFeedbackVarying</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glBeginTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEndTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetTransformFeedbackVarying</refentrytitle></citerefentry>
</para>
</refsect1> <refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>