mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 08:20:12 +01:00
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 <emil.l.velikov@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
ad4a44ebfc
commit
f064bcdfbf
1 changed files with 5 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue