i915g: disable scissor in fast clear
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 25 Sep 2011 16:02:34 +0000 (18:02 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 7 Oct 2011 12:31:17 +0000 (14:31 +0200)
Docs say this is obeyed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
src/gallium/drivers/i915/i915_clear.c

index aa453bce58054a1b7fc76bef51b6d0b7f4e689bd..a0aba0201f5418fb17902d5048e9c481155cef1e 100644 (file)
@@ -102,15 +102,17 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers,
    if (i915->hardware_dirty)
       i915_emit_hardware_state(i915);
 
-   if (!BEGIN_BATCH(7 + 7)) {
+   if (!BEGIN_BATCH(1 + 7 + 7)) {
       FLUSH_BATCH(NULL);
 
       i915_emit_hardware_state(i915);
       i915->vbo_flushed = 1;
 
-      assert(BEGIN_BATCH(7 + 7));
+      assert(BEGIN_BATCH(1 + 7 + 7));
    }
 
+   OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT);
+
    OUT_BATCH(_3DSTATE_CLEAR_PARAMETERS);
    OUT_BATCH(clear_params | CLEARPARAM_CLEAR_RECT);
    /* Used for zone init prim */
@@ -130,8 +132,8 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers,
    OUT_BATCH_F(desty);
 
    /* Flush after clear, its expected to be a costly operation.
-    * This is not required, just a heuristic
-    */
+    * This is not required, just a heuristic, but without the flush we'd need to
+    * clobber the SCISSOR_ENABLE dynamic state. */
    FLUSH_BATCH(NULL);
 
    i915->last_fired_vertices = i915->fired_vertices;