diff options
author | Corbin Simpson <[email protected]> | 2010-01-16 17:45:34 -0800 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2010-01-16 18:17:40 -0800 |
commit | eedebfa5793844728f1d41a6b0a899825eba176a (patch) | |
tree | b2e289a3d378131caef2a1e40a22923729f5c5c1 /src/gallium/drivers | |
parent | 164fd16cfbc09970676c2e6866e062a5c9b410db (diff) |
r300g: Respect fill modes in indices fallback.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r300/r300_render.c | 17 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 710d850163f..64083f2dd54 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -257,10 +257,23 @@ static struct pipe_buffer* r300_translate_elts(struct r300_context* r300, struct pipe_buffer* new_elts; void *in_map, *out_map; unsigned out_prim, out_index_size, out_nr; + struct pipe_rasterizer_state* rs; u_translate_func out_translate; - (void)u_index_translator(~0, *mode, *size, *count, PV_LAST, PV_LAST, - &out_prim, &out_index_size, &out_nr, &out_translate); + rs = &((struct r300_rs_state*)r300->rs_state.state)->rs; + + if (rs->fill_cw == rs->fill_ccw && + rs->fill_cw != PIPE_POLYGON_MODE_FILL) { + (void)u_unfilled_translator(*mode, *size, *count, rs->fill_cw, + &out_prim, &out_index_size, &out_nr, &out_translate); + } else { + (void)u_index_translator(~0, *mode, *size, *count, PV_LAST, PV_LAST, + &out_prim, &out_index_size, &out_nr, &out_translate); + } + + debug_printf("r300: old mode %d, new mode %d\n", *mode, out_prim); + debug_printf("r300: old count %d, new count %d\n", *count, out_nr); + debug_printf("r300: old size %d, new size %d\n", *size, out_index_size); new_elts = screen->buffer_create(screen, 32, PIPE_BUFFER_USAGE_INDEX | diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 60ad763cf48..609b910e12d 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -602,9 +602,6 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->line_control = pack_float_16_6x(state->line_width) | R300_GA_LINE_CNTL_END_TYPE_COMP; - /* XXX I think there is something wrong with the polygon mode, - * XXX re-test when r300g is in a better shape */ - /* Enable polygon mode */ if (state->fill_cw != PIPE_POLYGON_MODE_FILL || state->fill_ccw != PIPE_POLYGON_MODE_FILL) { |