}
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
*/
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
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