summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-05-30 00:27:24 +0000
committerBrian Paul <[email protected]>2000-05-30 00:27:24 +0000
commitad817704fa2c6d8449f55565f07ab5592a574fb6 (patch)
tree2699c808dc59b8e7335cad2c19cbf38a96826bd2 /src/mesa/main/teximage.c
parenteed6f691991ed0d64752fa712c83f67eb700b9ad (diff)
more work on GL_ARB_texture_cube_map
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 af5bd3781b0..d94b65fb3a7 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];