[Mesa-dev] [PATCH] Fix for dispatch table entries and es2-compatibility mode

Ian Romanick idr at freedesktop.org
Tue Mar 12 09:10:07 PDT 2013


On 03/12/2013 07:13 AM, Bartosz Zawistowski wrote:
> This fix splits several entries in dispatch table mechanism as in
> es2 compatibility mode EXT calls should be different than ARB ones.
> EXT equivalents wraps non-EXT calls so that DRI drivers are not affected
> by changes in frontend.

This will completely break compatibility between libGL and existing DRI 
drivers (i.e., a new libGL and old DRI driver won't work together), so 
it's not a change I take lightly.

Since these just provide name wrappers (and extra call overhead), I 
can't see any reason to include these.  What's the purpose?

Also, you need to subscribe to mesa-dev before you can post there.

> ---
>   src/mapi/glapi/gen/EXT_framebuffer_object.xml |   28 ++++----
>   src/mesa/main/fbobject.c                      |   94 +++++++++++++++++++++++++
>   src/mesa/main/fbobject.h                      |   48 +++++++++++++
>   3 files changed, 156 insertions(+), 14 deletions(-)
>
> diff --git a/src/mapi/glapi/gen/EXT_framebuffer_object.xml b/src/mapi/glapi/gen/EXT_framebuffer_object.xml
> index 85a05f6..1a868a3 100644
> --- a/src/mapi/glapi/gen/EXT_framebuffer_object.xml
> +++ b/src/mapi/glapi/gen/EXT_framebuffer_object.xml
> @@ -73,60 +73,60 @@
>       </enum>
>       <enum name="INVALID_FRAMEBUFFER_OPERATION_EXT"        value="0x0506"/>
>
> -    <function name="IsRenderbufferEXT" alias="IsRenderbuffer">
> +    <function name="IsRenderbufferEXT" offset="assign">
>           <param name="renderbuffer" type="GLuint"/>
>   	<return type="GLboolean"/>
>       </function>
>
> -    <function name="BindRenderbufferEXT" alias="BindRenderbuffer">
> +    <function name="BindRenderbufferEXT" offset="assign">
>           <param name="target" type="GLenum"/>
>           <param name="renderbuffer" type="GLuint"/>
>       </function>
>
> -    <function name="DeleteRenderbuffersEXT" alias="DeleteRenderbuffers">
> +    <function name="DeleteRenderbuffersEXT" offset="assign">
>           <param name="n" type="GLsizei"/>
>           <param name="renderbuffers" type="const GLuint *"/>
>       </function>
>
> -    <function name="GenRenderbuffersEXT" alias="GenRenderbuffers">
> +    <function name="GenRenderbuffersEXT" offset="assign">
>           <param name="n" type="GLsizei"/>
>           <param name="renderbuffers" type="GLuint *"/>
>       </function>
>
> -    <function name="RenderbufferStorageEXT" alias="RenderbufferStorage">
> +    <function name="RenderbufferStorageEXT" offset="assign">
>           <param name="target" type="GLenum"/>
>           <param name="internalformat" type="GLenum"/>
>           <param name="width" type="GLsizei"/>
>           <param name="height" type="GLsizei"/>
>       </function>
>
> -    <function name="GetRenderbufferParameterivEXT" alias="GetRenderbufferParameteriv">
> +    <function name="GetRenderbufferParameterivEXT" offset="assign">
>           <param name="target" type="GLenum"/>
>           <param name="pname" type="GLenum"/>
>           <param name="params" type="GLint *"/>
>       </function>
>
> -    <function name="IsFramebufferEXT" alias="IsFramebuffer">
> +    <function name="IsFramebufferEXT" offset="assign">
>           <param name="framebuffer" type="GLuint"/>
>   	<return type="GLboolean"/>
>       </function>
>
> -    <function name="BindFramebufferEXT" alias="BindFramebuffer">
> +    <function name="BindFramebufferEXT" offset="assign">
>           <param name="target" type="GLenum"/>
>           <param name="framebuffer" type="GLuint"/>
>       </function>
>
> -    <function name="DeleteFramebuffersEXT" alias="DeleteFramebuffers">
> +    <function name="DeleteFramebuffersEXT" offset="assign">
>           <param name="n" type="GLsizei"/>
>           <param name="framebuffers" type="const GLuint *"/>
>       </function>
>
> -    <function name="GenFramebuffersEXT" alias="GenFramebuffers">
> +    <function name="GenFramebuffersEXT" offset="assign">
>           <param name="n" type="GLsizei"/>
>           <param name="framebuffers" type="GLuint *"/>
>       </function>
>
> -    <function name="CheckFramebufferStatusEXT" alias="CheckFramebufferStatus">
> +    <function name="CheckFramebufferStatusEXT" offset="assign">
>           <param name="target" type="GLenum"/>
>   	<return type="GLenum"/>
>       </function>
> @@ -156,14 +156,14 @@
>           <param name="zoffset" type="GLint"/>
>       </function>
>
> -    <function name="FramebufferRenderbufferEXT" alias="FramebufferRenderbuffer">
> +    <function name="FramebufferRenderbufferEXT" offset="assign">
>           <param name="target" type="GLenum"/>
>           <param name="attachment" type="GLenum"/>
>           <param name="renderbuffertarget" type="GLenum"/>
>           <param name="renderbuffer" type="GLuint"/>
>       </function>
>
> -    <function name="GetFramebufferAttachmentParameterivEXT" alias="GetFramebufferAttachmentParameteriv">
> +    <function name="GetFramebufferAttachmentParameterivEXT" offset="assign">
>           <param name="target" type="GLenum"/>
>           <param name="attachment" type="GLenum"/>
>           <param name="pname" type="GLenum"/>
> @@ -205,7 +205,7 @@
>           <size name="Get" mode="get"/>
>       </enum>
>
> -    <function name="RenderbufferStorageMultisampleEXT" alias="RenderbufferStorageMultisample">
> +    <function name="RenderbufferStorageMultisampleEXT" offset="assign">
>           <param name="target" type="GLenum"/>
>           <param name="samples" type="GLsizei"/>
>           <param name="internalformat" type="GLenum"/>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index d6acc58..7317cc3 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -983,6 +983,12 @@ _mesa_IsRenderbuffer(GLuint renderbuffer)
>      return GL_FALSE;
>   }
>
> +GLboolean GLAPIENTRY
> +_mesa_IsRenderbufferEXT(GLuint renderbuffer)
> +{
> +    return _mesa_IsRenderbuffer(renderbuffer);
> +}
> +
>
>   void GLAPIENTRY
>   _mesa_BindRenderbuffer(GLenum target, GLuint renderbuffer)
> @@ -1034,6 +1040,12 @@ _mesa_BindRenderbuffer(GLenum target, GLuint renderbuffer)
>      _mesa_reference_renderbuffer(&ctx->CurrentRenderbuffer, newRb);
>   }
>
> +void GLAPIENTRY
> +_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
> +{
> +    _mesa_BindRenderbuffer(target, renderbuffer);
> +}
> +
>
>   /**
>    * If the given renderbuffer is anywhere attached to the framebuffer, detach
> @@ -1101,6 +1113,13 @@ _mesa_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
>
>
>   void GLAPIENTRY
> +_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers)
> +{
> +    _mesa_DeleteRenderbuffers(n, renderbuffers);
> +}
> +
> +
> +void GLAPIENTRY
>   _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers)
>   {
>      GET_CURRENT_CONTEXT(ctx);
> @@ -1128,6 +1147,13 @@ _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers)
>   }
>
>
> +void GLAPIENTRY
> +_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers)
> +{
> +    _mesa_GenRenderbuffers(n, renderbuffers);
> +}
> +
> +
>   /**
>    * Given an internal format token for a render buffer, return the
>    * corresponding base format (one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX,
> @@ -1626,6 +1652,14 @@ _mesa_RenderbufferStorage(GLenum target, GLenum internalFormat,
>
>
>   void GLAPIENTRY
> +_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
> +                                GLsizei width, GLsizei height)
> +{
> +    _mesa_RenderbufferStorage(target, internalFormat, width, height);
> +}
> +
> +
> +void GLAPIENTRY
>   _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
>                                        GLenum internalFormat,
>                                        GLsizei width, GLsizei height)
> @@ -1634,6 +1668,15 @@ _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
>   }
>
>
> +void GLAPIENTRY
> +_mesa_RenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples,
> +                                        GLenum internalFormat,
> +                                        GLsizei width, GLsizei height)
> +{
> +   _mesa_RenderbufferStorageMultisample(target, samples, internalFormat, width, height);
> +}
> +
> +
>   /**
>    * OpenGL ES version of glRenderBufferStorage.
>    */
> @@ -1725,6 +1768,13 @@ _mesa_IsFramebuffer(GLuint framebuffer)
>   }
>
>
> +GLboolean GLAPIENTRY
> +_mesa_IsFramebufferEXT(GLuint framebuffer)
> +{
> +    return _mesa_IsFramebuffer(framebuffer);
> +}
> +
> +
>   /**
>    * Check if any of the attachments of the given framebuffer are textures
>    * (render to texture).  Call ctx->Driver.RenderTexture() for such
> @@ -1906,6 +1956,13 @@ _mesa_BindFramebuffer(GLenum target, GLuint framebuffer)
>
>
>   void GLAPIENTRY
> +_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
> +{
> +    _mesa_BindFramebuffer(target, framebuffer);
> +}
> +
> +
> +void GLAPIENTRY
>   _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
>   {
>      GLint i;
> @@ -1959,6 +2016,13 @@ _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
>
>
>   void GLAPIENTRY
> +_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
> +{
> +    _mesa_DeleteFramebuffers(n, framebuffers);
> +}
> +
> +
> +void GLAPIENTRY
>   _mesa_GenFramebuffers(GLsizei n, GLuint *framebuffers)
>   {
>      GET_CURRENT_CONTEXT(ctx);
> @@ -1986,6 +2050,12 @@ _mesa_GenFramebuffers(GLsizei n, GLuint *framebuffers)
>   }
>
>
> +void GLAPIENTRY
> +_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers)
> +{
> +    _mesa_GenFramebuffers(n, framebuffers);
> +}
> +
>
>   GLenum GLAPIENTRY
>   _mesa_CheckFramebufferStatus(GLenum target)
> @@ -2020,6 +2090,13 @@ _mesa_CheckFramebufferStatus(GLenum target)
>   }
>
>
> +GLenum GLAPIENTRY
> +_mesa_CheckFramebufferStatusEXT(GLenum target)
> +{
> +    return _mesa_CheckFramebufferStatus(target);
> +}
> +
> +
>   /**
>    * Replicate the src attachment point. Used by framebuffer_texture() when
>    * the same texture is attached at GL_DEPTH_ATTACHMENT and
> @@ -2414,6 +2491,15 @@ _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,
>
>
>   void GLAPIENTRY
> +_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
> +                                 GLenum renderbufferTarget,
> +                                 GLuint renderbuffer)
> +{
> +    _mesa_FramebufferRenderbuffer(target, attachment, renderbufferTarget, renderbuffer);
> +}
> +
> +
> +void GLAPIENTRY
>   _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
>                                                GLenum pname, GLint *params)
>   {
> @@ -2668,6 +2754,14 @@ invalid_pname_enum:
>
>
>   void GLAPIENTRY
> +_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
> +                                                GLenum pname, GLint *params)
> +{
> +    _mesa_GetFramebufferAttachmentParameteriv(target, attachment, pname, params);
> +}
> +
> +
> +void GLAPIENTRY
>   _mesa_GenerateMipmap(GLenum target)
>   {
>      struct gl_texture_image *srcImage;
> diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
> index ec8b0af..25e4cae 100644
> --- a/src/mesa/main/fbobject.h
> +++ b/src/mesa/main/fbobject.h
> @@ -126,25 +126,46 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat);
>   extern GLboolean GLAPIENTRY
>   _mesa_IsRenderbuffer(GLuint renderbuffer);
>
> +extern GLboolean GLAPIENTRY
> +_mesa_IsRenderbufferEXT(GLuint renderbuffer);
> +
>   extern void GLAPIENTRY
>   _mesa_BindRenderbuffer(GLenum target, GLuint renderbuffer);
>
>   extern void GLAPIENTRY
> +_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer);
> +
> +extern void GLAPIENTRY
>   _mesa_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers);
>
>   extern void GLAPIENTRY
> +_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
> +
> +extern void GLAPIENTRY
>   _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers);
>
>   extern void GLAPIENTRY
> +_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers);
> +
> +extern void GLAPIENTRY
>   _mesa_RenderbufferStorage(GLenum target, GLenum internalformat,
>                                GLsizei width, GLsizei height);
>
>   extern void GLAPIENTRY
> +_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalformat,
> +                                GLsizei width, GLsizei height);
> +
> +extern void GLAPIENTRY
>   _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
>                                        GLenum internalformat,
>                                        GLsizei width, GLsizei height);
>
>   extern void GLAPIENTRY
> +_mesa_RenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples,
> +                                        GLenum internalformat,
> +                                        GLsizei width, GLsizei height);
> +
> +extern void GLAPIENTRY
>   _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
>   			   GLsizei width, GLsizei height);
>
> @@ -155,21 +176,40 @@ extern void GLAPIENTRY
>   _mesa_GetRenderbufferParameteriv(GLenum target, GLenum pname,
>                                       GLint *params);
>
> +extern void GLAPIENTRY
> +_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname,
> +                                       GLint *params);
> +
>   extern GLboolean GLAPIENTRY
>   _mesa_IsFramebuffer(GLuint framebuffer);
>
> +extern GLboolean GLAPIENTRY
> +_mesa_IsFramebufferEXT(GLuint framebuffer);
> +
>   extern void GLAPIENTRY
>   _mesa_BindFramebuffer(GLenum target, GLuint framebuffer);
>
>   extern void GLAPIENTRY
> +_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer);
> +
> +extern void GLAPIENTRY
>   _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers);
>
>   extern void GLAPIENTRY
> +_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
> +
> +extern void GLAPIENTRY
>   _mesa_GenFramebuffers(GLsizei n, GLuint *framebuffers);
>
> +extern void GLAPIENTRY
> +_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers);
> +
>   extern GLenum GLAPIENTRY
>   _mesa_CheckFramebufferStatus(GLenum target);
>
> +extern GLenum GLAPIENTRY
> +_mesa_CheckFramebufferStatusEXT(GLenum target);
> +
>   extern void GLAPIENTRY
>   _mesa_FramebufferTexture1D(GLenum target, GLenum attachment,
>                                 GLenum textarget, GLuint texture, GLint level);
> @@ -193,10 +233,18 @@ _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,
>                                    GLuint renderbuffer);
>
>   extern void GLAPIENTRY
> +_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
> +                                 GLenum renderbuffertarget,
> +                                 GLuint renderbuffer);
> +extern void GLAPIENTRY
>   _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
>                                                GLenum pname, GLint *params);
>
>   extern void GLAPIENTRY
> +_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
> +                                                GLenum pname, GLint *params);
> +
> +extern void GLAPIENTRY
>   _mesa_GenerateMipmap(GLenum target);
>
>
>



More information about the mesa-dev mailing list