i965: Clean up some mess with the batch cache.

Its flagging of extra state that's already flagged by the vtbl new_batch
when appropriate was confusing my tracking down of the OA clear bug.
This commit is contained in:
Eric Anholt 2009-09-24 14:53:49 -07:00
parent 940ca2e837
commit 54107a0979
3 changed files with 5 additions and 18 deletions

View file

@ -86,9 +86,6 @@ const struct brw_tracked_state brw_psp_urb_cbs;
const struct brw_tracked_state brw_pipe_control;
const struct brw_tracked_state brw_clear_surface_cache;
const struct brw_tracked_state brw_clear_batch_cache;
const struct brw_tracked_state brw_drawing_rect;
const struct brw_tracked_state brw_indices;
const struct brw_tracked_state brw_vertices;
@ -165,7 +162,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw,
const void *data,
GLuint sz );
void brw_destroy_batch_cache( struct brw_context *brw );
void brw_clear_batch_cache_flush( struct brw_context *brw );
void brw_clear_batch_cache( struct brw_context *brw );
/* brw_wm_surface_state.c */
dri_bo *

View file

@ -79,7 +79,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw,
return GL_TRUE;
}
static void clear_batch_cache( struct brw_context *brw )
void brw_clear_batch_cache( struct brw_context *brw )
{
struct brw_cached_batch_item *item = brw->cached_batch_items;
@ -93,18 +93,7 @@ static void clear_batch_cache( struct brw_context *brw )
brw->cached_batch_items = NULL;
}
void brw_clear_batch_cache_flush( struct brw_context *brw )
{
clear_batch_cache(brw);
brw->state.dirty.mesa |= ~0;
brw->state.dirty.brw |= ~0;
brw->state.dirty.cache |= ~0;
}
void brw_destroy_batch_cache( struct brw_context *brw )
{
clear_batch_cache(brw);
brw_clear_batch_cache(brw);
}

View file

@ -287,6 +287,7 @@ void brw_validate_state( struct brw_context *brw )
if (brw->emit_state_always) {
state->mesa |= ~0;
state->brw |= ~0;
state->cache |= ~0;
}
if (brw->fragment_program != ctx->FragmentProgram._Current) {
@ -305,7 +306,7 @@ void brw_validate_state( struct brw_context *brw )
return;
if (brw->state.dirty.brw & BRW_NEW_CONTEXT)
brw_clear_batch_cache_flush(brw);
brw_clear_batch_cache(brw);
brw->intel.Fallback = 0;