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 <emma@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22607>
This commit is contained in:
Juan A. Suarez Romero
2023-04-20 16:56:22 +02:00
committed by Marge Bot
parent 0e88c04ed0
commit a86d18a8c4

View File

@@ -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);