panfrost: Increment offsets[] per draw
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 8 Aug 2019 15:16:09 +0000 (08:16 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 13 Aug 2019 16:43:39 +0000 (09:43 -0700)
We have to maintain the internal offset ourselves. Per v3d.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h

index e023144b9c8d387357e85c113f170cd768fb92f5..8177f8917f3f890967adb68b85d080c3273debab 100644 (file)
@@ -1640,6 +1640,7 @@ panfrost_draw_vbo(
         /* Take into account a negative bias */
         ctx->vertex_count = info->count + abs(info->index_bias);
         ctx->instance_count = info->instance_count;
+        ctx->active_prim = info->mode;
 
         /* For non-indexed draws, they're the same */
         unsigned vertex_count = ctx->vertex_count;
@@ -1754,6 +1755,15 @@ panfrost_draw_vbo(
 
         /* Fire off the draw itself */
         panfrost_queue_draw(ctx);
+
+        /* Increment transform feedback offsets */
+
+        for (unsigned i = 0; i < ctx->streamout.num_targets; ++i) {
+                unsigned output_count = u_stream_outputs_for_vertices(
+                                ctx->active_prim, ctx->vertex_count);
+
+                ctx->streamout.offsets[i] += output_count;
+        }
 }
 
 /* CSO state */
index ba27ced90746701266bfa395201a8c3fce1733fa..e4dfe21bfd31442dea7d16d0bab45598d2d12ac0 100644 (file)
@@ -150,6 +150,7 @@ struct panfrost_context {
 
         unsigned vertex_count;
         unsigned instance_count;
+        enum pipe_prim_type active_prim;
 
         /* If instancing is enabled, vertex count padded for instance; if
          * it is disabled, just equal to plain vertex count */