summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-01-29 15:01:09 -0700
committerBrian Paul <brianp@vmware.com>2009-01-29 15:01:09 -0700
commit5fec84ad0446d4d6d842f5cf740f9787678113be (patch)
treecc95dcaa730bd10f8fa0d26114ec3d61fc3b9982 /src/mesa/main
parent5c38801f8e36fdb4a16ed33c26454b98f3519465 (diff)
mesa: allow glFramebufferTexture1/2/3D(target = GL_READ/DRAW_FRAMEBUFFER)
This is part of GL_EXT_framebuffer_blit and GL_ARB_framebuffer_obbject.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/fbobject.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index eec8f1564b..d08ad33902 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;
}