mesa: Fix error reporting for some cases of incomplete FBO attachments
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 15 Dec 2014 08:29:55 +0000 (09:29 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 13 Jan 2015 11:19:32 +0000 (12:19 +0100)
According to the OpenGL and OpenGL ES specs (sections
"FRAMEBUFFER COMPLETENESS" and "Whole Framebuffer Completeness"),
the image for color, depth or stencil attachments must be renderable,
otherwise the attachment is considered incomplete and we should report
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT. Currently, we detect this
situation properly but report a different error.

This fixes the following 3 piglit tests:
dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgb_unsigned_int_2_10_10_10_rev
dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgba_unsigned_int_2_10_10_10_rev
dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgb16f

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/fbobject.c

index c5dd037c74265b050b4a0e306177fb6779c9896f..f4b0d6dc0b7c33292bb28eaf3488458ad39a89cb 100644 (file)
@@ -966,7 +966,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
          if (!is_format_color_renderable(ctx, attFormat,
                                          texImg->InternalFormat) &&
              !is_legal_depth_format(ctx, f)) {
-            fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT;
+            fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
             fbo_incomplete(ctx, "texture attachment incomplete", -1);
             return;
          }