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_ioctl.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/r200/r200_ioctl.h') diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h b/src/mesa/drivers/dri/r200/r200_ioctl.h index 1503df7075..57474d7a05 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.h +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h @@ -117,6 +117,9 @@ extern GLboolean r200IsGartMemory( r200ContextPtr rmesa, const GLvoid *pointer, extern GLuint r200GartOffsetFromVirtual( r200ContextPtr rmesa, const GLvoid *pointer ); +void r200SaveHwState( r200ContextPtr rmesa ); +void r200SetUpAtomList( r200ContextPtr rmesa ); + /* ================================================================ * Helper macros: */ @@ -135,7 +138,8 @@ do { \ #define R200_STATECHANGE( rmesa, ATOM ) \ do { \ R200_NEWPRIM( rmesa ); \ - move_to_head( &(rmesa->hw.dirty), &(rmesa->hw.ATOM)); \ + rmesa->hw.ATOM.dirty = GL_TRUE; \ + rmesa->hw.is_dirty = GL_TRUE; \ } while (0) #define R200_DB_STATE( ATOM ) \ @@ -149,7 +153,8 @@ static __inline int R200_DB_STATECHANGE( if (memcmp(atom->cmd, atom->lastcmd, atom->cmd_size*4)) { int *tmp; R200_NEWPRIM( rmesa ); - move_to_head( &(rmesa->hw.dirty), atom ); + atom->dirty = GL_TRUE; + rmesa->hw.is_dirty = GL_TRUE; tmp = atom->cmd; atom->cmd = atom->lastcmd; atom->lastcmd = tmp; -- cgit v1.2.3