panfrost: Fix dirty state emission

If we have per-draw state (vertex ID stuff), there's an ordering
mismatch. Fixes
dEQP-GLES31.functional.draw_base_vertex.draw_elements_instanced_base_vertex.builtin_variable.vertex_id
on Midgard, and I'm not sure why it was passing on Bifrost before. Also
should fix (on both architectures) DRAWID issues.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
This commit is contained in:
Alyssa Rosenzweig 2021-06-04 19:06:36 -04:00 committed by Marge Bot
parent 43cff98dff
commit bc48df001c

View file

@ -567,6 +567,11 @@ panfrost_direct_draw(struct panfrost_batch *batch,
mali_ptr attribs, attrib_bufs;
attribs = panfrost_emit_vertex_data(batch, &attrib_bufs);
panfrost_update_state_3d(batch);
panfrost_update_state_vs(batch);
panfrost_update_state_fs(batch);
panfrost_clean_state_3d(ctx);
/* Fire off the draw itself */
panfrost_draw_emit_vertex(batch, info, &invocation,
vs_vary, varyings, attribs, attrib_bufs, vertex.cpu);
@ -641,6 +646,11 @@ panfrost_indirect_draw(struct panfrost_batch *batch,
ctx->base_vertex_sysval_ptr = 0;
ctx->base_instance_sysval_ptr = 0;
panfrost_update_state_3d(batch);
panfrost_update_state_vs(batch);
panfrost_update_state_fs(batch);
panfrost_clean_state_3d(ctx);
bool point_coord_replace = (info->mode == PIPE_PRIM_POINTS);
panfrost_emit_varying_descriptor(batch, 0,
@ -767,11 +777,6 @@ panfrost_draw_vbo(struct pipe_context *pipe,
/* Conservatively assume draw parameters always change */
ctx->dirty |= PAN_DIRTY_PARAMS | PAN_DIRTY_DRAWID;
panfrost_update_state_3d(batch);
panfrost_update_state_vs(batch);
panfrost_update_state_fs(batch);
panfrost_clean_state_3d(ctx);
if (indirect) {
assert(num_draws == 1);