aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/encoder/pan_texture.c
diff options
context:
space:
mode:
authorIcecream95 <[email protected]>2020-06-02 14:14:12 +1200
committerMarge Bot <[email protected]>2020-06-03 15:19:43 +0000
commit99446c9f7d34a0bbefa47fdd6acb539421b59d65 (patch)
treeb9cb6732053c63fdfc42028f8c3bca666f50c0e8 /src/panfrost/encoder/pan_texture.c
parent9ac106defe351428fbe3c62547e6be918b603d32 (diff)
panfrost: Only use AFBC YTR with RGB and RGBA
The "lossless colorspace transform" is lossy for R and RG formats. Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5293>
Diffstat (limited to 'src/panfrost/encoder/pan_texture.c')
-rw-r--r--src/panfrost/encoder/pan_texture.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/panfrost/encoder/pan_texture.c b/src/panfrost/encoder/pan_texture.c
index 22ff30828ca..cfd66c78c43 100644
--- a/src/panfrost/encoder/pan_texture.c
+++ b/src/panfrost/encoder/pan_texture.c
@@ -82,8 +82,10 @@ panfrost_astc_stretch(unsigned dim)
return MIN2(dim, 11) - 4;
}
-/* Texture addresses are tagged with information about AFBC (colour AFBC?) xor
- * ASTC (stretch factor) if in use. */
+/* Texture addresses are tagged with information about compressed formats.
+ * AFBC uses a bit for whether the colorspace transform is enabled (RGB and
+ * RGBA only).
+ * For ASTC, this is a "stretch factor" encoding the block size. */
static unsigned
panfrost_compression_tag(
@@ -91,7 +93,7 @@ panfrost_compression_tag(
enum mali_format format, enum mali_texture_layout layout)
{
if (layout == MALI_TEXTURE_AFBC)
- return util_format_has_depth(desc) ? 0x0 : 0x1;
+ return desc->nr_channels >= 3;
else if (format == MALI_ASTC_HDR_SUPP || format == MALI_ASTC_SRGB_SUPP)
return (panfrost_astc_stretch(desc->block.height) << 3) |
panfrost_astc_stretch(desc->block.width);