Modern OpenGL BlitFramebuffer require sRGB encode/decode when
GL_FRAMEBUFFER_SRGB is enabled. The blitter can't handle this,
so we need to bail. On Gen4-5, this means falling back to Meta,
which should handle it.
We allow sRGB <-> sRGB blits, as decode then encode ought to be a noop
(other than potential precision loss, which nobody wants anyway).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
return false;
/* No sRGB decode or encode is done by the hardware blitter, which is
- * consistent with what we want in the callers (glCopyTexSubImage(),
- * glBlitFramebuffer(), texture validation, etc.).
+ * consistent with what we want in many callers (glCopyTexSubImage(),
+ * texture validation, etc.).
*/
mesa_format src_format = _mesa_get_srgb_format_linear(src_mt->format);
mesa_format dst_format = _mesa_get_srgb_format_linear(dst_mt->format);
return mask;
}
+ if (ctx->Color.sRGBEnabled &&
+ _mesa_get_format_color_encoding(src_irb->mt->format) !=
+ _mesa_get_format_color_encoding(dst_irb->mt->format)) {
+ perf_debug("glBlitFramebuffer() with sRGB conversion cannot be "
+ "handled by BLT path.\n");
+ return mask;
+ }
+
if (!intel_miptree_blit(brw,
src_irb->mt,
src_irb->mt_level, src_irb->mt_layer,