radeonsi: fix a crash when binding a sampler buffer
authorMarek Olšák <marek.olsak@amd.com>
Thu, 11 Feb 2016 14:49:51 +0000 (15:49 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 11 Feb 2016 15:48:30 +0000 (16:48 +0100)
Buffers don't contain r600_texture.

Broken by 7aedbbacae6d3ec3d06735fff2eb66:
"radeonsi: put image, fmask, and sampler descriptors into one array"

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94091

src/gallium/drivers/radeonsi/si_descriptors.c

index 34cc06fc078431018cc56daab477da9c9f888b8f..345f2bbc3814d9817a46aa1810bbedbead844701 100644 (file)
@@ -203,7 +203,8 @@ static void si_set_sampler_view(struct si_context *sctx,
                pipe_sampler_view_reference(&views->views[slot], view);
                memcpy(views->desc.list + slot * 16, rview->state, 8*4);
 
-               if (rtex && rtex->fmask.size) {
+               if (view->texture && view->texture->target != PIPE_BUFFER &&
+                   rtex->fmask.size) {
                        memcpy(views->desc.list + slot*16 + 8,
                               rview->fmask_state, 8*4);
                } else {