mesa: only report INCOMPLETE_FORMATS for GLES1 / desktop
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 12 Mar 2021 19:25:09 +0000 (14:25 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Mar 2021 21:40:04 +0000 (21:40 +0000)
The enum is defined in EXT_framebuffer_object (available on desktop),
and was copied to OES_framebuffer_object (available in GLES1). The ES2
spec has no mention of such an enum. If the underlying implementation
does not support this, it will set a generic incomplete error (as is
done in st_cb_fbo.c if mixed_formats == false).

This should fix the following dEQP tests on ES2 drivers:

    dEQP-GLES2.functional.fbo.completeness.attachment_combinations.rbo_tex_none_none
    dEQP-GLES2.functional.fbo.completeness.attachment_combinations.tex_rbo_none_none

Fixes: fd017458bc84 (mesa: fix fbo attachment size check for RBs, make it trigger in ES2)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4444
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9572>

src/mesa/main/fbobject.c

index 5f3fa50..212feb4 100644 (file)
@@ -1314,7 +1314,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
                return;
             }
             /* check that all color buffers are the same format */
-            if (intFormat != GL_NONE && f != intFormat) {
+            if (ctx->API != API_OPENGLES2 && intFormat != GL_NONE && f != intFormat) {
                fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
                fbo_incomplete(ctx, "format mismatch", -1);
                return;