mesa/es: Allow other color attachments in OpenGL ES 2.0
authorIan Romanick <ian.d.romanick@intel.com>
Sun, 2 Oct 2011 22:03:07 +0000 (15:03 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 4 Oct 2011 19:25:57 +0000 (12:25 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/fbobject.c

index 6e54c09d7c74ed592f5552173d22e50971c33024..1d3980607f6ba42229f5d57e4bd44a91069ab5e2 100644 (file)
@@ -240,9 +240,13 @@ _mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
    case GL_COLOR_ATTACHMENT13_EXT:
    case GL_COLOR_ATTACHMENT14_EXT:
    case GL_COLOR_ATTACHMENT15_EXT:
+      /* Only OpenGL ES 1.x forbids color attachments other than
+       * GL_COLOR_ATTACHMENT0.  For all other APIs the limit set by the
+       * hardware is used.
+       */
       i = attachment - GL_COLOR_ATTACHMENT0_EXT;
       if (i >= ctx->Const.MaxColorAttachments
-         || (i > 0 && ctx->API != API_OPENGL)) {
+         || (i > 0 && ctx->API == API_OPENGLES)) {
         return NULL;
       }
       return &fb->Attachment[BUFFER_COLOR0 + i];