summaryrefslogtreecommitdiff
path: root/src/mesa/main/mtypes.h
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-06-30 09:55:33 +0100
committerKeith Whitwell <keithw@vmware.com>2009-06-30 09:55:33 +0100
commit47173cf67f0ed55012b0820397f6d620d8ad4473 (patch)
tree802b6513d708298290d8e0655fcd30a69ecea863 /src/mesa/main/mtypes.h
parent9014f475ff6720b694ba28906ebfe7e77795b173 (diff)
mesa/dlist: shortcircuit some redundant statechanges at compile time
Currently, state-changes in mesa display lists are more or less a verbatim recording of the GL calls made during compilation. This change introduces a minor optimization to recognize and eliminate cases where the application emits redundant state changes, eg: glShadeModel( GL_FLAT ); glBegin( prim ) ... glEnd() glShadeModel( GL_FLAT ); glBegin( prim ) ... glEnd() The big win is when we can eliminate all the statechanges between two primitive blocks and combine them into a single VBO node. This commit implements state-change elimination for Material and ShadeModel only. This is enough to make a start on debugging, etc.
Diffstat (limited to 'src/mesa/main/mtypes.h')
-rw-r--r--src/mesa/main/mtypes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 84a082b253e..bdaa4977b72 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2806,6 +2806,13 @@ struct gl_dlist_state
GLubyte ActiveEdgeFlag;
GLboolean CurrentEdgeFlag;
+
+ struct {
+ /* State known to have been set by the currently-compiling display
+ * list. Used to eliminate some redundant state changes.
+ */
+ GLenum ShadeModel;
+ } Current;
};