Module: Mesa
Branch: master
Commit: a264fee6245856340fab9024e1a428626e966335
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a264fee6245856340fab9024e1a428626e966335

Author: Marek Olšák <[email protected]>
Date:   Wed Feb 15 17:24:38 2017 +0100

radeonsi: fix UNSIGNED_BYTE index buffer fallback with non-zero start (v2)

start can only be non-zero with MultiDrawElements, which is unlikely
to occur with UNSIGNED_BYTE indices.

v2: Also fix the util_shorten_ubyte_elts_to_userptr call.
    Tested with the new piglit.

Cc: [email protected]
Reviewed-by: Nicolai Hähnle <[email protected]>

---

 src/gallium/drivers/radeonsi/si_state_draw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index 34a44cc..c463fef 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -1052,7 +1052,7 @@ void si_draw_vbo(struct pipe_context *ctx, const struct 
pipe_draw_info *info)
                        void *ptr;
 
                        si_get_draw_start_count(sctx, info, &start, &count);
-                       start_offset = start * ib.index_size;
+                       start_offset = start * 2;
                        size = count * 2;
 
                        u_upload_alloc(ctx->stream_uploader, start_offset,
@@ -1065,7 +1065,7 @@ void si_draw_vbo(struct pipe_context *ctx, const struct 
pipe_draw_info *info)
                        }
 
                        util_shorten_ubyte_elts_to_userptr(&sctx->b.b, &ib, 0,
-                                                          ib.offset + 
start_offset,
+                                                          ib.offset + start,
                                                           count, ptr);
 
                        pipe_resource_reference(&ib.buffer, NULL);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to