summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-18 07:41:26 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-18 09:59:29 -0700
commit5aa51ba97f91f1acaac4e201740ce0afe7272286 (patch)
tree913c1d18a5bad7d175b879f9717d00665dc7a2e7 /src
parent6585bb9f523556b04ecf941df22d02a7cc8f5f9c (diff)
panfrost: Disable AFBC on sRGB buffers
The performance impact is slightly mitigated by tiling the render target, but it's undeniably still slow compared to AFBC. Unfortunately, it doesn't look like AFBC and sRGB play nice... Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_afbc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_afbc.c b/src/gallium/drivers/panfrost/pan_afbc.c
index 0bb9d2491c6..4bef833f182 100644
--- a/src/gallium/drivers/panfrost/pan_afbc.c
+++ b/src/gallium/drivers/panfrost/pan_afbc.c
@@ -83,6 +83,13 @@ panfrost_format_supports_afbc(enum pipe_format format)
const struct util_format_description *desc =
util_format_description(format);
+ /* sRGB cannot be AFBC, but it can be tiled. TODO: Verify. The blob
+ * does not do AFBC for SRGB8_ALPHA8, but it's not clear why it
+ * shouldn't be able to. */
+
+ if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB)
+ return false;
+
if (util_format_is_rgba8_variant(desc))
return true;