summaryrefslogtreecommitdiff
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-03-10 10:54:24 -0700
committerBrian Paul <brianp@vmware.com>2010-03-10 10:54:29 -0700
commit7a2e32d68494b82813ea6a07bb62d1c21202cad1 (patch)
tree46e13ee4b6b01bad20b12817257257c70444305b /src/mesa/main/fbobject.c
parentb318039e9a790d9d90bd524c79af2d9a444d0093 (diff)
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?
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c8
1 files changed, 8 insertions, 0 deletions
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,