[Mesa-dev] [PATCH 2/2] mesa: Add _NEW_RASTERIZER_DISCARD as synonym for _NEW_TRANSFORM.

Paul Berry stereotype441 at gmail.com
Tue Dec 20 16:41:04 PST 2011


This makes it easier to keep track of which dirty bits correspond to
which pieces of context, since it makes _NEW_RASTERIZER_DISCARD
correspond with ctx->RasterDiscard.
---
 src/mesa/drivers/dri/i965/brw_gs.c          |    5 +++--
 src/mesa/main/enable.c                      |    2 +-
 src/mesa/main/mtypes.h                      |    6 ++++++
 src/mesa/state_tracker/st_atom_rasterizer.c |    4 ++--
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 2495ad5..886bf98 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -209,7 +209,7 @@ static void populate_key( struct brw_context *brw,
          }
       }
       /* On Gen6, GS is also used for rasterizer discard. */
-      /* _NEW_TRANSFORM_FEEDBACK */
+      /* _NEW_RASTERIZER_DISCARD */
       if (ctx->RasterDiscard) {
          key->need_gs_prog = true;
          key->rasterizer_discard = true;
@@ -258,7 +258,8 @@ const struct brw_tracked_state brw_gs_prog = {
    .dirty = {
       .mesa  = (_NEW_LIGHT |
                 _NEW_TRANSFORM |
-                _NEW_TRANSFORM_FEEDBACK),
+                _NEW_TRANSFORM_FEEDBACK |
+                _NEW_RASTERIZER_DISCARD),
       .brw   = BRW_NEW_PRIMITIVE,
       .cache = CACHE_NEW_VS_PROG
    },
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 749ae98..270b240 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -890,7 +890,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
       case GL_RASTERIZER_DISCARD:
 	 CHECK_EXTENSION(EXT_transform_feedback, cap);
          if (ctx->RasterDiscard != state) {
-            FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+            FLUSH_VERTICES(ctx, _NEW_RASTERIZER_DISCARD);
             ctx->RasterDiscard = state;
          }
          break;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index ff97ea9..3d3b006 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3073,6 +3073,12 @@ struct gl_matrix_stack
 #define _NEW_FRAG_CLAMP        (1 << 29)
 #define _NEW_TRANSFORM_FEEDBACK (1 << 30) /**< gl_context::TransformFeedback */
 #define _NEW_ALL ~0
+
+/**
+ * We use _NEW_TRANSFORM for GL_RASTERIZER_DISCARD.  This #define is for
+ * clarity.
+ */
+#define _NEW_RASTERIZER_DISCARD _NEW_TRANSFORM
 /*@}*/
 
 
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 7ebc872..2d6ad45 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -258,7 +258,7 @@ static void update_raster_state( struct st_context *st )
    raster->clamp_fragment_color = ctx->Color._ClampFragmentColor;
    raster->gl_rasterization_rules = 1;
 
-   /* _NEW_TRANSFORM */
+   /* _NEW_RASTERIZER_DISCARD */
    raster->rasterizer_discard = ctx->RasterDiscard;
 
    cso_set_rasterizer(st->cso_context, raster);
@@ -276,7 +276,7 @@ const struct st_tracked_state st_update_rasterizer = {
        _NEW_PROGRAM |
        _NEW_SCISSOR |
        _NEW_FRAG_CLAMP |
-       _NEW_TRANSFORM),      /* mesa state dependencies*/
+       _NEW_RASTERIZER_DISCARD),      /* mesa state dependencies*/
       ST_NEW_VERTEX_PROGRAM,  /* state tracker dependencies */
    },
    update_raster_state     /* update function */
-- 
1.7.6.4



More information about the mesa-dev mailing list