diff options
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 64 |
1 files changed, 25 insertions, 39 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index ac4e87abe0..11c10e2f2a 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -801,53 +801,37 @@ static void* r300_create_rs_state(struct pipe_context* pipe, R300_GA_LINE_CNTL_END_TYPE_COMP; /* Enable polygon mode */ - if (state->fill_cw != PIPE_POLYGON_MODE_FILL || - state->fill_ccw != PIPE_POLYGON_MODE_FILL) { + if (state->fill_front != PIPE_POLYGON_MODE_FILL || + state->fill_back != PIPE_POLYGON_MODE_FILL) { rs->polygon_mode = R300_GA_POLY_MODE_DUAL; } - /* Radeons don't think in "CW/CCW", they think in "front/back". */ - if (state->front_winding == PIPE_WINDING_CW) { - rs->cull_mode = R300_FRONT_FACE_CW; - - /* Polygon offset */ - if (state->offset_cw) { - rs->polygon_offset_enable |= R300_FRONT_ENABLE; - } - if (state->offset_ccw) { - rs->polygon_offset_enable |= R300_BACK_ENABLE; - } - - /* Polygon mode */ - if (rs->polygon_mode) { - rs->polygon_mode |= - r300_translate_polygon_mode_front(state->fill_cw); - rs->polygon_mode |= - r300_translate_polygon_mode_back(state->fill_ccw); - } - } else { + /* Front face */ + if (state->front_ccw) rs->cull_mode = R300_FRONT_FACE_CCW; + else + rs->cull_mode = R300_FRONT_FACE_CW; - /* Polygon offset */ - if (state->offset_ccw) { - rs->polygon_offset_enable |= R300_FRONT_ENABLE; - } - if (state->offset_cw) { - rs->polygon_offset_enable |= R300_BACK_ENABLE; - } + /* Polygon offset */ + if (util_get_offset(state, state->fill_front)) { + rs->polygon_offset_enable |= R300_FRONT_ENABLE; + } + if (util_get_offset(state, state->fill_back)) { + rs->polygon_offset_enable |= R300_BACK_ENABLE; + } - /* Polygon mode */ - if (rs->polygon_mode) { - rs->polygon_mode |= - r300_translate_polygon_mode_front(state->fill_ccw); - rs->polygon_mode |= - r300_translate_polygon_mode_back(state->fill_cw); - } + /* Polygon mode */ + if (rs->polygon_mode) { + rs->polygon_mode |= + r300_translate_polygon_mode_front(state->fill_front); + rs->polygon_mode |= + r300_translate_polygon_mode_back(state->fill_back); } - if (state->front_winding & state->cull_mode) { + + if (state->cull_face & PIPE_FACE_FRONT) { rs->cull_mode |= R300_CULL_FRONT; } - if (~(state->front_winding) & state->cull_mode) { + if (state->cull_face & PIPE_FACE_BACK) { rs->cull_mode |= R300_CULL_BACK; } @@ -914,7 +898,9 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) } if (rs) { - r300->polygon_offset_enabled = rs->rs.offset_cw || rs->rs.offset_ccw; + r300->polygon_offset_enabled = (rs->rs.offset_point || + rs->rs.offset_line || + rs->rs.offset_tri); r300->sprite_coord_enable = rs->rs.sprite_coord_enable; r300->two_sided_color = rs->rs.light_twoside; } else { |