Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  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 edgeflags, all are in the standard format
  31. of ``(x, 0, 0, 1)``, and so only the first component of those inputs is used.
  32.  
  33. Position
  34. %%%%%%%%
  35.  
  36. Vertex position may be specified with two to four components. Using less than
  37. two components is not allowed.
  38.  
  39. Colors
  40. %%%%%%
  41.  
  42. Colors, both front- and back-facing, may omit the alpha component, only using
  43. three components. Using less than three components is not allowed.
  44.  
  45. Members
  46. -------
  47.  
  48. src_offset
  49.     The byte offset of the attribute in the buffer given by
  50.     vertex_buffer_index for the first vertex.
  51. instance_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).
  55. vertex_buffer_index
  56.     The vertex buffer this attribute lives in. Several attributes may
  57.     live in the same vertex buffer.
  58. src_format
  59.     The format of the attribute data. One of the PIPE_FORMAT tokens.
  60.