radeonsi: fix an assertion failure in si_decompress_sampler_color_textures
authorMarek Olšák <marek.olsak@amd.com>
Thu, 3 Nov 2016 18:16:51 +0000 (19:16 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 4 Nov 2016 10:30:47 +0000 (11:30 +0100)
This fixes a crash in Deus Ex: Mankind Divided. Release builds were
unaffected, so it's not too serious.

Cc: 11.2 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_blit.c

index e086ed87fbeadc8892f5dd36f8eff9ac8f723068..075d76a27305eb620ebbee1fafe062a13867baba 100644 (file)
@@ -486,7 +486,9 @@ si_decompress_sampler_color_textures(struct si_context *sctx,
                assert(view);
 
                tex = (struct r600_texture *)view->texture;
-               assert(tex->cmask.size || tex->fmask.size || tex->dcc_offset);
+               /* CMASK or DCC can be discarded and we can still end up here. */
+               if (!tex->cmask.size && !tex->fmask.size && !tex->dcc_offset)
+                       continue;
 
                si_blit_decompress_color(&sctx->b.b, tex,
                                         view->u.tex.first_level, view->u.tex.last_level,