Fixes a crash with unsupported formats in dEQP-GLES3.functional.texture.format.sized.2d.rgb9_e5_pot
Also fixes gpu hangs with some formats that are supported, but which we
don't know what internal-format to use for the blitter, for ex
dEQP-GLES3.functional.texture.format.sized.2d_array.rgb10_a2_pot
Signed-off-by: Rob Clark <robdclark@gmail.com>
(b->z >= 0) && (b->z + b->depth <= last_layer);
}
+static bool
+ok_format(enum pipe_format pfmt)
+{
+ enum a6xx_color_fmt fmt = fd6_pipe2color(pfmt);
+ if (fmt == ~0)
+ return false;
+
+ if (fd6_ifmt(fmt) == 0)
+ return false;
+
+ return true;
+}
+
#define DEBUG_BLIT_FALLBACK 0
#define fail_if(cond) \
do { \
fail_if(util_format_is_compressed(info->src.format) !=
util_format_is_compressed(info->src.format));
+ /* Fail if unsupported format: */
+ fail_if(!ok_format(info->src.format));
+ fail_if(!ok_format(info->dst.format));
+
/* ... but only if they're the same compression format. */
fail_if(util_format_is_compressed(info->src.format) &&
info->src.format != info->dst.format);