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

Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Jul 20 09:04:21 2020 -0400

zink: move 8bit index handling out of u_primconvert path

putting this through util_translate_prim_restart_ib reduces our reliance on
u_primconvert, which ideally we don't want to be using

Reviewed-by: Erik Faye-Lund <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5912>

---

 src/gallium/drivers/zink/zink_draw.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_draw.c 
b/src/gallium/drivers/zink/zink_draw.c
index 32a1ea2f94d..d39a261e2e1 100644
--- a/src/gallium/drivers/zink/zink_draw.c
+++ b/src/gallium/drivers/zink/zink_draw.c
@@ -210,8 +210,7 @@ zink_draw_vbo(struct pipe_context *pctx,
    bool need_index_buffer_unref = false;
 
    if (dinfo->mode >= PIPE_PRIM_QUADS ||
-       dinfo->mode == PIPE_PRIM_LINE_LOOP ||
-       (dinfo->index_size == 1 && !screen->have_EXT_index_type_uint8)) {
+       dinfo->mode == PIPE_PRIM_LINE_LOOP) {
       if (!u_trim_pipe_prim(dinfo->mode, (unsigned *)&dinfo->count))
          return;
 
@@ -255,7 +254,8 @@ zink_draw_vbo(struct pipe_context *pctx,
    struct pipe_resource *index_buffer = NULL;
    if (dinfo->index_size > 0) {
        uint32_t restart_index = 
util_prim_restart_index_from_size(dinfo->index_size);
-       if ((dinfo->primitive_restart && (dinfo->restart_index != 
restart_index))) {
+       if ((dinfo->primitive_restart && (dinfo->restart_index != 
restart_index)) ||
+           (!screen->have_EXT_index_type_uint8 && dinfo->index_size == 8)) {
           util_translate_prim_restart_ib(pctx, dinfo, &index_buffer);
           need_index_buffer_unref = true;
        } else {

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

Reply via email to