draw: fix front/back error in unfilled pipeline stage
authorKeith Whitwell <keithw@vmware.com>
Fri, 14 May 2010 22:47:05 +0000 (23:47 +0100)
committerKeith Whitwell <keithw@vmware.com>
Fri, 14 May 2010 22:47:05 +0000 (23:47 +0100)
src/gallium/auxiliary/draw/draw_pipe_unfilled.c

index d1f05129b9318bb55eedb9975310a41477531f18..e333d26a9320a8775203490dff252a057f059849 100644 (file)
@@ -134,7 +134,8 @@ static void unfilled_tri( struct draw_stage *stage,
                          struct prim_header *header )
 {
    struct unfilled_stage *unfilled = unfilled_stage(stage);
-   unsigned mode = unfilled->mode[header->det >= 0.0];
+   unsigned cw = header->det >= 0.0;
+   unsigned mode = unfilled->mode[cw];
   
    if (0)
       print_header_flags(header->flags);
@@ -161,8 +162,8 @@ static void unfilled_first_tri( struct draw_stage *stage,
    struct unfilled_stage *unfilled = unfilled_stage(stage);
    const struct pipe_rasterizer_state *rast = stage->draw->rasterizer;
 
-   unfilled->mode[rast->front_ccw ? 0 : 1] = rast->fill_front;
-   unfilled->mode[rast->front_ccw ? 1 : 0] = rast->fill_back;
+   unfilled->mode[0] = rast->front_ccw ? rast->fill_front : rast->fill_back;
+   unfilled->mode[1] = rast->front_ccw ? rast->fill_back : rast->fill_front;
 
    stage->tri = unfilled_tri;
    stage->tri( stage, header );