summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-09-07 02:51:24 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-09-08 22:51:33 +0200
commit758bc52959e8132e7972b4e7086c1220e0497d61 (patch)
treef36a95c9bded1bccc2cbbd19005a90b23f56b661 /src/gallium/drivers/radeon/r600_texture.c
parent46c425e7c8bbc07b435e59834ed5f379f3f69bdf (diff)
downloadexternal_mesa3d-758bc52959e8132e7972b4e7086c1220e0497d61.zip
external_mesa3d-758bc52959e8132e7972b4e7086c1220e0497d61.tar.gz
external_mesa3d-758bc52959e8132e7972b4e7086c1220e0497d61.tar.bz2
radeonsi: fix texture reinterpretation after DCC fast clear
The problem is that TC-compatible DCC clear codes translate into different clear values when you change the format. I have a new piglit reproducing the issue. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_texture.c')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 074fed8..e452588 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -1669,11 +1669,15 @@ static const struct u_resource_vtbl r600_texture_vtbl =
/* DCC channel type categories within which formats can be reinterpreted
* while keeping the same DCC encoding. The swizzle must also match. */
enum dcc_channel_type {
- dcc_channel_any32,
- dcc_channel_int16,
+ dcc_channel_float32,
+ dcc_channel_uint32,
+ dcc_channel_sint32,
dcc_channel_float16,
- dcc_channel_any_10_10_10_2,
- dcc_channel_any8,
+ dcc_channel_uint16,
+ dcc_channel_sint16,
+ dcc_channel_uint_10_10_10_2,
+ dcc_channel_uint8,
+ dcc_channel_sint8,
dcc_channel_incompatible,
};
@@ -1692,19 +1696,23 @@ vi_get_dcc_channel_type(const struct util_format_description *desc)
switch (desc->channel[i].size) {
case 32:
- if (desc->nr_channels == 4)
- return dcc_channel_incompatible;
- else
- return dcc_channel_any32;
+ if (desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT)
+ return dcc_channel_float32;
+ if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED)
+ return dcc_channel_uint32;
+ return dcc_channel_sint32;
case 16:
if (desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT)
return dcc_channel_float16;
- else
- return dcc_channel_int16;
+ if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED)
+ return dcc_channel_uint16;
+ return dcc_channel_sint16;
case 10:
- return dcc_channel_any_10_10_10_2;
+ return dcc_channel_uint_10_10_10_2;
case 8:
- return dcc_channel_any8;
+ if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED)
+ return dcc_channel_uint8;
+ return dcc_channel_sint8;
default:
return dcc_channel_incompatible;
}