From: Nicolai Hähnle Date: Sun, 10 Jul 2016 14:13:28 +0000 (+0200) Subject: radeonsi: silence Coverity warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=65d48fcf8c0821365e0e81347894326847039328;p=mesa.git radeonsi: silence Coverity warning 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 --- diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 84567f02885..38a19d50b65 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index bdd7ef4a0f8..f801ca55829 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -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. */