From 0c8f8d3dc9d60ed34eeca7f3606651420a81753c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 22 Sep 2004 06:27:02 +0000 Subject: The previous code would emit a full set of state during the first EmitState on a new cmdbuf, to ensure that state wasn't lost across UNLOCK/LOCK pairs (in the case of context switching). This was rather inefficient. Instead, after flushing a cmdbuf, mark the state as needing to be saved on UNLOCK. Then, at the beginning of flushing a cmdbuf, if we actually have lost the context, go back and emit a new cmdbuf with the full set of state, before continuing with the cmdbuf flush. Also, remove the dirty/clean atom lists, since atoms are emitted in a fixed order these days, and go with a simpler single list. Provides a 14% improvement in ipers performance in my tests, along with other apps. --- src/mesa/drivers/dri/r200/r200_context.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/r200/r200_context.h') diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index f000e14330..25faec955c 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -191,6 +191,7 @@ struct r200_state_atom { GLuint idx; int *cmd; /* one or more cmd's */ int *lastcmd; /* one or more cmd's */ + int *savedcmd; /* one or more cmd's */ GLboolean dirty; GLboolean (*check)( GLcontext *, int ); /* is this state active? */ }; @@ -491,10 +492,8 @@ struct r200_state_atom { struct r200_hw_state { - /* All state should be on one of these lists: - */ - struct r200_state_atom dirty; /* dirty list head placeholder */ - struct r200_state_atom clean; /* clean list head placeholder */ + /* Head of the linked list of state atoms. */ + struct r200_state_atom atomlist; /* Hardware state, stored as cmdbuf commands: * -- Need to doublebuffer for @@ -530,6 +529,7 @@ struct r200_hw_state { struct r200_state_atom glt; int max_state_size; /* Number of bytes necessary for a full state emit. */ + GLboolean is_dirty, all_dirty; }; struct r200_state { @@ -876,6 +876,7 @@ struct r200_context { drm_clip_rect_t *pClipRects; unsigned int lastStamp; GLboolean lost_context; + GLboolean save_on_next_unlock; r200ScreenPtr r200Screen; /* Screen private DRI data */ drm_radeon_sarea_t *sarea; /* Private SAREA data */ -- cgit v1.2.3