diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-03-18 20:22:32 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-03-18 20:22:32 +0000 |
commit | d579e809112c8327b559aace1bbd2790ffab3e23 (patch) | |
tree | cf61f95bd7aff9685ace5ae5cf88e1e1dd1e005f | |
parent | bb46380da801c17a87efed3af496610266457f48 (diff) |
fixes for indirect state
-rw-r--r-- | src/mesa/drivers/dri/i915tex/i915_cache.c | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915tex/i915_state_static.c | 7 |
2 files changed, 9 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i915tex/i915_cache.c b/src/mesa/drivers/dri/i915tex/i915_cache.c index a9b04424db..4bd64ea0ca 100644 --- a/src/mesa/drivers/dri/i915tex/i915_cache.c +++ b/src/mesa/drivers/dri/i915tex/i915_cache.c @@ -54,8 +54,6 @@ struct i915_cache_item { struct i915_cache { GLuint id; - const char *name; - GLuint state_type; struct i915_cache_item **items; GLuint size, n_items; }; @@ -232,12 +230,15 @@ void i915_cache_emit(struct i915_cache_context *cctx, struct i915_cache *cache = &cctx->cache[packet->cache_id]; GLuint addr; + assert(packet->nr_dwords == packet->max_dwords); + addr = search_cache( cache, hash, packet->dword, size ); if (addr == 0) addr = upload_cache( cache, intel, hash, packet, size ); cctx->i915->current.offsets[packet->cache_id] = addr; cctx->i915->current.sizes[packet->cache_id] = packet->nr_dwords; + cctx->i915->intel.state.dirty.intel |= I915_NEW_CACHED_INDIRECT; #endif } @@ -272,15 +273,14 @@ static void clear_cache( struct i915_cache *cache ) static void init_cache( struct i915_cache_context *cctx, - const char *name, GLuint id, GLuint state_type ) { struct i915_cache *cache = &cctx->cache[id]; + assert(state_type == (LI0_STATE_STATIC_INDIRECT << id)); + cache->id = id; - cache->name = name; - cache->state_type = state_type; cache->size = 32; cache->n_items = 0; cache->items = ((struct i915_cache_item **) @@ -294,27 +294,22 @@ struct i915_cache_context *i915_create_caches( struct i915_context *i915 ) cctx->i915 = i915; init_cache( cctx, - "STATIC", I915_CACHE_STATIC, LI0_STATE_STATIC_INDIRECT ); init_cache( cctx, - "MAP", I915_CACHE_MAP, LI0_STATE_MAP ); init_cache( cctx, - "SAMPLER", I915_CACHE_SAMPLER, LI0_STATE_SAMPLER ); init_cache( cctx, - "PROGRAM", I915_CACHE_PROGRAM, LI0_STATE_PROGRAM ); init_cache( cctx, - "CONSTANTS", I915_CACHE_CONSTANTS, LI0_STATE_CONSTANTS ); diff --git a/src/mesa/drivers/dri/i915tex/i915_state_static.c b/src/mesa/drivers/dri/i915tex/i915_state_static.c index 32131b7296..aa3801b0b3 100644 --- a/src/mesa/drivers/dri/i915tex/i915_state_static.c +++ b/src/mesa/drivers/dri/i915tex/i915_state_static.c @@ -122,12 +122,14 @@ static void upload_static(struct intel_context *intel) struct intel_region *color_region = intel->state.draw_region; struct intel_region *depth_region = intel->state.depth_region; struct i915_cache_packet packet; + GLboolean scissor = (intel->state.Scissor->Enabled && + intel->state.DrawBuffer); GLuint i; GLuint dwords = ((color_region ? 3 : 0) + (depth_region ? 3 : 0) + 2 + /* DV */ - 4 + /* SCISSOR */ + (scissor ? 4 : 1) + Elements(invarient_state)); GLuint relocs = ((color_region ? 1 : 0) + @@ -204,8 +206,7 @@ static void upload_static(struct intel_context *intel) /* _NEW_SCISSOR, _NEW_BUFFERS */ - if (intel->state.Scissor->Enabled && - intel->state.DrawBuffer) { + if (scissor) { GLint x = intel->state.Scissor->X; GLint y = intel->state.Scissor->Y; |