diff options
author | Ian Romanick <[email protected]> | 2012-12-01 10:50:57 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-12-03 21:24:54 -0800 |
commit | a13f9dfbb88720c9ccca443e834106a80e69fedb (patch) | |
tree | 5c4973c96fb2dea6ac58d822dfe49966edd4c601 /src/mesa/main | |
parent | 4d2f04cd6cb2fbaee54ab6e0f84cdb576ceeadcd (diff) |
mesa: Only require Gen'ed name for glBind{Framebuffer,Renderbuffer} on desktop
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.
Chad pointed out in a review e-mail:
"I'd like to point out, though, that glBindFramebufferEXT and
glBindRenderbufferEXT are still broken on desktop GL because they
don't accept user-genned names. But that fix belongs to a different
series."
Currently glBindFramebufferEXT is an alias for glBindFramebuffer.
Unalising two functions presents some difficulty, so we'll have to
revisit this eventually.
v2: Perform same check in _mesa_BindRenderbuffer too.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]> [v1]
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/fbobject.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 9eec61de695..ce77b9f77b6 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -920,7 +920,9 @@ _mesa_BindRenderbuffer(GLenum target, GLuint renderbuffer) /* ID was reserved, but no real renderbuffer object made yet */ newRb = NULL; } - else if (!newRb && ctx->Extensions.ARB_framebuffer_object) { + else if (!newRb + && _mesa_is_desktop_gl(ctx) + && ctx->Extensions.ARB_framebuffer_object) { /* All RB IDs must be Gen'd */ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)"); return; @@ -1761,7 +1763,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; |