diff options
author | Marek Olšák <[email protected]> | 2010-03-21 04:39:33 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-03-21 05:42:49 +0100 |
commit | 53ca4f8401f2fc552636d69f7d0dcfd7621769e3 (patch) | |
tree | b5dad53d430d187c708cf46df3102143a291d18c /src/gallium/drivers/r300/r300_render.c | |
parent | 04de5f4b8bf68a4594ed7fef8348bcf068701ac8 (diff) |
r300g: fix misaligned generated offset for ubyte vertex indices
Diffstat (limited to 'src/gallium/drivers/r300/r300_render.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_render.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index ff93a16a107..afd871ae302 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -353,6 +353,7 @@ static void r300_emit_draw_elements(struct r300_context *r300, static void r300_shorten_ubyte_elts(struct r300_context* r300, struct pipe_buffer** elts, + unsigned start, unsigned count) { struct pipe_screen* screen = r300->context.screen; @@ -370,6 +371,8 @@ static void r300_shorten_ubyte_elts(struct r300_context* r300, in_map = pipe_buffer_map(screen, *elts, PIPE_BUFFER_USAGE_CPU_READ); out_map = pipe_buffer_map(screen, new_elts, PIPE_BUFFER_USAGE_CPU_WRITE); + in_map += start; + for (i = 0; i < count; i++) { *out_map = (unsigned short)*in_map; in_map++; @@ -407,8 +410,9 @@ void r300_draw_range_elements(struct pipe_context* pipe, } if (indexSize == 1) { - r300_shorten_ubyte_elts(r300, &indexBuffer, count); + r300_shorten_ubyte_elts(r300, &indexBuffer, start, count); indexSize = 2; + start = 0; } r300_update_derived_state(r300); |