mesa: Add _NEW_RASTERIZER_DISCARD as synonym for _NEW_TRANSFORM.
authorPaul Berry <stereotype441@gmail.com>
Wed, 21 Dec 2011 00:23:17 +0000 (16:23 -0800)
committerPaul Berry <stereotype441@gmail.com>
Wed, 21 Dec 2011 21:33:35 +0000 (13:33 -0800)
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.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/main/enable.c
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_atom_rasterizer.c

index 2495ad5fe0b4d2ad9b116ed3ff88524948da5c75..886bf98fb85a5e2a52d4a2fd3614f93e3b7d51f8 100644 (file)
@@ -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
    },
index 749ae98f5ecc1e217452a88a13c8baedb185a60a..270b24045baccada7ef53f115ec5086b636c721c 100644 (file)
@@ -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;
index ff97ea91af2fe83cdaabb8b24a32ad0935f58a4c..3d3b006d56b9d15068ac1c9978578d41215ac0a8 100644 (file)
@@ -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
 /*@}*/
 
 
index 7ebc8728166a0587862e2bd3eeccc932c486aa4e..2d6ad45bad9a9318b9820e96ea5e983a423f3506 100644 (file)
@@ -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 */