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

Author: Mathias Fröhlich <mathias.froehl...@web.de>
Date:   Tue Dec 11 18:45:43 2018 +0100

mesa: Provide gl_vertex_format accessors.

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.

v2: Style fixes.

Reviewed-by: Matt Turner <matts...@gmail.com>
Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
Signed-off-by: Mathias Fröhlich <mathias.froehl...@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>

---

 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 c7423f106ff..94e22348248 100644
--- a/src/mesa/main/arrayobj.h
+++ b/src/mesa/main/arrayobj.h
@@ -262,6 +262,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.
  */
@@ -321,6 +332,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.
  */

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to