From d1dc5b124e133379be5bb57b68733c09c0e04f71 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 11 Feb 2010 17:42:30 -0500 Subject: core: Implement GL_OES_EGL_image entry points --- src/mesa/main/fbobject.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/mesa/main/fbobject.c') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 04ea3b4ed7..8fbe0830c7 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1008,6 +1008,30 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, */ } +#if FEATURE_OES_EGL_image +void GLAPIENTRY +_mesa_EGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + struct gl_renderbuffer *rb; + + if (target != GL_RENDERBUFFER) { + _mesa_error(ctx, GL_INVALID_ENUM, "EGLImageTargetRenderbufferStorageOES"); + return; + } + + rb = ctx->CurrentRenderbuffer; + if (!rb) { + _mesa_error(ctx, GL_INVALID_OPERATION, "EGLImageTargetRenderbufferStorageOES"); + return; + } + + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + ctx->Driver.EGLImageTargetRenderbufferStorage(ctx, rb, image); +} +#endif /** * Helper function for _mesa_GetRenderbufferParameterivEXT() and -- cgit v1.2.3 From 51b799288a405be3f4cdbfc7221221399512992a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 11:57:26 -0700 Subject: mesa: put declaration before code --- src/mesa/main/fbobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main/fbobject.c') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 8fbe0830c7..4ce3998812 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1012,9 +1012,9 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, void GLAPIENTRY _mesa_EGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image) { + struct gl_renderbuffer *rb; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - struct gl_renderbuffer *rb; if (target != GL_RENDERBUFFER) { _mesa_error(ctx, GL_INVALID_ENUM, "EGLImageTargetRenderbufferStorageOES"); -- cgit v1.2.3 From a8dafe713f4b45fd09c678e1ca9fbe4eab16f8be Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:03:55 -0700 Subject: mesa: remove redundant call to _mesa_base_fbo_format() --- src/mesa/main/fbobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main/fbobject.c') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 4ce3998812..14c533e0d4 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -987,7 +987,7 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, assert(rb->Width == (GLuint) width); assert(rb->Height == (GLuint) height); rb->InternalFormat = internalFormat; - rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + rb->_BaseFormat = baseFormat; assert(rb->_BaseFormat != 0); } else { -- cgit v1.2.3 From 7a2e32d68494b82813ea6a07bb62d1c21202cad1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 10 Mar 2010 10:54:24 -0700 Subject: mesa: raise an error when trying to bind non-existant texture to FBO If the user calls glRenderBufferTexture(texture=N) but texture N doesn't name an existing texture, raise GL_INVALID_ENUM. Plus, add a comment about some questionable error checking code in framebuffer_texture(). Ian? --- src/mesa/main/fbobject.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mesa/main/fbobject.c') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 14c533e0d4..7c442e390c 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1549,6 +1549,7 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, texObj = _mesa_lookup_texture(ctx, texture); if (texObj != NULL) { if (textarget == 0) { + /* XXX what's the purpose of this? */ err = (texObj->Target != GL_TEXTURE_3D) && (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) && (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT); @@ -1559,6 +1560,13 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, : (texObj->Target != textarget); } } + else { + /* can't render to a non-existant texture */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTexture%sEXT(non existant texture)", + caller); + return; + } if (err) { _mesa_error(ctx, GL_INVALID_OPERATION, -- cgit v1.2.3