st/mesa: fix polygon offset state translation logic
authorBrian Paul <brianp@vmware.com>
Thu, 21 Feb 2013 15:16:16 +0000 (08:16 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 22 Feb 2013 23:49:05 +0000 (16:49 -0700)
The old logic was kind of twisted, but seemed to work in practice.

Note: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_atom_rasterizer.c

index f20df9e..7fdfa72 100644 (file)
@@ -135,16 +135,12 @@ static void update_raster_state( struct st_context *st )
 
    /* _NEW_POLYGON 
     */
-   if (ctx->Polygon.OffsetUnits != 0.0 ||
-       ctx->Polygon.OffsetFactor != 0.0) {
-      raster->offset_point = ctx->Polygon.OffsetPoint;
-      raster->offset_line = ctx->Polygon.OffsetLine;
-      raster->offset_tri = ctx->Polygon.OffsetFill;
-   }
-
    if (ctx->Polygon.OffsetPoint ||
        ctx->Polygon.OffsetLine ||
        ctx->Polygon.OffsetFill) {
+      raster->offset_point = ctx->Polygon.OffsetPoint;
+      raster->offset_line = ctx->Polygon.OffsetLine;
+      raster->offset_tri = ctx->Polygon.OffsetFill;
       raster->offset_units = ctx->Polygon.OffsetUnits;
       raster->offset_scale = ctx->Polygon.OffsetFactor;
    }