From 5bb747abd9ca8551283f0eee311b9fb1b19fba0d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 30 Aug 2021 16:22:08 -0400 Subject: [PATCH] util/primconvert: force restart rewrites if original primtype wasn't supported if we're doing a primtype change, the restart needs to be eliminated to avoid losing restart data after the rewrite Fixes: 583070748cb ("util/primconvert: handle rewriting of prim-restart draws with unsupported primtype") Acked-by: Rob Clark Part-of: --- src/gallium/auxiliary/indices/u_primconvert.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/indices/u_primconvert.c b/src/gallium/auxiliary/indices/u_primconvert.c index d8704237e49..62956910aa8 100644 --- a/src/gallium/auxiliary/indices/u_primconvert.c +++ b/src/gallium/auxiliary/indices/u_primconvert.c @@ -179,10 +179,12 @@ util_primconvert_draw_vbo(struct primconvert_context *pc, src = (const uint8_t *)src; /* if the resulting primitive type is not supported by the driver for primitive restart, + * or if the original primitive type was not supported by the driver, * the draw needs to be rewritten to not use primitive restart */ if (info->primitive_restart && - !(pc->cfg.restart_primtypes_mask & BITFIELD_BIT(mode))) { + (!(pc->cfg.restart_primtypes_mask & BITFIELD_BIT(mode)) || + !(pc->cfg.primtypes_mask & BITFIELD_BIT(info->mode)))) { /* step 1: rewrite draw to not use primitive primitive restart; * this pre-filters degenerate primitives */