diff options
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_tri.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_tri.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index f8a5816573..306cb6e27d 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -205,8 +205,14 @@ static void setup_tri_coefficients( struct lp_setup_context *setup, switch (setup->fs.input[slot].interp) { case LP_INTERP_CONSTANT: - for (i = 0; i < NUM_CHANNELS; i++) - constant_coef(setup, tri, slot+1, v3[vert_attr][i], i); + if (setup->flatshade_first) { + for (i = 0; i < NUM_CHANNELS; i++) + constant_coef(setup, tri, slot+1, v1[vert_attr][i], i); + } + else { + for (i = 0; i < NUM_CHANNELS; i++) + constant_coef(setup, tri, slot+1, v3[vert_attr][i], i); + } break; case LP_INTERP_LINEAR: @@ -665,14 +671,14 @@ void lp_setup_choose_triangle( struct lp_setup_context *setup ) { switch (setup->cullmode) { - case PIPE_WINDING_NONE: + case PIPE_FACE_NONE: setup->triangle = triangle_both; break; - case PIPE_WINDING_CCW: - setup->triangle = triangle_cw; + case PIPE_FACE_BACK: + setup->triangle = setup->ccw_is_frontface ? triangle_ccw : triangle_cw; break; - case PIPE_WINDING_CW: - setup->triangle = triangle_ccw; + case PIPE_FACE_FRONT: + setup->triangle = setup->ccw_is_frontface ? triangle_cw : triangle_ccw; break; default: setup->triangle = triangle_nop; |