diff options
author | Eric Anholt <[email protected]> | 2011-04-22 13:20:08 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-04-29 15:25:41 -0700 |
commit | 3628e123f13a480abfad8e8af9f875e3d8eeb5a6 (patch) | |
tree | b80f8db9585f29f04d142da924020d5808577a30 /src/mesa | |
parent | 32cc0c9d8de343f699e80e7e416ea0d7e3121a42 (diff) |
i965/gen6: Move the clip VP to state streaming.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_state_dump.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vtbl.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_viewport_state.c | 24 |
4 files changed, 22 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index d9b755ba19b..b6cd058d5c2 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -658,7 +658,11 @@ struct brw_context drm_intel_bo *prog_bo; drm_intel_bo *state_bo; - drm_intel_bo *vp_bo; + + /* As of gen6, this is the offset in the batch to the CLIP VP, + * instead of vp_bo. + */ + uint32_t vp_offset; } clip; diff --git a/src/mesa/drivers/dri/i965/brw_state_dump.c b/src/mesa/drivers/dri/i965/brw_state_dump.c index ec1e84a983f..03e03e30e79 100644 --- a/src/mesa/drivers/dri/i965/brw_state_dump.c +++ b/src/mesa/drivers/dri/i965/brw_state_dump.c @@ -233,23 +233,21 @@ static void dump_sf_viewport_state(struct brw_context *brw) static void dump_clip_viewport_state(struct brw_context *brw) { + struct intel_context *intel = &brw->intel; const char *name = "CLIP VP"; struct brw_clipper_viewport *vp; uint32_t vp_off; - if (brw->clip.vp_bo == NULL) - return; - - drm_intel_bo_map(brw->clip.vp_bo, GL_FALSE); + drm_intel_bo_map(intel->batch.bo, GL_FALSE); - vp = brw->clip.vp_bo->virtual; - vp_off = brw->clip.vp_bo->offset; + vp = intel->batch.bo->virtual + brw->clip.vp_offset; + vp_off = intel->batch.bo->offset + brw->clip.vp_offset; state_out(name, vp, vp_off, 0, "xmin = %f\n", vp->xmin); state_out(name, vp, vp_off, 1, "xmax = %f\n", vp->xmax); state_out(name, vp, vp_off, 2, "ymin = %f\n", vp->ymin); state_out(name, vp, vp_off, 3, "ymax = %f\n", vp->ymax); - drm_intel_bo_unmap(brw->clip.vp_bo); + drm_intel_bo_unmap(intel->batch.bo); } static void dump_cc_viewport_state(struct brw_context *brw) diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 4961b0449df..b4d5a99c173 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -83,7 +83,6 @@ static void brw_destroy_context( struct intel_context *intel ) dri_bo_release(&brw->gs.state_bo); dri_bo_release(&brw->clip.prog_bo); dri_bo_release(&brw->clip.state_bo); - dri_bo_release(&brw->clip.vp_bo); dri_bo_release(&brw->sf.prog_bo); dri_bo_release(&brw->sf.state_bo); dri_bo_release(&brw->sf.vp_bo); diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c index cd7d209e3ea..6512123201b 100644 --- a/src/mesa/drivers/dri/i965/gen6_viewport_state.c +++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c @@ -41,22 +41,22 @@ static void prepare_clip_vp(struct brw_context *brw) { - struct brw_clipper_viewport vp; + struct brw_clipper_viewport *vp; - vp.xmin = -1.0; - vp.xmax = 1.0; - vp.ymin = -1.0; - vp.ymax = 1.0; + vp = brw_state_batch(brw, sizeof(*vp), 32, &brw->clip.vp_offset); - drm_intel_bo_unreference(brw->clip.vp_bo); - brw->clip.vp_bo = brw_cache_data(&brw->cache, BRW_CLIP_VP, - &vp, sizeof(vp)); + vp->xmin = -1.0; + vp->xmax = 1.0; + vp->ymin = -1.0; + vp->ymax = 1.0; + + brw->state.dirty.cache |= CACHE_NEW_CLIP_VP; } const struct brw_tracked_state gen6_clip_vp = { .dirty = { - .mesa = _NEW_VIEWPORT, /* XXX: not really, but we need nonzero */ - .brw = 0, + .mesa = 0, + .brw = BRW_NEW_BATCH, .cache = 0, }, .prepare = prepare_clip_vp, @@ -107,7 +107,6 @@ const struct brw_tracked_state gen6_sf_vp = { static void prepare_viewport_state_pointers(struct brw_context *brw) { - brw_add_validated_bo(brw, brw->clip.vp_bo); brw_add_validated_bo(brw, brw->sf.vp_bo); brw_add_validated_bo(brw, brw->cc.vp_bo); } @@ -121,7 +120,8 @@ static void upload_viewport_state_pointers(struct brw_context *brw) GEN6_CC_VIEWPORT_MODIFY | GEN6_SF_VIEWPORT_MODIFY | GEN6_CLIP_VIEWPORT_MODIFY); - OUT_RELOC(brw->clip.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_RELOC(intel->batch.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, + brw->clip.vp_offset); OUT_RELOC(brw->sf.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); OUT_RELOC(brw->cc.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); ADVANCE_BATCH(); |