summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5/vc5_emit.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-03-21 15:07:19 -0700
committerEric Anholt <[email protected]>2018-03-26 17:46:19 -0700
commit33878641305345b9bb76ad5ebf2335ec9c17adfa (patch)
treec423a617c529008c2ee0d7f720726d9d4176fcfc /src/gallium/drivers/vc5/vc5_emit.c
parent09ac5ade8f3855e42e4902d7e1acab540f3f1568 (diff)
broadcom/vc5: Fix transform feedback in the presence of point size.
I had this note to myself, and it turns out that a lot of CTS tests use XFB with points to get data out without using a fragment shader. Keep track of two sets of precomputed TF specs (point size in VPM prologue or not), and switch between them when we enable/disable point size.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_emit.c')
-rw-r--r--src/gallium/drivers/vc5/vc5_emit.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c
index 1db97081df3..061d6e7c9d9 100644
--- a/src/gallium/drivers/vc5/vc5_emit.c
+++ b/src/gallium/drivers/vc5/vc5_emit.c
@@ -572,10 +572,18 @@ v3dX(emit_state)(struct pipe_context *pctx)
/* Set up the transform feedback data specs (which VPM entries to
* output to which buffers).
*/
- if (vc5->dirty & VC5_DIRTY_STREAMOUT) {
+ if (vc5->dirty & (VC5_DIRTY_STREAMOUT |
+ VC5_DIRTY_RASTERIZER |
+ VC5_DIRTY_PRIM_MODE)) {
struct vc5_streamout_stateobj *so = &vc5->streamout;
if (so->num_targets) {
+ bool psiz_per_vertex = (vc5->prim_mode == PIPE_PRIM_POINTS &&
+ vc5->rasterizer->base.point_size_per_vertex);
+ uint16_t *tf_specs = (psiz_per_vertex ?
+ vc5->prog.bind_vs->tf_specs_psiz :
+ vc5->prog.bind_vs->tf_specs);
+
#if V3D_VERSION >= 40
cl_emit(&job->bcl, TRANSFORM_FEEDBACK_SPECS, tfe) {
tfe.number_of_16_bit_output_data_specs_following =
@@ -593,8 +601,7 @@ v3dX(emit_state)(struct pipe_context *pctx)
};
#endif /* V3D_VERSION < 40 */
for (int i = 0; i < vc5->prog.bind_vs->num_tf_specs; i++) {
- cl_emit_prepacked(&job->bcl,
- &vc5->prog.bind_vs->tf_specs[i]);
+ cl_emit_prepacked(&job->bcl, &tf_specs[i]);
}
}
}