From b9e8c2443ba02f5bea32ebe9374dd13e754f256f 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: (cherry picked from commit a86d18a8c49842c9075247c21399a432849a5feb) --- .pick_status.json | 2 +- src/gallium/drivers/v3d/v3dx_draw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 8e1bd8791ab..28ed06b75cc 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -436,7 +436,7 @@ "description": "v3d: use primitive type to get stream output offset", "nominated": false, "nomination_type": null, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null }, 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);