From: Marek Olšák Date: Sat, 7 Oct 2017 21:04:25 +0000 (+0200) Subject: radeonsi: add si_so_target_reference X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a86c9328ce87fece002ea1f918829ec88d62b12c;p=mesa.git radeonsi: add si_so_target_reference The src type is different on purpose. Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeonsi/si_state_streamout.c b/src/gallium/drivers/radeonsi/si_state_streamout.c index 42a83d4bd71..92c5c59d7e7 100644 --- a/src/gallium/drivers/radeonsi/si_state_streamout.c +++ b/src/gallium/drivers/radeonsi/si_state_streamout.c @@ -32,6 +32,12 @@ static void si_set_streamout_enable(struct si_context *sctx, bool enable); +static inline void si_so_target_reference(struct si_streamout_target **dst, + struct pipe_stream_output_target *src) +{ + pipe_so_target_reference((struct pipe_stream_output_target**)dst, src); +} + static struct pipe_stream_output_target * si_create_so_target(struct pipe_context *ctx, struct pipe_resource *buffer, @@ -100,7 +106,7 @@ void si_common_set_streamout_targets(struct pipe_context *ctx, /* Set the new targets. */ for (i = 0; i < num_targets; i++) { - pipe_so_target_reference((struct pipe_stream_output_target**)&sctx->streamout.targets[i], targets[i]); + si_so_target_reference(&sctx->streamout.targets[i], targets[i]); if (!targets[i]) continue; @@ -110,7 +116,7 @@ void si_common_set_streamout_targets(struct pipe_context *ctx, append_bitmask |= 1 << i; } for (; i < sctx->streamout.num_targets; i++) { - pipe_so_target_reference((struct pipe_stream_output_target**)&sctx->streamout.targets[i], NULL); + si_so_target_reference(&sctx->streamout.targets[i], NULL); } sctx->streamout.enabled_mask = enabled_mask;