diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/attrib.c | 3 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 1 | ||||
-rw-r--r-- | src/mesa/main/state.c | 2 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec.c | 4 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec.h | 1 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec_array.c | 59 |
6 files changed, 25 insertions, 45 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 7042312a8f5..9b90b05f7dd 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1448,9 +1448,6 @@ restore_array_attrib(struct gl_context *ctx, _mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, src->ArrayObj->ElementArrayBufferObj->Name); - /* Better safe than sorry?! */ - dest->RebindArrays = GL_TRUE; - /* FIXME: Should some bits in ctx->Array->NewState also be set * FIXME: here? It seems like it should be set to inclusive-or * FIXME: of the old ArrayObj->_Enabled and the new _Enabled. diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index bfa320a52d7..e1afdbc9090 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1632,7 +1632,6 @@ struct gl_array_attrib GLuint RestartIndex; GLbitfield64 NewState; /**< mask of VERT_BIT_* values */ - GLboolean RebindArrays; /**< whether the VBO module should rebind arrays */ /* GL_ARB_vertex_buffer_object */ struct gl_buffer_object *ArrayBufferObj; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 2e9f021619f..c953efc8127 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -582,8 +582,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) ctx->NewState = 0; ctx->Driver.UpdateState(ctx, new_state); ctx->Array.NewState = 0; - if (!ctx->Array.RebindArrays) - ctx->Array.RebindArrays = (new_state & (_NEW_ARRAY | _NEW_PROGRAM)) != 0; } diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c index 05c3ec1ae9d..fd5e0f8911b 100644 --- a/src/mesa/vbo/vbo_exec.c +++ b/src/mesa/vbo/vbo_exec.c @@ -85,6 +85,10 @@ void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state ) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; + if (new_state & (_NEW_PROGRAM|_NEW_ARRAY)) { + exec->array.recalculate_inputs = GL_TRUE; + } + if (new_state & (_NEW_PROGRAM|_NEW_EVAL)) exec->eval.recalculate_maps = 1; diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index f6ede99cd75..5cdf5ced912 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -141,6 +141,7 @@ struct vbo_exec_context * programs: */ const struct gl_client_array *inputs[VERT_ATTRIB_MAX]; + GLboolean recalculate_inputs; } array; /* Which flags to set in vbo_exec_BeginVertices() */ diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index b0a4261e764..d9003c243b1 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -529,12 +529,25 @@ recalculate_input_bindings(struct gl_context *ctx) void vbo_bind_arrays(struct gl_context *ctx) { - if (!ctx->Array.RebindArrays) { - return; - } + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_exec_context *exec = &vbo->exec; + + vbo_draw_method(exec, DRAW_ARRAYS); - recalculate_input_bindings(ctx); - ctx->Array.RebindArrays = GL_FALSE; + if (exec->array.recalculate_inputs) { + recalculate_input_bindings(ctx); + + /* Again... because we may have changed the bitmask of per-vertex varying + * attributes. If we regenerate the fixed-function vertex program now + * we may be able to prune down the number of vertex attributes which we + * need in the shader. + */ + if (ctx->NewState) { + _mesa_update_state(ctx); + } + + exec->array.recalculate_inputs = GL_FALSE; + } } @@ -554,16 +567,6 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, vbo_bind_arrays(ctx); - vbo_draw_method(exec, DRAW_ARRAYS); - - /* Again... because we may have changed the bitmask of per-vertex varying - * attributes. If we regenerate the fixed-function vertex program now - * we may be able to prune down the number of vertex attributes which we - * need in the shader. - */ - if (ctx->NewState) - _mesa_update_state(ctx); - /* init most fields to zero */ memset(prim, 0, sizeof(prim)); prim[0].begin = 1; @@ -771,13 +774,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, return; } - vbo_bind_arrays( ctx ); - - vbo_draw_method(exec, DRAW_ARRAYS); - - /* check for dirty state again */ - if (ctx->NewState) - _mesa_update_state( ctx ); + vbo_bind_arrays(ctx); ib.count = count; ib.type = type; @@ -1063,15 +1060,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, return; } - /* Decide if we can do this all as one set of primitives sharing the - * same index buffer, or if we have to reset the index pointer per - * primitive. - */ - vbo_bind_arrays( ctx ); - - /* check for dirty state again */ - if (ctx->NewState) - _mesa_update_state( ctx ); + vbo_bind_arrays(ctx); min_index_ptr = (uintptr_t)indices[0]; max_index_ptr = 0; @@ -1217,14 +1206,6 @@ vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode, vbo_bind_arrays(ctx); - /* Again... because we may have changed the bitmask of per-vertex varying - * attributes. If we regenerate the fixed-function vertex program now - * we may be able to prune down the number of vertex attributes which we - * need in the shader. - */ - if (ctx->NewState) - _mesa_update_state(ctx); - /* init most fields to zero */ memset(prim, 0, sizeof(prim)); prim[0].begin = 1; |