summaryrefslogtreecommitdiff
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index af5bd3781b..d94b65fb3a 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -957,6 +957,17 @@ texture_error_check( GLcontext *ctx, GLenum target,
}
}
+ /* For cube map, width must equal height */
+ if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
+ if (width != height) {
+ if (!isProxy) {
+ gl_error(ctx, GL_INVALID_VALUE, "glTexImage2D(width != height)");
+ }
+ return GL_TRUE;
+ }
+ }
+
/* Depth */
if (dimensions >= 3) {
if (depth < 2 * border || depth > 2 + ctx->Const.MaxTextureSize
@@ -1186,6 +1197,15 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions,
}
}
+ /* For cube map, width must equal height */
+ if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) {
+ if (width != height) {
+ gl_error(ctx, GL_INVALID_VALUE, "glCopyTexImage2D(width != height)");
+ return GL_TRUE;
+ }
+ }
+
/* Level */
if (level<0 || level>=ctx->Const.MaxTextureLevels) {
char message[100];