summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-10-02 12:17:30 -0700
committerEric Anholt <[email protected]>2017-10-10 11:42:05 -0700
commitd8bc9c71dfcfa4e1e43e899f6b67da45f26efc79 (patch)
tree8bcee4166d8a59fad2c440241e3e4cceba4634de
parent28105560f778c4b7718349d3719cc96e15092f2b (diff)
broadcom/vc5: Mark our primitives as needing TF processing.
The TF enable state appears to stick around until the next TF enable packet is sent, so we only want to request TF when the shader is using it.
-rw-r--r--src/broadcom/cle/v3d_packet_v33.xml7
-rw-r--r--src/gallium/drivers/vc5/vc5_draw.c15
2 files changed, 18 insertions, 4 deletions
diff --git a/src/broadcom/cle/v3d_packet_v33.xml b/src/broadcom/cle/v3d_packet_v33.xml
index 06ca0365ef3..ba5ceb0d92e 100644
--- a/src/broadcom/cle/v3d_packet_v33.xml
+++ b/src/broadcom/cle/v3d_packet_v33.xml
@@ -60,6 +60,13 @@
<value name="TRIANGLES" value="4"/>
<value name="TRIANGLE_STRIP" value="5"/>
<value name="TRIANGLE_FAN" value="6"/>
+ <value name="POINTS_TF" value="16"/>
+ <value name="LINES_TF" value="17"/>
+ <value name="LINE_LOOP_TF" value="18"/>
+ <value name="LINE_STRIP_TF" value="19"/>
+ <value name="TRIANGLES_TF" value="20"/>
+ <value name="TRIANGLE_STRIP_TF" value="21"/>
+ <value name="TRIANGLE_FAN_TF" value="22"/>
</enum>
<packet code="0" name="Halt"/>
diff --git a/src/gallium/drivers/vc5/vc5_draw.c b/src/gallium/drivers/vc5/vc5_draw.c
index 953477817d8..8c6a753b271 100644
--- a/src/gallium/drivers/vc5/vc5_draw.c
+++ b/src/gallium/drivers/vc5/vc5_draw.c
@@ -409,6 +409,13 @@ vc5_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
}
}
+ /* The HW only processes transform feedback on primitives with the
+ * flag set.
+ */
+ uint32_t prim_tf_enable = 0;
+ if (vc5->prog.bind_vs->num_tf_outputs)
+ prim_tf_enable = (V3D_PRIM_POINTS_TF - V3D_PRIM_POINTS);
+
/* Note that the primitive type fields match with OpenGL/gallium
* definitions, up to but not including QUADS.
*/
@@ -433,7 +440,7 @@ vc5_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
prim.maximum_index = (1u << 31) - 1; /* XXX */
prim.address_of_indices_list =
cl_address(rsc->bo, offset);
- prim.mode = info->mode;
+ prim.mode = info->mode | prim_tf_enable;
prim.enable_primitive_restarts = info->primitive_restart;
prim.number_of_instances = info->instance_count;
@@ -446,7 +453,7 @@ vc5_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
prim.maximum_index = (1u << 31) - 1; /* XXX */
prim.address_of_indices_list =
cl_address(rsc->bo, offset);
- prim.mode = info->mode;
+ prim.mode = info->mode | prim_tf_enable;
prim.enable_primitive_restarts = info->primitive_restart;
}
}
@@ -458,14 +465,14 @@ vc5_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
} else {
if (info->instance_count > 1) {
cl_emit(&job->bcl, VERTEX_ARRAY_INSTANCED_PRIMITIVES, prim) {
- prim.mode = info->mode;
+ prim.mode = info->mode | prim_tf_enable;
prim.index_of_first_vertex = info->start;
prim.number_of_instances = info->instance_count;
prim.instance_length = info->count;
}
} else {
cl_emit(&job->bcl, VERTEX_ARRAY_PRIMITIVES, prim) {
- prim.mode = info->mode;
+ prim.mode = info->mode | prim_tf_enable;
prim.length = info->count;
prim.index_of_first_vertex = info->start;
}