summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorFredrik Höglund <[email protected]>2015-05-09 15:31:45 +0200
committerFredrik Höglund <[email protected]>2015-05-14 15:48:12 +0200
commit8ba7ad8abc7d71131e17970203c991ccb1befbe6 (patch)
tree6bacefe9d0efebc4e64190513ccda743d9d3c0ab /src/mesa/main
parentf9f5c822845698482d0d81eaa64bc13c2fd8852a (diff)
mesa: Generate GL_INVALID_VALUE in framebuffer_texture when layer < 0
Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/fbobject.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 4524e51e4c0..20a4e86007c 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2668,6 +2668,18 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
return;
}
+ /* Page 306 (page 328 of the PDF) of the OpenGL 4.5 (Core Profile)
+ * spec says:
+ *
+ * "An INVALID_VALUE error is generated if texture is non-zero
+ * and layer is negative."
+ */
+ if (zoffset < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glFramebufferTexture%s(layer %u < 0)", caller, zoffset);
+ return;
+ }
+
if (texObj->Target == GL_TEXTURE_3D) {
const GLuint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
if (zoffset >= maxSize) {