From 9629f3aa4632f8379631a44b95f7394fdce25fa0 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 15 Jun 2021 16:50:31 -0700 Subject: [PATCH] freedreno/a6xx: Handle u/snorm vs u/sint validation Signed-off-by: Rob Clark Part-of: --- 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 dc9079c..e8dae28 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c @@ -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 */ 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 b9f53eb..a959767 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@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 -- 2.7.4