radeonsi: silence Coverity warning
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sun, 10 Jul 2016 14:13:28 +0000 (16:13 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 13 Jul 2016 07:52:39 +0000 (09:52 +0200)
Coverity's analysis is too weak to understand that
r600_init_flushed_depth(_, _, NULL) only returns true when
flushed_depth_texture was assigned a non-NULL value.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_blit.c
src/gallium/drivers/radeonsi/si_state.c

index 84567f028851c3fdaf17513175ab025f0125d065..38a19d50b651efbe7d707146c3b07022b11a91ae 100644 (file)
@@ -342,6 +342,8 @@ si_flush_depth_texture(struct si_context *sctx,
                unsigned fully_copied_levels;
                unsigned levels = 0;
 
+               assert(tex->flushed_depth_texture);
+
                if (util_format_is_depth_and_stencil(dst->resource.b.b.format))
                        copy_planes = PIPE_MASK_Z | PIPE_MASK_S;
 
index bdd7ef4a0f82417bd7478d13e0a5e55d2ee8eef1..f801ca55829956d6daa46b97321b0334d69afc6e 100644 (file)
@@ -3001,6 +3001,8 @@ si_create_sampler_view_custom(struct pipe_context *ctx,
                        return NULL;
                }
 
+               assert(tmp->flushed_depth_texture);
+
                /* Override format for the case where the flushed texture
                 * contains only Z or only S.
                 */