aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2018-12-11 18:45:43 +0100
committerMarge Bot <[email protected]>2020-03-10 14:28:37 +0000
commitcf929823bf8253388a863fa495844380060f68fb (patch)
treedc6adeaed990c4830de4126da9c2b4379a2e4354 /src/mesa/main
parent1641c872ed36ee92ce8136385936e19f8535bec3 (diff)
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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/308>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/arrayobj.h21
1 files changed, 21 insertions, 0 deletions
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
@@ -263,6 +263,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.
*/
static inline const struct gl_vertex_buffer_binding*
@@ -322,6 +333,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.
*/
static inline bool