summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200/r200_context.h
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2004-09-22 06:27:02 +0000
committerEric Anholt <anholt@FreeBSD.org>2004-09-22 06:27:02 +0000
commit0c8f8d3dc9d60ed34eeca7f3606651420a81753c (patch)
tree3876839944c4194d4eac39863e96b64c4cfd7683 /src/mesa/drivers/dri/r200/r200_context.h
parent029ee9c680cd097b82d3d301b3854d57993d4464 (diff)
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.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_context.h')
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.h9
1 files changed, 5 insertions, 4 deletions
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 */