From bba644ce826e6d25fc5c6fe8f1add1b4d4d8bd70 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 21 Apr 2023 10:41:34 -0400 Subject: [PATCH] draw: fix viewmask iterating the frontend has to be flushed and setup again if only the viewmask has changed since the last draw Fixes: 03cbb7b104e ("draw: add view_mask rendering support") Reviewed-by: Dave Airlie Part-of: --- src/gallium/auxiliary/draw/draw_private.h | 1 + src/gallium/auxiliary/draw/draw_pt.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index f3bcff4..1780070 100644 --- a/src/gallium/auxiliary/draw/draw_private.h +++ b/src/gallium/auxiliary/draw/draw_private.h @@ -184,6 +184,7 @@ struct draw_context enum pipe_prim_type prim; unsigned opt; /**< bitmask of PT_x flags */ unsigned eltSize; /* saved eltSize for flushing */ + unsigned viewid; /* saved viewid for flushing */ ubyte vertices_per_patch; boolean rebind_parameters; diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index 676f526..3d5d5f0 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -103,9 +103,9 @@ draw_pt_arrays(struct draw_context *draw, */ draw_do_flush(draw, DRAW_FLUSH_STATE_CHANGE); frontend = NULL; - } else if (draw->pt.eltSize != draw->pt.user.eltSize) { - /* Flush draw state if eltSize changed. - * This could be improved so only the frontend is flushed since it + } else if (draw->pt.eltSize != draw->pt.user.eltSize || draw->pt.viewid != draw->pt.user.viewid) { + /* Flush draw state if eltSize or viewid changed. + * eltSize changes could be improved so only the frontend is flushed since it * converts all indices to ushorts and the fetch part of the middle * always prepares both linear and indexed. */ @@ -121,6 +121,7 @@ draw_pt_arrays(struct draw_context *draw, draw->pt.frontend = frontend; draw->pt.eltSize = draw->pt.user.eltSize; + draw->pt.viewid = draw->pt.user.viewid; draw->pt.prim = prim; draw->pt.opt = opt; } -- 2.7.4