summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_descriptors.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-08-22 13:45:05 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-09-05 18:01:15 +0200
commit21de3be8e62b2b093569a99550e6356ed2f106b4 (patch)
tree90eca99db8834a44053c28ff34b68822823fbb03 /src/gallium/drivers/radeonsi/si_descriptors.c
parent63da0c991d228b61ca36591314098620c511dbce (diff)
downloadexternal_mesa3d-21de3be8e62b2b093569a99550e6356ed2f106b4.zip
external_mesa3d-21de3be8e62b2b093569a99550e6356ed2f106b4.tar.gz
external_mesa3d-21de3be8e62b2b093569a99550e6356ed2f106b4.tar.bz2
radeonsi: fix texture format reinterpretation with DCC
DCC is limited in how texture formats can be reinterpreted using texture views. If we get a view format that is incompatible with the initial texture format with respect to DCC, disable DCC. There is a new piglit which tests all format combinations. What works and what doesn't was deduced by looking at the piglit failures. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_descriptors.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index b80f4f2..b9fae79 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -653,7 +653,8 @@ static void si_set_shader_image(struct si_context *ctx,
assert(tex->fmask.size == 0);
if (uses_dcc &&
- view->access & PIPE_IMAGE_ACCESS_WRITE) {
+ (view->access & PIPE_IMAGE_ACCESS_WRITE ||
+ !vi_dcc_formats_compatible(res->b.b.format, view->format))) {
/* If DCC can't be disabled, at least decompress it.
* The decompression is relatively cheap if the surface
* has been decompressed already.