draw: fix viewmask iterating

the frontend has to be flushed and setup again if only
the viewmask has changed since the last draw

Fixes: 03cbb7b104 ("draw: add view_mask rendering support")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22628>
This commit is contained in:
Mike Blumenkrantz 2023-04-21 10:41:34 -04:00 committed by Marge Bot
parent a18a51a708
commit bba644ce82
2 changed files with 5 additions and 3 deletions

View file

@ -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;

View file

@ -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;
}