diff options
author | Mathias Fröhlich <[email protected]> | 2018-11-17 07:13:11 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-11-21 06:27:19 +0100 |
commit | 1b743e29666fde9ddc38c447118ecdcc38989eb5 (patch) | |
tree | acb145985d7c1c49cd5179e26d6f4669693f1b77 /src/mesa/main/varray.h | |
parent | 3c46fa59888cf5c8ca36be849512b2ef0492760d (diff) |
mesa: Work with bitmasks when en/dis-abling VAO arrays.
For enabling or disabling VAO arrays it is now possible to
change a set of arrays with a single call without the need to
iterate the attributes.
Make use of this technique in the vao module.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.h')
-rw-r--r-- | src/mesa/main/varray.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index a2477a7c6fe..823e4f408b1 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -62,15 +62,33 @@ _mesa_update_array_format(struct gl_context *ctx, GLuint relativeOffset); extern void +_mesa_enable_vertex_array_attribs(struct gl_context *ctx, + struct gl_vertex_array_object *vao, + GLbitfield attrib_bits); + +static inline void _mesa_enable_vertex_array_attrib(struct gl_context *ctx, struct gl_vertex_array_object *vao, - gl_vert_attrib attrib); + gl_vert_attrib attrib) +{ + assert(attrib < VERT_ATTRIB_MAX); + _mesa_enable_vertex_array_attribs(ctx, vao, VERT_BIT(attrib)); +} extern void +_mesa_disable_vertex_array_attribs(struct gl_context *ctx, + struct gl_vertex_array_object *vao, + GLbitfield attrib_bits); + +static inline void _mesa_disable_vertex_array_attrib(struct gl_context *ctx, struct gl_vertex_array_object *vao, - gl_vert_attrib attrib); + gl_vert_attrib attrib) +{ + assert(attrib < VERT_ATTRIB_MAX); + _mesa_disable_vertex_array_attribs(ctx, vao, VERT_BIT(attrib)); +} extern void |