[Mesa-dev] [PATCH 4/4] mesa: implement glFramebufferTexture
Ian Romanick
idr at freedesktop.org
Tue Apr 30 10:04:01 PDT 2013
On 04/27/2013 04:37 PM, Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
> src/mapi/glapi/gen/GL3x.xml | 2 +-
> src/mesa/main/fbobject.c | 17 +++++++++++++++++
> src/mesa/main/fbobject.h | 4 ++++
> 3 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/src/mapi/glapi/gen/GL3x.xml b/src/mapi/glapi/gen/GL3x.xml
> index 9ca3d47..5078f7b 100644
> --- a/src/mapi/glapi/gen/GL3x.xml
> +++ b/src/mapi/glapi/gen/GL3x.xml
> @@ -607,7 +607,7 @@
> <param name="params" type="GLint64 *"/>
> </function>
>
> - <function name="FramebufferTexture" offset="assign" exec="skip">
> + <function name="FramebufferTexture" offset="assign">
> <param name="target" type="GLenum"/>
> <param name="attachment" type="GLenum"/>
> <param name="texture" type="GLuint"/>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 419e871..32dcc75 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2402,6 +2402,23 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment,
>
>
> void GLAPIENTRY
> +_mesa_FramebufferTexture(GLenum target, GLenum attachment,
> + GLuint texture, GLint level)
> +{
> + GET_CURRENT_CONTEXT(ctx);
> +
> + if ((_mesa_is_desktop_gl(ctx) && ctx->Version >= 32) ||
> + ctx->Extensions.ARB_geometry_shader4) {
This should be
if (_mesa_is_desktop_gl(ctx) && (ctx->Version >= 32 ||
ctx->Extensions.ARB_geometry_shader4))
If a driver sets the ARB_geometry_shader4 bit in an ES context, this
function should still generate GL_INVALID_OPERATION.
Actually... is the _mesa_is_desktop_gl check even necessary? This
function shouldn't get put in the dispatch table for an ES context at
all. Right?
> + framebuffer_texture(ctx, "Layer", target, attachment, 0, texture,
> + level, 0, GL_TRUE);
> + } else {
> + _mesa_error(ctx, GL_INVALID_OPERATION,
> + "unsupported function (glFramebufferTexture) called");
> + }
> +}
> +
> +
> +void GLAPIENTRY
> _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,
> GLenum renderbufferTarget,
> GLuint renderbuffer)
> diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
> index ba013fd..2d88001 100644
> --- a/src/mesa/main/fbobject.h
> +++ b/src/mesa/main/fbobject.h
> @@ -192,6 +192,10 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment,
> GLuint texture, GLint level, GLint layer);
>
> extern void GLAPIENTRY
> +_mesa_FramebufferTexture(GLenum target, GLenum attachment,
> + GLuint texture, GLint level);
> +
> +extern void GLAPIENTRY
> _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,
> GLenum renderbuffertarget,
> GLuint renderbuffer);
>
More information about the mesa-dev
mailing list