| 1 |
.. _vertexelements: |
| 2 |
|
| 3 |
Vertex Elements |
| 4 |
=============== |
| 5 |
|
| 6 |
This state controls the format of the input attributes contained in |
| 7 |
pipe_vertex_buffers. There is one pipe_vertex_element array member for each |
| 8 |
input attribute. |
| 9 |
|
| 10 |
Input Formats |
| 11 |
------------- |
| 12 |
|
| 13 |
Gallium supports a diverse range of formats for vertex data. Drivers are |
| 14 |
guaranteed to support 32-bit floating-point vectors of one to four components. |
| 15 |
Additionally, they may support the following formats: |
| 16 |
|
| 17 |
* Integers, signed or unsigned, normalized or non-normalized, 8, 16, or 32 |
| 18 |
bits wide |
| 19 |
* Floating-point, 16, 32, or 64 bits wide |
| 20 |
|
| 21 |
At this time, support for varied vertex data formats is limited by driver |
| 22 |
deficiencies. It is planned to support a single uniform set of formats for all |
| 23 |
Gallium drivers at some point. |
| 24 |
|
| 25 |
Rather than attempt to specify every small nuance of behavior, Gallium uses a |
| 26 |
very simple set of rules for padding out unspecified components. If an input |
| 27 |
uses less than four components, it will be padded out with the constant vector |
| 28 |
``(0, 0, 0, 1)``. |
| 29 |
|
| 30 |
Fog, point size, the facing bit, and edge flags, all are in the standard |
| 31 |
format of ``(x, 0, 0, 1)``, and so only the first component of those inputs is |
| 32 |
used. |
| 33 |
|
| 34 |
Position |
| 35 |
%%%%%%%% |
| 36 |
|
| 37 |
Vertex position may be specified with two to four components. Using less than |
| 38 |
two components is not allowed. |
| 39 |
|
| 40 |
Colors |
| 41 |
%%%%%% |
| 42 |
|
| 43 |
Colors, both front- and back-facing, may omit the alpha component, only using |
| 44 |
three components. Using less than three components is not allowed. |
| 45 |
|
| 46 |
Members |
| 47 |
------- |
| 48 |
|
| 49 |
src_offset |
| 50 |
The byte offset of the attribute in the buffer given by |
| 51 |
vertex_buffer_index for the first vertex. |
| 52 |
instance_divisor |
| 53 |
The instance data rate divisor, used for instancing. |
| 54 |
0 means this is per-vertex data, n means per-instance data used for |
| 55 |
n consecutive instances (n > 0). |
| 56 |
vertex_buffer_index |
| 57 |
The vertex buffer this attribute lives in. Several attributes may |
| 58 |
live in the same vertex buffer. |
| 59 |
src_format |
| 60 |
The format of the attribute data. One of the PIPE_FORMAT tokens. |