[Mesa-dev] [PATCH 07/11] vbo: use inputs_read var to simplify code
Ian Romanick
idr at freedesktop.org
Wed Jan 17 17:11:15 UTC 2018
On 01/16/2018 09:17 PM, Brian Paul wrote:
> ---
> src/mesa/vbo/vbo_exec_draw.c | 7 +++----
> src/mesa/vbo/vbo_save_draw.c | 7 +++----
> 2 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
> index 5d1e588..68e9918 100644
> --- a/src/mesa/vbo/vbo_exec_draw.c
> +++ b/src/mesa/vbo/vbo_exec_draw.c
> @@ -208,10 +208,9 @@ vbo_exec_bind_arrays( struct gl_context *ctx )
> * glVertexAttrib(0, val) calls to feed into the GENERIC0 input.
> * The original state gets essentially restored below.
> */
> - if ((ctx->VertexProgram._Current->info.inputs_read &
> - VERT_BIT_POS) == 0 &&
> - (ctx->VertexProgram._Current->info.inputs_read &
> - VERT_BIT_GENERIC0)) {
> + GLbitfield64 inputs_read = ctx->VertexProgram._Current->info.inputs_read;
const
> + if ((inputs_read & VERT_BIT_POS) == 0 &&
> + (inputs_read & VERT_BIT_GENERIC0)) {
> swap_pos = true;
> exec->vtx.inputs[VERT_ATTRIB_GENERIC0] = exec->vtx.inputs[0];
> exec->vtx.attrsz[VERT_ATTRIB_GENERIC0] = exec->vtx.attrsz[0];
> diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
> index 5d299d8..31ce756 100644
> --- a/src/mesa/vbo/vbo_save_draw.c
> +++ b/src/mesa/vbo/vbo_save_draw.c
> @@ -183,10 +183,9 @@ bind_vertex_list(struct gl_context *ctx,
> * In that case we effectively need to route the data from
> * glVertexAttrib(0, val) calls to feed into the GENERIC0 input.
> */
> - if ((ctx->VertexProgram._Current->info.inputs_read &
> - VERT_BIT_POS) == 0 &&
> - (ctx->VertexProgram._Current->info.inputs_read &
> - VERT_BIT_GENERIC0)) {
> + GLbitfield64 inputs_read = ctx->VertexProgram._Current->info.inputs_read;
Here too.
> + if ((inputs_read & VERT_BIT_POS) == 0 &&
> + (inputs_read & VERT_BIT_GENERIC0)) {
> save->inputs[VERT_ATTRIB_GENERIC0] = save->inputs[0];
> node_attrsz[VERT_ATTRIB_GENERIC0] = node_attrsz[0];
> node_attrtype[VERT_ATTRIB_GENERIC0] = node_attrtype[0];
>
More information about the mesa-dev
mailing list