1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glVertexAttribFormat">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glVertexAttribFormat
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glVertexAttribFormat
</refname>
17 <refpurpose>specify the organization of vertex arrays
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glVertexAttribFormat
</function></funcdef>
23 <paramdef>GLuint
<parameter>attribindex
</parameter></paramdef>
24 <paramdef>GLint
<parameter>size
</parameter></paramdef>
25 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
26 <paramdef>GLboolean
<parameter>normalized
</parameter></paramdef>
27 <paramdef>GLuint
<parameter>relativeoffset
</parameter></paramdef>
32 <funcdef>void
<function>glVertexAttribIFormat
</function></funcdef>
33 <paramdef>GLuint
<parameter>attribindex
</parameter></paramdef>
34 <paramdef>GLint
<parameter>size
</parameter></paramdef>
35 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
36 <paramdef>GLuint
<parameter>relativeoffset
</parameter></paramdef>
41 <funcdef>void
<function>glVertexAttribLFormat
</function></funcdef>
42 <paramdef>GLuint
<parameter>attribindex
</parameter></paramdef>
43 <paramdef>GLint
<parameter>size
</parameter></paramdef>
44 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
45 <paramdef>GLuint
<parameter>relativeoffset
</parameter></paramdef>
49 <refsect1 id=
"parameters"><title>Parameters
</title>
52 <term><parameter>attribindex
</parameter></term>
55 The generic vertex attribute array being described.
60 <term><parameter>size
</parameter></term>
63 The number of values per vertex that are stored in the array.
68 <term><parameter>type
</parameter></term>
71 The type of the data stored in the array.
76 <term><parameter>normalized
</parameter></term>
79 The distance between elements within the buffer.
84 <term><parameter>relativeoffset
</parameter></term>
87 The distance between elements within the buffer.
93 <refsect1 id=
"description"><title>Description
</title>
95 <function>glVertexAttribFormat
</function>,
<function>glVertexAttribIFormat
</function> and
96 <function>glVertexAttribLFormat
</function> specify the organization of data in vertex arrays.
97 <parameter>attribindex
</parameter> specifies the index of the generic vertex attribute
98 array whose data layout is being described, and must be less
99 than the value of
<constant>GL_MAX_VERTEX_ATTRIBS
</constant>.
102 <parameter>size
</parameter> determines the number of components per vertex are allocated
103 to the specifed attribute and must be
1,
2,
3 or
4.
<parameter>type
</parameter> indicates
104 the type of the data. If
<parameter>type
</parameter> is one of
<constant>GL_BYTE
</constant>,
105 <constant>GL_SHORT
</constant>,
<constant>GL_INT
</constant>,
<constant>GL_FIXED
</constant>,
106 <constant>GL_FLOAT
</constant>,
<constant>GL_HALF_FLOAT
</constant>, and
107 <constant>GL_DOUBLE
</constant> indicate types
<code>GLbyte
</code>,
<code>GLshort
</code>,
108 <code>GLint
</code>,
<code>GLfixed
</code>,
<code>GLfloat
</code>,
<code>GLhalf
</code>, and
109 <code>GLdouble
</code>, respectively; the values
<constant>GL_UNSIGNED_BYTE
</constant>,
110 <constant>GL_UNSIGNED_SHORT
</constant>, and
<constant>GL_UNSIGNED_INT
</constant> indicate types
111 <code>GLubyte
</code>,
<code>GLushort
</code>, and
<code>GLuint
</code>,
112 respectively; and the values
<constant>GL_INT_2_10_10_10_REV
</constant> and
113 <constant>GL_UNSIGNED_INT_2_10_10_10_REV
</constant> indicating respectively four signed or
114 unsigned elements packed into a single
<code>GLuint
</code>.
117 <function>glVertexAttribLFormat
</function> is used to specify layout for
118 data associated with a generic attribute variable declared as
64-bit double precision
119 components. For
<function>glVertexAttribLFormat
</function>,
<parameter>type
</parameter>
120 must be
<constant>GL_DOUBLE
</constant>. In contrast to
<function>glVertexAttribFormat
</function>,
121 which will cause data declared as
<constant>GL_DOUBLE
</constant> to be converted to
32-bit
122 representation,
<function>glVertexAttribLFormat
</function> causes such data to be left
123 in its natural,
64-bit representation.
126 For
<function>glVertexAttribFormat
</function>, if
<parameter>normalized
</parameter> is
127 <constant>GL_TRUE
</constant>, then integer data is normalized to the range [-
1,
1] or
128 [
0,
1] if it is signed or unsigned, respectively. If
<parameter>noramlized
</parameter> is
129 <constant>GL_FALSE
</constant> then integer data is directly converted to floating point.
132 <parameter>relativeoffset
</parameter> is the offset, measured in basic machine units
133 of the first element relative to the start of the vertex buffer binding this attribute
137 <function>glVertexAttribFormat
</function> should be used to describe vertex attribute
138 layout for floating-point vertex attributes,
<function>glVertexAttribIFormat
</function>
139 should be used to describe vertex attribute layout for integer vertex attribute
140 and
<function>glVertexAttribLFormat
</function> should be used to describe the layout
141 for
64-bit vertex attributes. Data for an array specified by
142 <function>glVertexAttribIFormat
</function> will always be left as integer values;
143 such data are referred to as pure integers.
146 <refsect1 id=
"errors"><title>Errors
</title>
148 <constant>GL_INVAILD_VALUE
</constant> is generated if
<parameter>attribindex
</parameter> is greater than
149 or equal to the value of
<constant>GL_MAX_VERTEX_ATTRIBS
</constant>.
152 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>size
</parameter> is not
153 one of the accepted values.
156 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>relativeoffset
</parameter> is greater
157 than the value of
<constant>GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET
</constant>.
160 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>type
</parameter> is not
161 one of the accepted tokens.
164 <constant>GL_INVALID_OPERATION
</constant> is generated if no vertex array object is bound.
167 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
169 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with arguments
<constant>GL_MAX_VERTEX_ATTRIB_BINDINGS
</constant>,
170 or
<constant>GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET
</constant>.
173 <citerefentry><refentrytitle>glGetVertexAttrib
</refentrytitle></citerefentry> with argument
<constant>GL_VERTEX_ATTRIB_RELATIVE_OFFSET
</constant>.
176 <refsect1 id=
"seealso"><title>See Also
</title>
178 <citerefentry><refentrytitle>glBindVertexBuffer
</refentrytitle></citerefentry>,
179 <citerefentry><refentrytitle>glVertexAttribBinding
</refentrytitle></citerefentry>,
180 <citerefentry><refentrytitle>glVertexAttribPointer
</refentrytitle></citerefentry>,
181 <citerefentry><refentrytitle>glVertexBindingDivisor
</refentrytitle></citerefentry>,
182 <citerefentry><refentrytitle>glVertexAttribPointer
</refentrytitle></citerefentry>.
185 <refsect1 id=
"Copyright"><title>Copyright
</title>
187 Copyright
<trademark class=
"copyright"></trademark> 2012 Khronos Group.
188 This material may be distributed subject to the terms and conditions set forth in
189 the Open Publication License, v
1.0,
8 June
1999.
190 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.