i965: fix scissor state on sandybridge
authorZhenyu Wang <zhenyuw@linux.intel.com>
Tue, 28 Sep 2010 07:35:22 +0000 (15:35 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Tue, 28 Sep 2010 07:58:21 +0000 (15:58 +0800)
Fix incorrect scissor rect struct and missed scissor state pointer
setting for sandybridge.

src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/brw_structs.h
src/mesa/drivers/dri/i965/gen6_scissor_state.c

index c5d296b1295111cec9611e7ff2e0c463bb0781e4..3beed16945b8ddc66e707bc884de70c1e71a6efd 100644 (file)
@@ -102,6 +102,7 @@ extern const struct brw_tracked_state gen6_depth_stencil_state;
 extern const struct brw_tracked_state gen6_gs_state;
 extern const struct brw_tracked_state gen6_sampler_state;
 extern const struct brw_tracked_state gen6_scissor_state;
+extern const struct brw_tracked_state gen6_scissor_state_pointers;
 extern const struct brw_tracked_state gen6_sf_state;
 extern const struct brw_tracked_state gen6_sf_vp;
 extern const struct brw_tracked_state gen6_urb;
index e4f36a7ec3854bb53f02c858d909e1e44c647d82..1aadd5ca61d8c154ce2a0c3a425176e547ca4ac4 100644 (file)
@@ -145,6 +145,7 @@ const struct brw_tracked_state *gen6_atoms[] =
    &gen6_wm_state,
 
    &gen6_scissor_state,
+   &gen6_scissor_state_pointers,
 
    &brw_state_base_address,
 
index 8e8f418eb780963c5a2d15f35725c231f359689c..7b919872c40baefd02a930f920492b6d3c9ee94f 100644 (file)
@@ -909,10 +909,12 @@ struct brw_sf_unit_state
 
 };
 
-struct gen6_scissor_state
+struct gen6_scissor_rect
 {
-   GLuint ymin, xmin;
-   GLuint ymax, xmax;
+   GLuint xmin:16;
+   GLuint ymin:16;
+   GLuint xmax:16;
+   GLuint ymax:16;
 };
 
 struct brw_gs_unit_state
index 34a9dc234c26d86bf00c0f091465812a966ae41b..3d483c710ce541c1432cea44fe8384547aead29f 100644 (file)
@@ -35,7 +35,7 @@ prepare_scissor_state(struct brw_context *brw)
 {
    GLcontext *ctx = &brw->intel.ctx;
    const GLboolean render_to_fbo = (ctx->DrawBuffer->Name != 0);
-   struct gen6_scissor_state scissor;
+   struct gen6_scissor_rect scissor;
 
    /* _NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT */
 
@@ -84,7 +84,6 @@ static void upload_scissor_state_pointers(struct brw_context *brw)
    OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
    ADVANCE_BATCH();
 
-   intel_batchbuffer_emit_mi_flush(intel->batch);
 }