mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 17:30:20 +01:00
mesa: fix save_ShadeModel() logic and add new comments
This removes the test for _mesa_inside_dlist_begin_end(). If ctx->Driver.CurrentSavePrimitive==PRIM_UNKNOWN (the initial value), _mesa_inside_dlist_begin_end() will, confusingly, return TRUE. So we didn't set the ctx->ListState.Current.ShadeModel value and it remained in its indeterminate state. This didn't effect correctness, but it defeated the intended optimization of dropping redundant glShadeModel() state changes in order to coalesce sequences of drawing commands. Verified with new piglit gl-1.0-dlist-shademodel test. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
16296cc843
commit
aa782f260d
1 changed files with 5 additions and 4 deletions
|
|
@ -3771,15 +3771,16 @@ save_ShadeModel(GLenum mode)
|
|||
CALL_ShadeModel(ctx->Exec, (mode));
|
||||
}
|
||||
|
||||
/* Don't compile this call if it's a no-op.
|
||||
* By avoiding this state change we have a better chance of
|
||||
* coalescing subsequent drawing commands into one batch.
|
||||
*/
|
||||
if (ctx->ListState.Current.ShadeModel == mode)
|
||||
return;
|
||||
|
||||
SAVE_FLUSH_VERTICES(ctx);
|
||||
|
||||
/* Only save the value if we know the statechange will take effect:
|
||||
*/
|
||||
if (!_mesa_inside_dlist_begin_end(ctx))
|
||||
ctx->ListState.Current.ShadeModel = mode;
|
||||
ctx->ListState.Current.ShadeModel = mode;
|
||||
|
||||
n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1);
|
||||
if (n) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue