[Mesa-dev] [PATCH 08/10] mesa: Provide gl_vertex_format accessors.

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Wed Dec 12 06:44:42 UTC 2018


From: Mathias Fröhlich <mathias.froehlich at web.de>

Provide the same set of VAO and current value gl_vertex_format
accessor functions like we have for the gl_array_attributes.
For most purpose the vertex format is what we need.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
 src/mesa/main/arrayobj.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/mesa/main/arrayobj.h b/src/mesa/main/arrayobj.h
index 55d233befb..70da371561 100644
--- a/src/mesa/main/arrayobj.h
+++ b/src/mesa/main/arrayobj.h
@@ -229,6 +229,17 @@ _mesa_draw_array_attrib(const struct gl_vertex_array_object *vao,
 }
 
 
+/**
+ * Return a vertex array vertex format provided the attribute number.
+ */
+static inline const struct gl_vertex_format*
+_mesa_draw_array_format(const struct gl_vertex_array_object *vao,
+                        gl_vert_attrib attr)
+{
+   return &_mesa_draw_array_attrib(vao, attr)->Format;
+}
+
+
 /**
  * Return vertex buffer binding provided an attribute number.
  */
@@ -288,6 +299,16 @@ _mesa_draw_current_attrib(const struct gl_context *ctx, gl_vert_attrib attr)
 }
 
 
+/**
+ * Return a current value vertex format provided the attribute number.
+ */
+static inline const struct gl_vertex_format*
+_mesa_draw_current_format(const struct gl_context *ctx, gl_vert_attrib attr)
+{
+   return &_vbo_current_attrib(ctx, attr)->Format;
+}
+
+
 /**
  * Return true if we have the VERT_ATTRIB_EDGEFLAG array enabled.
  */
-- 
2.19.2



More information about the mesa-dev mailing list