From 576c8c592a4be7047a00b0c8fe3851b09f10d8d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 16 Apr 2012 04:21:03 +0200 Subject: [PATCH] mesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is a frequently-updated state and _NEW_ARRAY already causes revalidation of the vbo module. It's kinda counter-productive to recompute arrays in the vbo module if _NEW_ARRAY is set and then set _NEW_ARRAY again. Reviewed-by: Brian Paul Reviewed-by: Mathias Fröhlich --- src/mesa/main/ff_fragment_shader.cpp | 2 +- src/mesa/main/mtypes.h | 1 + src/mesa/main/state.c | 11 ++++++----- src/mesa/vbo/vbo_exec_array.c | 4 ++-- src/mesa/vbo/vbo_exec_draw.c | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp index 3c91b1a42ad..8a42281db0f 100644 --- a/src/mesa/main/ff_fragment_shader.cpp +++ b/src/mesa/main/ff_fragment_shader.cpp @@ -337,7 +337,7 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx ) } else if (!(vertexProgram || vertexShader)) { /* Fixed function vertex logic */ - /* _NEW_ARRAY */ + /* _NEW_VARYING_VP_INPUTS */ GLbitfield64 varying_inputs = ctx->varying_vp_inputs; /* These get generated in the setup routine regardless of the diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index e1afdbc9090..f277307a89d 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3062,6 +3062,7 @@ struct gl_matrix_stack #define _NEW_BUFFER_OBJECT (1 << 28) #define _NEW_FRAG_CLAMP (1 << 29) #define _NEW_TRANSFORM_FEEDBACK (1 << 30) /**< gl_context::TransformFeedback */ +#define _NEW_VARYING_VP_INPUTS (1 << 31) /**< gl_context::varying_vp_inputs */ #define _NEW_ALL ~0 /** diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index c953efc8127..627bf838c0f 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -473,12 +473,13 @@ _mesa_update_state_locked( struct gl_context *ctx ) /* Determine which state flags effect vertex/fragment program state */ if (ctx->FragmentProgram._MaintainTexEnvProgram) { prog_flags |= (_NEW_BUFFERS | _NEW_TEXTURE | _NEW_FOG | - _NEW_ARRAY | _NEW_LIGHT | _NEW_POINT | _NEW_RENDERMODE | - _NEW_PROGRAM | _NEW_FRAG_CLAMP | _NEW_COLOR); + _NEW_VARYING_VP_INPUTS | _NEW_LIGHT | _NEW_POINT | + _NEW_RENDERMODE | _NEW_PROGRAM | _NEW_FRAG_CLAMP | + _NEW_COLOR); } if (ctx->VertexProgram._MaintainTnlProgram) { - prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | - _NEW_TRANSFORM | _NEW_POINT | + prog_flags |= (_NEW_VARYING_VP_INPUTS | _NEW_TEXTURE | + _NEW_TEXTURE_MATRIX | _NEW_TRANSFORM | _NEW_POINT | _NEW_FOG | _NEW_LIGHT | _MESA_NEW_NEED_EYE_COORDS); } @@ -626,7 +627,7 @@ _mesa_set_varying_vp_inputs( struct gl_context *ctx, { if (ctx->varying_vp_inputs != varying_inputs) { ctx->varying_vp_inputs = varying_inputs; - ctx->NewState |= _NEW_ARRAY; + ctx->NewState |= _NEW_VARYING_VP_INPUTS; /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/ } } diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index d9003c243b1..2e324a2ca0c 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -523,8 +523,8 @@ recalculate_input_bindings(struct gl_context *ctx) * Examine the enabled vertex arrays to set the exec->array.inputs[] values. * These will point to the arrays to actually use for drawing. Some will * be user-provided arrays, other will be zero-stride const-valued arrays. - * Note that this might set the _NEW_ARRAY dirty flag so state validation - * must be done after this call. + * Note that this might set the _NEW_VARYING_VP_INPUTS dirty flag so state + * validation must be done after this call. */ void vbo_bind_arrays(struct gl_context *ctx) diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index dd5363bebe4..a1d329f944e 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -388,7 +388,7 @@ vbo_exec_vtx_flush(struct vbo_exec_context *exec, GLboolean keepUnmapped) if (exec->vtx.copied.nr != exec->vtx.vert_count) { struct gl_context *ctx = exec->ctx; - /* Before the update_state() as this may raise _NEW_ARRAY + /* Before the update_state() as this may raise _NEW_VARYING_VP_INPUTS * from _mesa_set_varying_vp_inputs(). */ vbo_exec_bind_arrays( ctx ); -- 2.30.2