diff options
author | Emil Velikov <[email protected]> | 2014-03-12 17:09:38 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-03-14 13:00:01 +0000 |
commit | f064bcdfbf489e0e54feade860ba6193a46efaad (patch) | |
tree | 8943ccc5b90efd07dd06d837235993ac7335377f /src/gallium/drivers/nouveau | |
parent | ad4a44ebfc9f72d34bf3523e455822896a788507 (diff) |
nvc0: minor cleanups in stream output handling
Constify the offsets parameter to silence gcc warning 'assignment
from incompatible pointer type' due to function prototype miss-match.
Use a boolean changed as a shorthand for target != current_target.
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c index 88dbaa1113e..05027a151b8 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c @@ -1031,7 +1031,7 @@ static void nvc0_set_transform_feedback_targets(struct pipe_context *pipe, unsigned num_targets, struct pipe_stream_output_target **targets, - unsigned *offsets) + const unsigned *offsets) { struct nvc0_context *nvc0 = nvc0_context(pipe); unsigned i; @@ -1040,12 +1040,13 @@ nvc0_set_transform_feedback_targets(struct pipe_context *pipe, assert(num_targets <= 4); for (i = 0; i < num_targets; ++i) { - boolean append = (offsets[i] == ((unsigned)-1)); - if (nvc0->tfbbuf[i] == targets[i] && append) + const boolean changed = nvc0->tfbbuf[i] != targets[i]; + const boolean append = (offsets[i] == ((unsigned)-1)); + if (!changed && append) continue; nvc0->tfbbuf_dirty |= 1 << i; - if (nvc0->tfbbuf[i] && nvc0->tfbbuf[i] != targets[i]) + if (nvc0->tfbbuf[i] && changed) nvc0_so_target_save_offset(pipe, nvc0->tfbbuf[i], i, &serialize); if (targets[i] && !append) |