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