Mesa (master): vbo: s/VBO_ATTRIB_INDEX/VBO_ATTRIB_COLOR_INDEX/

Brian Paul brianp at kemper.freedesktop.org
Mon Jan 29 16:06:24 UTC 2018


Module: Mesa
Branch: master
Commit: 41cd3ee5a2bcb8b542c58e886442eb752b013ec7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=41cd3ee5a2bcb8b542c58e886442eb752b013ec7

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jan 19 21:44:20 2018 -0700

vbo: s/VBO_ATTRIB_INDEX/VBO_ATTRIB_COLOR_INDEX/

To match the VERT_ATTRIB_COLOR_INDEX name.
Give a name to the previously anonymous enum of VBO_ATTRIB_x values.
Update the comment on the enum.

Reviewed-by: Mathias Fröhlich <mathias.froehlich at web.de>

---

 src/mesa/vbo/vbo_attrib.h     | 21 +++++++++++----------
 src/mesa/vbo/vbo_attrib_tmp.h |  4 ++--
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/mesa/vbo/vbo_attrib.h b/src/mesa/vbo/vbo_attrib.h
index fb11596e88..ba36ab75aa 100644
--- a/src/mesa/vbo/vbo_attrib.h
+++ b/src/mesa/vbo/vbo_attrib.h
@@ -34,22 +34,23 @@
 
 
 /*
- * Note: The first attributes match the VERT_ATTRIB_* definitions
- * in mtypes.h.  However, the tnl module has additional attributes
- * for materials, color indexes, edge flags, etc.
+ * Note: The first 32 attributes match the VERT_ATTRIB_* definitions.
+ * However, we have extra attributes for storing per-vertex glMaterial
+ * values.  The material attributes get shifted into the generic positions
+ * at draw time.
+ *
+ * One reason we can't alias materials and generics here is display lists.
+ * A display list might contain both generic attributes and material
+ * attributes which are selected at draw time depending on whether we're
+ * using fixed function or a shader.  <sigh>
  */
-/* Although it's nice to use these as bit indexes in a DWORD flag, we
- * could manage without if necessary.  Another limit currently is the
- * number of bits allocated for these numbers in places like vertex
- * program instruction formats and register layouts.
- */
-enum {
+enum vbo_attrib {
    VBO_ATTRIB_POS,
    VBO_ATTRIB_NORMAL,
    VBO_ATTRIB_COLOR0,
    VBO_ATTRIB_COLOR1,
    VBO_ATTRIB_FOG,
-   VBO_ATTRIB_INDEX,
+   VBO_ATTRIB_COLOR_INDEX,
    VBO_ATTRIB_EDGEFLAG,
    VBO_ATTRIB_TEX0,
    VBO_ATTRIB_TEX1,
diff --git a/src/mesa/vbo/vbo_attrib_tmp.h b/src/mesa/vbo/vbo_attrib_tmp.h
index 126e4ef0d6..fd24e571c7 100644
--- a/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/src/mesa/vbo/vbo_attrib_tmp.h
@@ -445,14 +445,14 @@ static void GLAPIENTRY
 TAG(Indexf)(GLfloat f)
 {
    GET_CURRENT_CONTEXT(ctx);
-   ATTR1F(VBO_ATTRIB_INDEX, f);
+   ATTR1F(VBO_ATTRIB_COLOR_INDEX, f);
 }
 
 static void GLAPIENTRY
 TAG(Indexfv)(const GLfloat * f)
 {
    GET_CURRENT_CONTEXT(ctx);
-   ATTR1FV(VBO_ATTRIB_INDEX, f);
+   ATTR1FV(VBO_ATTRIB_COLOR_INDEX, f);
 }
 
 




More information about the mesa-commit mailing list