gallium: Convert the state_tracker to use CoordsReplaceBits.
authorMathias Fröhlich <mathias.froehlich@web.de>
Sun, 22 May 2016 12:10:19 +0000 (14:10 +0200)
committerMathias Fröhlich <mathias.froehlich@web.de>
Thu, 16 Jun 2016 03:50:52 +0000 (05:50 +0200)
Switch over to use the CoordsReplaceBits bitmask.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
src/mesa/state_tracker/st_atom_rasterizer.c

index ab5fa8f2dba28fc2c4a0df4ff4f513646a8d6dee..37a35982caf78c3da8b7db2fdb10eb4af6372b8d 100644 (file)
@@ -64,7 +64,6 @@ static void update_raster_state( struct st_context *st )
    struct pipe_rasterizer_state *raster = &st->state.rasterizer;
    const struct gl_vertex_program *vertProg = ctx->VertexProgram._Current;
    const struct gl_fragment_program *fragProg = ctx->FragmentProgram._Current;
-   uint i;
 
    memset(raster, 0, sizeof(*raster));
 
@@ -181,11 +180,8 @@ static void update_raster_state( struct st_context *st )
        * that we need to replace GENERIC[k] attrib with an automatically
        * computed texture coord.
        */
-      for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
-         if (ctx->Point.CoordReplace[i]) {
-            raster->sprite_coord_enable |= 1 << i;
-         }
-      }
+      raster->sprite_coord_enable = ctx->Point.CoordReplaceBits &
+         ((1u << MAX_TEXTURE_COORD_UNITS) - 1);
       if (!st->needs_texcoord_semantic &&
           fragProg->Base.InputsRead & VARYING_BIT_PNTC) {
          raster->sprite_coord_enable |=