summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_descriptors.c
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-03-11 11:07:38 -0500
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-03-13 09:37:23 -0500
commit28d2a7e67c4e8a9835710e5775cd758aa7e27f47 (patch)
tree9799611923307a1e7e782f25149adb1442c2f1a6 /src/gallium/drivers/radeonsi/si_descriptors.c
parent61b10b4eb73dcfd12f99ffa43e703429344c9435 (diff)
downloadexternal_mesa3d-28d2a7e67c4e8a9835710e5775cd758aa7e27f47.zip
external_mesa3d-28d2a7e67c4e8a9835710e5775cd758aa7e27f47.tar.gz
external_mesa3d-28d2a7e67c4e8a9835710e5775cd758aa7e27f47.tar.bz2
radeonsi: avoid crash when a sampler state is bound for a buffer texture
Sampler states don't really make sense with buffer textures, but they can be set anyway, so we need to be defensive here. This bug was lurking for a while and was finally noticed due to PBO uploads setting sampler states. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94284 Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Marek Olšák <marek.olsak@amd.com> Tested-by: Laurent Carlier <lordheavym@gmail.com> Tested-by: Shawn Starr <shawn.starr@rogers.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_descriptors.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 11b9025..d12b3e6 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -329,6 +329,7 @@ static void si_bind_sampler_states(struct pipe_context *ctx, unsigned shader,
*/
if (samplers->views.views[i] &&
samplers->views.views[i]->texture &&
+ samplers->views.views[i]->texture->target != PIPE_BUFFER &&
((struct r600_texture*)samplers->views.views[i]->texture)->fmask.size)
continue;