Mesa (mesa_7_5_branch): mesa/dlist: don' t cache state which may not be replayed on CallList
Keith Whitwell
keithw at kemper.freedesktop.org
Thu Jul 2 12:31:54 UTC 2009
Module: Mesa
Branch: mesa_7_5_branch
Commit: d6c2347d79c50ac18eab96378d79d989f3ffd0b7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d6c2347d79c50ac18eab96378d79d989f3ffd0b7
Author: Keith Whitwell <keithw at vmware.com>
Date: Tue Jun 30 17:10:56 2009 +0100
mesa/dlist: don't cache state which may not be replayed on CallList
Statechanges which occur before the first End in a display list may
not be replayed when the list is called, in particular if it is called
from within a begin/end pair.
Recognize vulnerable statechanges and do not use them to fill in the
state cache.
---
src/mesa/main/dlist.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 3e8b5a9..2af0dd3 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -3203,7 +3203,11 @@ save_ShadeModel(GLenum mode)
return;
SAVE_FLUSH_VERTICES(ctx);
- ctx->ListState.Current.ShadeModel = mode;
+
+ /* Only save the value if we know the statechange will take effect:
+ */
+ if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END)
+ ctx->ListState.Current.ShadeModel = mode;
n = ALLOC_INSTRUCTION(ctx, OPCODE_SHADE_MODEL, 1);
if (n) {
More information about the mesa-commit
mailing list