radeonsi: Clear sampler view flags when binding a buffer
authorMichel Dänzer <michel.daenzer@amd.com>
Thu, 2 Oct 2014 07:00:26 +0000 (16:00 +0900)
committerMichel Dänzer <michel@daenzer.net>
Fri, 3 Oct 2014 02:15:38 +0000 (11:15 +0900)
Fixes assertion failure while running the Unreal Engine 4 Elemental demo:

.../si_blit.c:322:si_decompress_color_textures: Assertion `tex->cmask.size || tex->fmask.size' failed.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c

index fc535d01a8401e1456da1ee2c92d9ad4cf85eab5..922703445be2fb71bf292a6c6e231c891f5f1bb1 100644 (file)
@@ -422,6 +422,11 @@ static void si_set_sampler_views(struct pipe_context *ctx,
                                si_set_sampler_view(sctx, shader, SI_FMASK_TEX_OFFSET + slot,
                                                    NULL, NULL);
                        }
+               } else {
+                       samplers->depth_texture_mask &= ~(1 << slot);
+                       samplers->compressed_colortex_mask &= ~(1 << slot);
+                       si_set_sampler_view(sctx, shader, SI_FMASK_TEX_OFFSET + slot,
+                                           NULL, NULL);
                }
        }