From: Brian Paul Date: Thu, 29 Jan 2009 22:01:09 +0000 (-0700) Subject: mesa: allow glFramebufferTexture1/2/3D(target = GL_READ/DRAW_FRAMEBUFFER) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5fec84ad0446d4d6d842f5cf740f9787678113be;p=mesa.git mesa: allow glFramebufferTexture1/2/3D(target = GL_READ/DRAW_FRAMEBUFFER) This is part of GL_EXT_framebuffer_blit and GL_ARB_framebuffer_obbject. --- diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index eec8f1564b6..d08ad339026 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1367,16 +1367,31 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, struct gl_renderbuffer_attachment *att; struct gl_texture_object *texObj = NULL; struct gl_framebuffer *fb; + GLboolean error = GL_FALSE; ASSERT_OUTSIDE_BEGIN_END(ctx); - if (target != GL_FRAMEBUFFER_EXT) { + switch (target) { + case GL_READ_FRAMEBUFFER_EXT: + error = !ctx->Extensions.EXT_framebuffer_blit; + fb = ctx->ReadBuffer; + break; + case GL_DRAW_FRAMEBUFFER_EXT: + error = !ctx->Extensions.EXT_framebuffer_blit; + /* fall-through */ + case GL_FRAMEBUFFER_EXT: + fb = ctx->DrawBuffer; + break; + default: + error = GL_TRUE; + } + + if (error) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(target)", caller); + "glFramebufferTexture%sEXT(target=0x%x)", caller, target); return; } - fb = ctx->DrawBuffer; ASSERT(fb); /* check framebuffer binding */ @@ -1518,7 +1533,7 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, (textarget != GL_TEXTURE_RECTANGLE_ARB) && (!IS_CUBE_FACE(textarget))) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture2DEXT(textarget)"); + "glFramebufferTexture2DEXT(textarget=0x%x)", textarget); return; }