[Mesa-dev] [PATCH 1/2 v2] mesa: Only require Gen'ed name for glBind{Framebuffer, Renderbuffer} on desktop
Ian Romanick
idr at freedesktop.org
Mon Dec 3 09:26:28 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.
v2: Perform same check in _mesa_BindRenderbuffer too.
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>
---
The other patch in the series is unchanged.
src/mesa/main/fbobject.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 90a89c2..0ae4d38 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;
@@ -1743,7 +1745,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