summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaura Ekstrand <[email protected]>2015-04-20 17:21:20 +0200
committerEmil Velikov <[email protected]>2015-05-20 22:09:20 +0100
commit0475deac263f6af527bda376b39c29fc839c5d1d (patch)
tree502327556b74cafc9e2cfe29e77b67211ac7540d /src
parent7f7e74b5360b9ee876743ff7a2046fab90aacf29 (diff)
main: Fix an error generated by FramebufferTexture
gl*FramebufferTexture should generate GL_INVALID_VALUE when the texture doesn't exist. [Fredrik: Split this change out from the next commit] Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]> (cherry picked from commit 69bdc9dcb8e5d3648e8d96029d5988b8971de8dc)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/fbobject.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 7e2d0cae7e6..0507b162c4c 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2438,10 +2438,19 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
}
}
else {
- /* can't render to a non-existant texture */
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glFramebufferTexture%s(non existant texture)",
- caller);
+ /* Can't render to a non-existent texture object.
+ *
+ * The OpenGL 4.5 core spec (02.02.2015) in Section 9.2 Binding and
+ * Managing Framebuffer Objects specifies a different error
+ * depending upon the calling function (PDF pages 325-328).
+ * *FramebufferTexture (where layered = GL_TRUE) throws invalid
+ * value, while the other commands throw invalid operation (where
+ * layered = GL_FALSE).
+ */
+ const GLenum error = layered ? GL_INVALID_VALUE :
+ GL_INVALID_OPERATION;
+ _mesa_error(ctx, error,
+ "%s(non-existent texture %u)", caller, texture);
return;
}