Mesa (main): freedreno/a6xx: Handle u/snorm vs u/sint validation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 17 19:52:06 UTC 2021


Module: Mesa
Branch: main
Commit: 9629f3aa4632f8379631a44b95f7394fdce25fa0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9629f3aa4632f8379631a44b95f7394fdce25fa0

Author: Rob Clark <robdclark at chromium.org>
Date:   Tue Jun 15 16:50:31 2021 -0700

freedreno/a6xx: Handle u/snorm vs u/sint validation

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>

---

 src/gallium/drivers/freedreno/a6xx/fd6_resource.c         | 15 +++++++++++++++
 .../drivers/freedreno/ci/piglit-freedreno-a630-fails.txt  |  8 --------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
index dc9079c0593..e8dae28c454 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c
@@ -104,6 +104,14 @@ can_do_ubwc(struct pipe_resource *prsc)
    return true;
 }
 
+static bool
+is_norm(enum pipe_format format)
+{
+   const struct util_format_description *desc = util_format_description(format);
+
+   return desc->is_snorm || desc->is_unorm;
+}
+
 static bool
 valid_format_cast(struct fd_resource *rsc, enum pipe_format format)
 {
@@ -111,6 +119,13 @@ valid_format_cast(struct fd_resource *rsc, enum pipe_format format)
    if (format == PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8)
       return true;
 
+   /* For some color values (just "solid white") compression metadata maps to
+    * different pixel values for uint/sint vs unorm/snorm, so we can't reliably
+    * "cast" u/snorm to u/sint and visa versa:
+    */
+   if (is_norm(format) != is_norm(rsc->b.b.format))
+      return false;
+
    /* The UBWC formats can be re-interpreted so long as the components
     * have the same # of bits
     */
diff --git a/src/gallium/drivers/freedreno/ci/piglit-freedreno-a630-fails.txt b/src/gallium/drivers/freedreno/ci/piglit-freedreno-a630-fails.txt
index b9f53eb752e..a9597673ce1 100644
--- a/src/gallium/drivers/freedreno/ci/piglit-freedreno-a630-fails.txt
+++ b/src/gallium/drivers/freedreno/ci/piglit-freedreno-a630-fails.txt
@@ -246,10 +246,6 @@ spec at arb_texture_rg@texwrap formats-int bordercolor-swizzled at GL_RG32UI- swizzled
 spec at arb_texture_rg@texwrap formats-int bordercolor-swizzled at GL_RG8I- swizzled- border color only,Fail
 spec at arb_texture_rg@texwrap formats-int bordercolor-swizzled at GL_RG8UI- swizzled- border color only,Fail
 spec at arb_texture_view@bug-layers-image,Crash
-spec at arb_texture_view@rendering-formats at clear GL_RGB10_A2UI as GL_RGB10_A2,Fail
-spec at arb_texture_view@rendering-formats at clear GL_RGBA8I as GL_RGBA8,Fail
-spec at arb_texture_view@rendering-formats at clear GL_RGBA8UI as GL_RGBA8,Fail
-spec at arb_texture_view@rendering-formats,Fail
 spec at arb_texture_view@rendering-layers-image,Fail
 spec at arb_texture_view@rendering-layers-image at layers rendering of image1DArray,Fail
 spec at arb_texture_view@rendering-layers-image at layers rendering of imageCubeArray,Fail
@@ -597,10 +593,6 @@ spec at nv_primitive_restart@primitive-restart-draw-mode-polygon,Fail
 spec at nv_primitive_restart@primitive-restart-draw-mode-quads,Fail
 spec at nv_primitive_restart@primitive-restart-draw-mode-quad_strip,Fail
 spec at oes_egl_image_external_essl3@oes_egl_image_external_essl3,Crash
-spec at oes_texture_view@rendering-formats at clear GL_RGB10_A2UI as GL_RGB10_A2,Fail
-spec at oes_texture_view@rendering-formats at clear GL_RGBA8I as GL_RGBA8,Fail
-spec at oes_texture_view@rendering-formats at clear GL_RGBA8UI as GL_RGBA8,Fail
-spec at oes_texture_view@rendering-formats,Fail
 spec@!opengl 1.0 at gl-1.0-edgeflag,Crash
 spec@!opengl 1.0 at gl-1.0-edgeflag-quads,Crash
 spec@!opengl 1.0 at gl-1.0-no-op-paths,Fail



More information about the mesa-commit mailing list