summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5/vc5_program.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_program.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_program.c')
-rw-r--r--src/gallium/drivers/vc5/vc5_program.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc5/vc5_program.c b/src/gallium/drivers/vc5/vc5_program.c
index a7a089510b2..7bad80a1684 100644
--- a/src/gallium/drivers/vc5/vc5_program.c
+++ b/src/gallium/drivers/vc5/vc5_program.c
@@ -127,8 +127,19 @@ vc5_set_transform_feedback_outputs(struct vc5_uncompiled_shader *so,
assert(so->num_tf_specs != ARRAY_SIZE(so->tf_specs));
V3D33_TRANSFORM_FEEDBACK_OUTPUT_DATA_SPEC_pack(NULL,
- (void *)&so->tf_specs[so->num_tf_specs++],
+ (void *)&so->tf_specs[so->num_tf_specs],
&unpacked);
+
+ /* If point size is being written by the shader, then
+ * all the VPM start offsets are shifted up by one.
+ * We won't know that until the variant is compiled,
+ * though.
+ */
+ unpacked.first_shaded_vertex_value_to_output++;
+ V3D33_TRANSFORM_FEEDBACK_OUTPUT_DATA_SPEC_pack(NULL,
+ (void *)&so->tf_specs_psiz[so->num_tf_specs],
+ &unpacked);
+ so->num_tf_specs++;
vpm_start_offset += write_size;
vpm_size -= write_size;
}