summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-06-07 12:19:13 +1000
committerTimothy Arceri <[email protected]>2017-06-09 09:13:46 +1000
commitf77740f14b9057de09e61e1abf086f08a68c5a1b (patch)
tree5ceb8833e435180d8f6850b98879c0ca0b370f1d /src/mesa/main
parentf627ac6e355a5eeb9618a0e4fff0ec26bd3c63ba (diff)
mesa: stop passing state bitfield to UpdateState()
The code comment which seems to have been added in cab974cf6c2db (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 <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dd.h2
-rw-r--r--src/mesa/main/state.c7
2 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 3f3102546df..0b262d0b466 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -93,7 +93,7 @@ struct dd_function_table {
* This is in addition to any state change callbacks Mesa may already have
* made.
*/
- void (*UpdateState)( struct gl_context *ctx, GLbitfield new_state );
+ void (*UpdateState)(struct gl_context *ctx);
/**
* This is called whenever glFinish() is called.
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index d534f554bad..04dafa983c5 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -415,13 +415,10 @@ _mesa_update_state_locked( struct gl_context *ctx )
* The driver might plug in different span functions, for example.
* Also, this is where the driver can invalidate the state of any
* active modules (such as swrast_setup, swrast, tnl, etc).
- *
- * Set ctx->NewState to zero to avoid recursion if
- * Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)
*/
- new_state = ctx->NewState | new_prog_state;
+ ctx->NewState |= new_prog_state;
+ ctx->Driver.UpdateState(ctx);
ctx->NewState = 0;
- ctx->Driver.UpdateState(ctx, new_state);
ctx->Array.VAO->NewArrays = 0x0;
}