panfrost: Allocate XFB buffers per-instance

Somehow XFB gets so little use we never noticed. Fixes:

   KHR-GLES31.core.vertex_attrib_binding.basic-input-case9
   KHR-GLES31.core.vertex_attrib_binding.basic-input-case11
   KHR-GLES31.core.vertex_attrib_binding.basic-inputI-case2

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
This commit is contained in:
Alyssa Rosenzweig 2021-06-07 15:25:49 -04:00 committed by Marge Bot
parent 9985c5bb88
commit 7e25b20d3f

View file

@ -2291,10 +2291,11 @@ panfrost_emit_varying_descriptor(struct panfrost_batch *batch,
/* Suppress prefetch on Bifrost */
memset(varyings + (xfb_base * ctx->streamout.num_targets), 0, sizeof(*varyings));
/* Emit the stream out buffers */
/* Emit the stream out buffers. We need enough room for all the
* vertices we emit across all instances */
unsigned out_count = u_stream_outputs_for_vertices(ctx->active_prim,
ctx->vertex_count);
unsigned out_count = ctx->instance_count *
u_stream_outputs_for_vertices(ctx->active_prim, ctx->vertex_count);
for (unsigned i = 0; i < ctx->streamout.num_targets; ++i) {
panfrost_emit_streamout(batch, &varyings[xfb_base + i],