freedreno/a6xx: Handle u/snorm vs u/sint validation
authorRob Clark <robdclark@chromium.org>
Tue, 15 Jun 2021 23:50:31 +0000 (16:50 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 17 Jun 2021 19:34:51 +0000 (19:34 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>

src/gallium/drivers/freedreno/a6xx/fd6_resource.c
src/gallium/drivers/freedreno/ci/piglit-freedreno-a630-fails.txt

index dc9079c..e8dae28 100644 (file)
@@ -105,12 +105,27 @@ can_do_ubwc(struct pipe_resource *prsc)
 }
 
 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)
 {
    /* Special case "casting" format in hw: */
    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
     */
index b9f53eb..a959767 100644 (file)
@@ -246,10 +246,6 @@ spec@arb_texture_rg@texwrap formats-int bordercolor-swizzled@GL_RG32UI- swizzled
 spec@arb_texture_rg@texwrap formats-int bordercolor-swizzled@GL_RG8I- swizzled- border color only,Fail
 spec@arb_texture_rg@texwrap formats-int bordercolor-swizzled@GL_RG8UI- swizzled- border color only,Fail
 spec@arb_texture_view@bug-layers-image,Crash
-spec@arb_texture_view@rendering-formats@clear GL_RGB10_A2UI as GL_RGB10_A2,Fail
-spec@arb_texture_view@rendering-formats@clear GL_RGBA8I as GL_RGBA8,Fail
-spec@arb_texture_view@rendering-formats@clear GL_RGBA8UI as GL_RGBA8,Fail
-spec@arb_texture_view@rendering-formats,Fail
 spec@arb_texture_view@rendering-layers-image,Fail
 spec@arb_texture_view@rendering-layers-image@layers rendering of image1DArray,Fail
 spec@arb_texture_view@rendering-layers-image@layers rendering of imageCubeArray,Fail
@@ -597,10 +593,6 @@ spec@nv_primitive_restart@primitive-restart-draw-mode-polygon,Fail
 spec@nv_primitive_restart@primitive-restart-draw-mode-quads,Fail
 spec@nv_primitive_restart@primitive-restart-draw-mode-quad_strip,Fail
 spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3,Crash
-spec@oes_texture_view@rendering-formats@clear GL_RGB10_A2UI as GL_RGB10_A2,Fail
-spec@oes_texture_view@rendering-formats@clear GL_RGBA8I as GL_RGBA8,Fail
-spec@oes_texture_view@rendering-formats@clear GL_RGBA8UI as GL_RGBA8,Fail
-spec@oes_texture_view@rendering-formats,Fail
 spec@!opengl 1.0@gl-1.0-edgeflag,Crash
 spec@!opengl 1.0@gl-1.0-edgeflag-quads,Crash
 spec@!opengl 1.0@gl-1.0-no-op-paths,Fail