radeonsi: fix a crash when binding a NULL sampler view list
authorMarek Olšák <marek.olsak@amd.com>
Sun, 1 Feb 2015 12:16:06 +0000 (13:16 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 4 Feb 2015 13:34:13 +0000 (14:34 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c

index 15b4da1e8c1e80aa327d356b54306357114889e7..372782f49d9956308beecd11936d2fd0ac660a77 100644 (file)
@@ -404,7 +404,7 @@ static void si_set_sampler_views(struct pipe_context *ctx,
        for (i = 0; i < count; i++) {
                unsigned slot = start + i;
 
-               if (!views[i]) {
+               if (!views || !views[i]) {
                        samplers->depth_texture_mask &= ~(1 << slot);
                        samplers->compressed_colortex_mask &= ~(1 << slot);
                        si_set_sampler_view(sctx, shader, slot, NULL, NULL);