broadcom/vc5: Switch to setting the primitive list format in the RCL.
authorEric Anholt <eric@anholt.net>
Thu, 21 Dec 2017 01:19:23 +0000 (17:19 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 3 Jan 2018 22:25:23 +0000 (14:25 -0800)
This means that we get a single copy of it emitted, instead of once at the
start of each tile (though it's still executed once per tile).  Fixes
assertion failures with the updated simulator.

src/gallium/drivers/vc5/vc5_draw.c
src/gallium/drivers/vc5/vc5_rcl.c

index 6ca6966f713c669e2f26f7151a6e0f804f9f4a24..e07fbd8e810fdc51f77a4e0cfaf0a80eadb940a9 100644 (file)
@@ -101,11 +101,6 @@ vc5_start_draw(struct vc5_context *vc5)
          */
         cl_emit(&job->bcl, START_TILE_BINNING, bin);
 
-        cl_emit(&job->bcl, PRIMITIVE_LIST_FORMAT, fmt) {
-                fmt.data_type = LIST_INDEXED;
-                fmt.primitive_type = LIST_TRIANGLES;
-        }
-
         job->needs_flush = true;
         job->draw_width = vc5->framebuffer.width;
         job->draw_height = vc5->framebuffer.height;
index afb764c0a80c9b703816fb04589a9b1ba543a0bc..600a8469668f3b3b08faf26a4eb9183d90efc9b5 100644 (file)
@@ -152,6 +152,14 @@ vc5_rcl_emit_generic_per_tile_list(struct vc5_job *job, int last_cbuf)
          */
         cl_emit(cl, TILE_COORDINATES_IMPLICIT, coords);
 
+        /* The binner starts out writing tiles assuming that the initial mode
+         * is triangles, so make sure that's the case.
+         */
+        cl_emit(cl, PRIMITIVE_LIST_FORMAT, fmt) {
+                fmt.data_type = LIST_INDEXED;
+                fmt.primitive_type = LIST_TRIANGLES;
+        }
+
         cl_emit(cl, BRANCH_TO_IMPLICIT_TILE_LIST, branch);
 
         bool needs_color_clear = job->cleared & pipe_clear_color_buffers;