[Mesa-dev] [PATCH 5/7] i965/gen7: Add support for rasterization discard.

Eric Anholt eric at anholt.net
Thu Dec 22 16:54:48 PST 2011


Fixes the piglit discard-* tests.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/gen7_sol_state.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c
index fcda08d..650f625 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -37,6 +37,12 @@ static void
 upload_sol_state(struct brw_context *brw)
 {
    struct intel_context *intel = &brw->intel;
+   struct gl_context *ctx = &intel->ctx;
+   uint32_t dw1 = 0;
+
+   /* _NEW_RASTERIZER_DISCARD */
+   if (ctx->RasterDiscard)
+      dw1 |= SO_RENDERING_DISABLE;
 
    /* Disable the SOL stage */
    BEGIN_BATCH(3);
@@ -48,7 +54,7 @@ upload_sol_state(struct brw_context *brw)
 
 const struct brw_tracked_state gen7_sol_state = {
    .dirty = {
-      .mesa  = 0,
+      .mesa  = _NEW_RASTERIZER_DISCARD,
       .brw   = BRW_NEW_BATCH,
       .cache = 0,
    },
-- 
1.7.7.3



More information about the mesa-dev mailing list