fixes for proxy cube map texture images
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 26 Jul 2001 20:02:10 +0000 (20:02 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 26 Jul 2001 20:02:10 +0000 (20:02 +0000)
src/mesa/main/context.c
src/mesa/main/teximage.c

index 4f2718140deedbecf889ba8a08549edbf1d40f72..7576c8bc2c025abcab4fce56712d87af20ec9010 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.145 2001/07/19 15:54:34 brianp Exp $ */
+/* $Id: context.c,v 1.146 2001/07/26 20:02:10 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -1351,9 +1351,11 @@ alloc_proxy_textures( GLcontext *ctx )
       ctx->Texture.Proxy1D->Image[i] = _mesa_alloc_texture_image();
       ctx->Texture.Proxy2D->Image[i] = _mesa_alloc_texture_image();
       ctx->Texture.Proxy3D->Image[i] = _mesa_alloc_texture_image();
+      ctx->Texture.ProxyCubeMap->Image[i] = _mesa_alloc_texture_image();
       if (!ctx->Texture.Proxy1D->Image[i]
           || !ctx->Texture.Proxy2D->Image[i]
-          || !ctx->Texture.Proxy3D->Image[i]) {
+          || !ctx->Texture.Proxy3D->Image[i]
+          || !ctx->Texture.ProxyCubeMap->Image[i]) {
          out_of_memory = GL_TRUE;
       }
    }
@@ -1368,10 +1370,14 @@ alloc_proxy_textures( GLcontext *ctx )
          if (ctx->Texture.Proxy3D->Image[i]) {
             _mesa_free_texture_image(ctx->Texture.Proxy3D->Image[i]);
          }
+         if (ctx->Texture.ProxyCubeMap->Image[i]) {
+            _mesa_free_texture_image(ctx->Texture.ProxyCubeMap->Image[i]);
+         }
       }
       _mesa_free_texture_object(NULL, ctx->Texture.Proxy1D);
       _mesa_free_texture_object(NULL, ctx->Texture.Proxy2D);
       _mesa_free_texture_object(NULL, ctx->Texture.Proxy3D);
+      _mesa_free_texture_object(NULL, ctx->Texture.ProxyCubeMap);
       return GL_FALSE;
    }
    else {
index c856f331d95726ed90ac1809b56cda9bd1d4f8c5..4206062b136f01df3a1bb80d732e4f902a36ac69 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.102 2001/07/23 16:18:18 brianp Exp $ */
+/* $Id: teximage.c,v 1.103 2001/07/26 20:02:10 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -1525,7 +1525,9 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
       texObj->Complete = GL_FALSE;
       ctx->NewState |= _NEW_TEXTURE;
    }
-   else if (target == GL_PROXY_TEXTURE_2D) {
+   else if (target == GL_PROXY_TEXTURE_2D ||
+            (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB &&
+             ctx->Extensions.ARB_texture_cube_map)) {
       /* Proxy texture: check for errors and update proxy state */
       GLenum error = texture_error_check(ctx, target, level, internalFormat,
                                format, type, 2,