From: Charmaine Lee Date: Thu, 20 Aug 2020 22:45:47 +0000 (-0700) Subject: svga: fix draw elements with 8-bits indices X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd7e1ed86d856cc4bb12bf550ef43e1cb81d0c0c;p=mesa.git svga: fix draw elements with 8-bits indices With commit 2122b902b80, u_index_translator can return U_TRANSLATE_MEMCPY for 8-bits indices, and in this case we need to call the translation function instead of a simple passthrough to the device. Fixes piglit spec@nv_primitive_restart tests. Fixes: 2122b902b8 "gallium/indices: don't expand prim-type for 8-bit indices" Reviewed-by: Neha Bhende Part-of: --- diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c index b17fe44f747..dd977b1bc2d 100644 --- a/src/gallium/drivers/svga/svga_draw_elements.c +++ b/src/gallium/drivers/svga/svga_draw_elements.c @@ -254,7 +254,7 @@ svga_hwtnl_draw_range_elements(struct svga_hwtnl *hwtnl, &gen_prim, &gen_size, &gen_nr, &gen_func); } - if (gen_type == U_TRANSLATE_MEMCPY) { + if ((gen_type == U_TRANSLATE_MEMCPY) && (info->index_size == gen_size)) { /* No need for translation, just pass through to hardware: */ unsigned start_offset = info->start * info->index_size;