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

Kenneth Graunke kenneth at whitecape.org
Sat Dec 1 12:41:46 PST 2012


On 12/01/2012 11:10 AM, Ian Romanick wrote:
> 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,}).

Ugh...seriously?  What were they thinking?  They require Gen'd names for 
just about everything else in ES 3.0...

> 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.

This was the whole reason for the EXT/ARB debacle we had?  Over one line 
of code? :)

Looks good to me...both patches are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

(but I really want Chad's review)

> 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;



More information about the mesa-dev mailing list