Mesa (master): svga: fix draw elements with 8-bits indices
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Aug 21 18:21:27 UTC 2020
Module: Mesa
Branch: master
Commit: fd7e1ed86d856cc4bb12bf550ef43e1cb81d0c0c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd7e1ed86d856cc4bb12bf550ef43e1cb81d0c0c
Author: Charmaine Lee <charmainel at vmware.com>
Date: Thu Aug 20 15:45:47 2020 -0700
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 at nv_primitive_restart tests.
Fixes: 2122b902b8 "gallium/indices: don't expand prim-type for 8-bit indices"
Reviewed-by: Neha Bhende <bhenden at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6414>
---
src/gallium/drivers/svga/svga_draw_elements.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
More information about the mesa-commit
mailing list