From a86d18a8c49842c9075247c21399a432849a5feb Mon Sep 17 00:00:00 2001 From: "Juan A. Suarez Romero" Date: Thu, 20 Apr 2023 16:56:22 +0200 Subject: [PATCH] v3d: use primitive type to get stream output offset So far we were only considering the number of vertices to draw to compute the offset in a stream output buffer. But this is not correct, as it depends on the primitive type too. For instance, with 4 vertices, if we use a triangle strip primitive, then 2 triangles are generated from those 4 vertices, so 6 vertices will be captured. This fixes spec@!opengl es 3.0@gles-3.0-transform-feedback-uniform-buffer-object. CC: 23.1 Reviewed-by: Emma Anholt Signed-off-by: Juan A. Suarez Romero Part-of: --- src/gallium/drivers/v3d/v3dx_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 64df2d8f9f0..9f573d799bd 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -1265,7 +1265,7 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, */ for (int i = 0; i < v3d->streamout.num_targets; i++) v3d_stream_output_target(v3d->streamout.targets[i])->offset += - draws[0].count; + u_stream_outputs_for_vertices(info->mode, draws[0].count); if (v3d->zsa && job->zsbuf && v3d->zsa->base.depth_enabled) { struct v3d_resource *rsc = v3d_resource(job->zsbuf->texture);