Mesa (master): freedreno: Disable UBWC on Z24S8 if not TEXTURE_2D.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 4 23:35:04 UTC 2020
Module: Mesa
Branch: master
Commit: ecd62ff7665d0a731ead705321e4e1ee0757974d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ecd62ff7665d0a731ead705321e4e1ee0757974d
Author: Eric Anholt <eric at anholt.net>
Date: Thu Dec 12 14:30:29 2019 -0800
freedreno: Disable UBWC on Z24S8 if not TEXTURE_2D.
Fixes two of our three remaining GLES CTS failures, and avoids more
regressions once we enable UBWC mipmaps.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3059>
---
src/gallium/drivers/freedreno/a6xx/fd6_resource.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
index 954024cfb12..d35a42156bb 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
@@ -35,7 +35,7 @@
* it can be tiled doesn't mean it can be compressed.
*/
static bool
-ok_ubwc_format(enum pipe_format pfmt)
+ok_ubwc_format(struct fd_resource *rsc, enum pipe_format pfmt)
{
/* NOTE: both x24s8 and z24s8 map to RB6_X8Z24_UNORM, but UBWC
* does not seem to work properly when sampling x24s8.. possibly
@@ -48,6 +48,14 @@ ok_ubwc_format(enum pipe_format pfmt)
if (pfmt == PIPE_FORMAT_X24S8_UINT)
return false;
+ /* We don't fully understand what's going wrong with this combination, but
+ * we haven't been able to make it work. It's enough of a corner-case
+ * that we can just disable UBWC for these resources.
+ */
+ if (rsc->base.target != PIPE_TEXTURE_2D &&
+ pfmt == PIPE_FORMAT_Z24_UNORM_S8_UINT)
+ return false;
+
switch (fd6_pipe2color(pfmt)) {
case RB6_R10G10B10A2_UINT:
case RB6_R10G10B10A2_UNORM:
@@ -92,7 +100,7 @@ fd6_fill_ubwc_buffer_sizes(struct fd_resource *rsc)
uint32_t width = prsc->width0;
uint32_t height = prsc->height0;
- if (!ok_ubwc_format(prsc->format))
+ if (!ok_ubwc_format(rsc, prsc->format))
return 0;
/* limit things to simple single level 2d for now: */
@@ -154,7 +162,7 @@ fd6_validate_format(struct fd_context *ctx, struct fd_resource *rsc,
if (!rsc->layout.ubwc_layer_size)
return;
- if (ok_ubwc_format(format))
+ if (ok_ubwc_format(rsc, format))
return;
fd_resource_uncompress(ctx, rsc);
More information about the mesa-commit
mailing list