From fd6636ebc06d55b59851701c436b8b97f50fd7f4 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 22 Jan 2020 22:38:09 -0500 Subject: st/mesa: simplify determination whether a draw needs min/max index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Mathias Fröhlich Part-of: --- src/mesa/main/arrayobj.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/mesa/main/arrayobj.h') diff --git a/src/mesa/main/arrayobj.h b/src/mesa/main/arrayobj.h index 584e6d818cf..19ab65b3242 100644 --- a/src/mesa/main/arrayobj.h +++ b/src/mesa/main/arrayobj.h @@ -211,6 +211,20 @@ _mesa_draw_user_array_bits(const struct gl_context *ctx) } +/** + * Return which enabled vertex attributes have a non-zero instance divisor. + * + * Needs the a fully updated VAO ready for draw. + */ +static inline GLbitfield +_mesa_draw_nonzero_divisor_bits(const struct gl_context *ctx) +{ + const struct gl_vertex_array_object *const vao = ctx->Array._DrawVAO; + assert(vao->NewArrays == 0); + return ~vao->_EffEnabledNonZeroDivisor & ctx->Array._DrawVAOEnabledAttribs; +} + + /** * Return enabled current values attribute bits for draw. */ -- cgit v1.2.3