summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-03-23 15:40:36 -0700
committerEric Anholt <[email protected]>2018-03-26 17:46:18 -0700
commit09ac5ade8f3855e42e4902d7e1acab540f3f1568 (patch)
tree1a6f812251b787a8dc86aae9deaea348094a190b /src/gallium/drivers/vc5
parent9e62aec9cd4853016b4d03a56b5756111a312d65 (diff)
broadcom/vc5: Split transform feedback specs update from buffers.
The specs update will be changing based on additional state flags in the next commit, and this unindents the buffer update code.
Diffstat (limited to 'src/gallium/drivers/vc5')
-rw-r--r--src/gallium/drivers/vc5/vc5_emit.c59
1 files changed, 32 insertions, 27 deletions
diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c
index e5a9e0e03a2..1db97081df3 100644
--- a/src/gallium/drivers/vc5/vc5_emit.c
+++ b/src/gallium/drivers/vc5/vc5_emit.c
@@ -569,6 +569,9 @@ 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) {
struct vc5_streamout_stateobj *so = &vc5->streamout;
@@ -593,42 +596,44 @@ v3dX(emit_state)(struct pipe_context *pctx)
cl_emit_prepacked(&job->bcl,
&vc5->prog.bind_vs->tf_specs[i]);
}
+ }
+ }
- for (int i = 0; i < so->num_targets; i++) {
- const struct pipe_stream_output_target *target =
- so->targets[i];
- struct vc5_resource *rsc = target ?
- vc5_resource(target->buffer) : NULL;
+ /* Set up the trasnform feedback buffers. */
+ if (vc5->dirty & VC5_DIRTY_STREAMOUT) {
+ struct vc5_streamout_stateobj *so = &vc5->streamout;
+ for (int i = 0; i < so->num_targets; i++) {
+ const struct pipe_stream_output_target *target =
+ so->targets[i];
+ struct vc5_resource *rsc = target ?
+ vc5_resource(target->buffer) : NULL;
#if V3D_VERSION >= 40
- if (!target)
- continue;
+ if (!target)
+ continue;
- cl_emit(&job->bcl, TRANSFORM_FEEDBACK_BUFFER, output) {
- output.buffer_address =
+ cl_emit(&job->bcl, TRANSFORM_FEEDBACK_BUFFER, output) {
+ output.buffer_address =
+ cl_address(rsc->bo,
+ target->buffer_offset);
+ output.buffer_size_in_32_bit_words =
+ target->buffer_size >> 2;
+ output.buffer_number = i;
+ }
+#else /* V3D_VERSION < 40 */
+ cl_emit(&job->bcl, TRANSFORM_FEEDBACK_OUTPUT_ADDRESS, output) {
+ if (target) {
+ output.address =
cl_address(rsc->bo,
target->buffer_offset);
- output.buffer_size_in_32_bit_words =
- target->buffer_size >> 2;
- output.buffer_number = i;
}
-#else /* V3D_VERSION < 40 */
- cl_emit(&job->bcl, TRANSFORM_FEEDBACK_OUTPUT_ADDRESS, output) {
- if (target) {
- output.address =
- cl_address(rsc->bo,
- target->buffer_offset);
- }
- };
+ };
#endif /* V3D_VERSION < 40 */
- if (target) {
- vc5_job_add_write_resource(vc5->job,
- target->buffer);
- }
- /* XXX: buffer_size? */
+ if (target) {
+ vc5_job_add_write_resource(vc5->job,
+ target->buffer);
}
- } else {
- /* XXX? */
+ /* XXX: buffer_size? */
}
}