[Mesa-dev] [PATCH 1/2] mesa: Only require Gen'ed name for glBindFramebuffer on desktop

Ian Romanick idr at freedesktop.org
Sat Dec 1 11:10:29 PST 2012


From: Ian Romanick <ian.d.romanick at intel.com>

Desktop OpenGL implementations that support either GL_ARB_framebuffer_object
or OpenGL 3.0 must require names from glGenFramebuffers for
glBindFramebuffer.  We have enforced this rule for quite some time.  However,
OpenGL ES 1.0, 2.0, and 3.0 implementations are required to allow user-defined
names (e.g., not from glGenFramebuffers{OES,}).

The Intel drivers have hacked around this by not enabling
GL_ARB_framebuffer_object in an ES context.  Instead, just pick the correct
behavior in _mesa_BindFramebuffer based on the context API.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Chad Versace <chad.versace at linux.intel.com>
Cc: Matt Turner <mattst88 at gmail.com>
---
 src/mesa/main/fbobject.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index d05c1e4..f3d292d 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1743,7 +1743,9 @@ _mesa_BindFramebuffer(GLenum target, GLuint framebuffer)
          /* ID was reserved, but no real framebuffer object made yet */
          newDrawFb = NULL;
       }
-      else if (!newDrawFb && ctx->Extensions.ARB_framebuffer_object) {
+      else if (!newDrawFb
+               && _mesa_is_desktop_gl(ctx)
+               && ctx->Extensions.ARB_framebuffer_object) {
          /* All FBO IDs must be Gen'd */
          _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)");
          return;
-- 
1.7.11.7



More information about the mesa-dev mailing list