From 7e25b20d3f6a98e4314a6a071e090212188fb398 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 7 Jun 2021 15:25:49 -0400 Subject: [PATCH] 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 Cc: mesa-stable Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index bb91b3e..dc62c73 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -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], -- 2.7.4