summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2015-02-04 14:21:17 -0800
committerEmil Velikov <emil.l.velikov@gmail.com>2015-05-20 22:09:51 +0100
commit104dc7447d66fb0006b40e8f8fc4664a7a1216e5 (patch)
treebf5e60a27ce286fad128604936d8773902b2d80f
parent0475deac263f6af527bda376b39c29fc839c5d1d (diff)
downloadmesa-104dc7447d66fb0006b40e8f8fc4664a7a1216e5.tar.gz
main: Complete error conditions for glInvalidate*Framebuffer.
Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org> (cherry picked from commit b4368ac09db75cea412121ada6c12af1414feb50)
-rw-r--r--src/mesa/main/fbobject.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 0507b162c4c..d3647fd5dcd 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3083,12 +3083,29 @@ invalidate_framebuffer_storage(GLenum target, GLsizei numAttachments,
return;
}
+ /* Section 17.4 Whole Framebuffer Operations of the OpenGL 4.5 Core
+ * Spec (2.2.2015, PDF page 522) says:
+ * "An INVALID_VALUE error is generated if numAttachments, width, or
+ * height is negative."
+ */
if (numAttachments < 0) {
_mesa_error(ctx, GL_INVALID_VALUE,
"%s(numAttachments < 0)", name);
return;
}
+ if (width < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "%s(width < 0)", name);
+ return;
+ }
+
+ if (height < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "%s(height < 0)", name);
+ return;
+ }
+
/* The GL_ARB_invalidate_subdata spec says:
*
* "If an attachment is specified that does not exist in the
@@ -3181,7 +3198,8 @@ invalidate_framebuffer_storage(GLenum target, GLsizei numAttachments,
return;
invalid_enum:
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(attachment)", name);
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid attachment %s)", name,
+ _mesa_lookup_enum_by_nr(attachments[i]));
return;
}