mesa: stop passing state bitfield to UpdateState()
The code comment which seems to have been added in cab974cf6c
(from year 2000) says:
"Set ctx->NewState to zero to avoid recursion if
Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)"
As far as I can tell nothing in any of the UpdateState() calls
should cause it to be called recursively.
V2: add a wrapper around the osmesa update function so it can still
be used internally.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -117,7 +117,7 @@ get_string( struct gl_context *ctx, GLenum name )
|
||||
|
||||
|
||||
static void
|
||||
osmesa_update_state( struct gl_context *ctx, GLuint new_state )
|
||||
osmesa_update_state(struct gl_context *ctx, GLuint new_state)
|
||||
{
|
||||
/* easy - just propogate */
|
||||
_swrast_InvalidateState( ctx, new_state );
|
||||
@@ -126,6 +126,11 @@ osmesa_update_state( struct gl_context *ctx, GLuint new_state )
|
||||
_vbo_InvalidateState( ctx, new_state );
|
||||
}
|
||||
|
||||
static void
|
||||
osmesa_update_state_wrapper(struct gl_context *ctx)
|
||||
{
|
||||
osmesa_update_state(ctx, ctx->NewState);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -828,7 +833,7 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
|
||||
_mesa_init_driver_functions(&functions);
|
||||
/* override with our functions */
|
||||
functions.GetString = get_string;
|
||||
functions.UpdateState = osmesa_update_state;
|
||||
functions.UpdateState = osmesa_update_state_wrapper;
|
||||
|
||||
if (!_mesa_initialize_context(&osmesa->mesa,
|
||||
api_profile,
|
||||
|
Reference in New Issue
Block a user