radeonsi: add si_so_target_reference
authorMarek Olšák <marek.olsak@amd.com>
Sat, 7 Oct 2017 21:04:25 +0000 (23:04 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 9 Oct 2017 14:26:58 +0000 (16:26 +0200)
The src type is different on purpose.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state_streamout.c

index 42a83d4bd71daca8696535e544ac65dc69c91450..92c5c59d7e760545cd1c827063dd8414acb156fe 100644 (file)
 
 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;