[Mesa-dev] [PATCH] Distinction between ARB and EXT dispatch table entries related to framebuffer_object.
Ian Romanick
idr at freedesktop.org
Wed Jul 17 16:38:16 PDT 2013
(Expanded CC list.)
A little bit of back story is in order here.
When I added support to Mesa for GL_ARB_famebuffer_object, I made a
mistake. Almost all of the functions between the ARB and the EXT share
the same GLX protocol because the functionality is, essentially,
identical. However, there are some differences between the extensions:
- In the ARB extension, names must come from glGenBuffers.
- In the ARB extension, framebuffer objects are not shared (but they are
in the EXT).
For these reasons, glBindFramebuffer and glBindRenderbuffer have
different GLX protocol opcodes than their EXT counterparts. I failed to
notice this, and all of the functions alias each other. This prevents
us from being able to strictly adhere to the specification in GL
versions previous to OpenGL 3.1 (in 3.1+ we no longer expose the EXT
extensions, and we only do the strict ARB behavior).
This patch enables us to fix that problem. I will have patches for Mesa
shortly to address that.
HOWEVER, this does represent a compatibility break between the loader
(libGL or the Xserver GLX module) and the driver. Mesa drivers compiled
without this change will request a single dispatch table entry for
glBindFramebuffer and glBindFramebufferEXT. Since the updated loader
has different entries for each, the request will fail, and the driver
will die in a fire.
Drivers built with the change should continue to load fine on loaders
without the change. In this case, the driver will separately ask for
entries for glBindFramebuffer and glBindFramebufferEXT, and the loader
will tell it the same location. Since the loader in the server's GLX
module is not (yet) updated, this should not be a problem. We also do
not advertise the ARB extension from the server, so, again, this should
not be a problem for the server.
HOWEVER, this means that DRI1 drivers (remember mga_dri.so?) will no
longer load. If folks accept this patch in master (and therefore the
9.2 release), I will backport it to the tree containing the DRI1 drivers
and make a new release.
I will also fix-up the commit message to contain much of this information.
On 07/16/2013 11:57 AM, Tomasz Lis wrote:
> From: Tomasz Lis <tomasz.lis at intel.com>
>
> This fix splits entries in dispatch table mechanism according to
> framebuffer_object EXT and ARB specs. Different bind functions
> allow further diferentiation in other calls, based on binded
^^^^^^^^^^^^^^ ^^^^^^
differentiation bound
> type of object.
>
> This patch is based on one created by Bartosz Zawistowski.
Can we get all of the proper Signed-off-bys?
> ---
> src/mapi/glapi/gen/EXT_framebuffer_object.xml | 4 ++--
> src/mesa/main/fbobject.c | 14 ++++++++++++++
> src/mesa/main/fbobject.h | 6 ++++++
> 3 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/src/mapi/glapi/gen/EXT_framebuffer_object.xml b/src/mapi/glapi/gen/EXT_framebuffer_object.xml
> index 85a05f6..c0232b8 100644
> --- a/src/mapi/glapi/gen/EXT_framebuffer_object.xml
> +++ b/src/mapi/glapi/gen/EXT_framebuffer_object.xml
> @@ -78,7 +78,7 @@
> <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>
> @@ -111,7 +111,7 @@
> <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>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index f59fdb1..a29f1ab 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -1155,6 +1155,13 @@ _mesa_BindRenderbuffer(GLenum target, GLuint renderbuffer)
> }
>
>
> +void GLAPIENTRY
> +_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
> +{
> + _mesa_BindRenderbuffer(target, renderbuffer);
> +}
> +
> +
> /**
> * If the given renderbuffer is anywhere attached to the framebuffer, detach
> * the renderbuffer.
> @@ -2025,6 +2032,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)
> diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
> index 4066ea6..0a2a5cc 100644
> --- a/src/mesa/main/fbobject.h
> +++ b/src/mesa/main/fbobject.h
> @@ -120,6 +120,9 @@ 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
> @@ -152,6 +155,9 @@ 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
>
More information about the mesa-dev
mailing list