summaryrefslogtreecommitdiffstats
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.c69
1 files changed, 52 insertions, 17 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index b24344d85cd..6f14c1974bf 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.49 2000/09/06 15:15:43 brianp Exp $ */
+/* $Id: teximage.c,v 1.50 2000/09/07 15:38:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1701,10 +1701,16 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
gl_put_texobj_on_dirty_list( ctx, texObj );
ctx->NewState |= NEW_TEXTURING;
}
- else if (target==GL_PROXY_TEXTURE_1D) {
+ else if (target == GL_PROXY_TEXTURE_1D) {
/* Proxy texture: check for errors and update proxy state */
- if (texture_error_check(ctx, target, level, internalFormat,
- format, type, 1, postConvWidth, 1, 1, border)) {
+ GLenum error = texture_error_check(ctx, target, level, internalFormat,
+ format, type, 1, width, 1, 1, border);
+ if (!error && ctx->Driver.TestProxyTexImage) {
+ error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
+ internalFormat, format, type,
+ width, 1, 1, border);
+ }
+ if (error) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
clear_proxy_teximage(ctx->Texture.Proxy1D->Image[level]);
@@ -1840,10 +1846,16 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
gl_put_texobj_on_dirty_list( ctx, texObj );
ctx->NewState |= NEW_TEXTURING;
}
- else if (target==GL_PROXY_TEXTURE_2D) {
+ else if (target == GL_PROXY_TEXTURE_2D) {
/* Proxy texture: check for errors and update proxy state */
- if (texture_error_check(ctx, target, level, internalFormat,
- format, type, 2, postConvWidth, height, 1, border)) {
+ GLenum error = texture_error_check(ctx, target, level, internalFormat,
+ format, type, 2, width, height, 1, border);
+ if (!error && ctx->Driver.TestProxyTexImage) {
+ error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
+ internalFormat, format, type,
+ width, height, 1, border);
+ }
+ if (error) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
clear_proxy_teximage(ctx->Texture.Proxy2D->Image[level]);
@@ -1863,7 +1875,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
}
-
/*
* Called by the API or display list executor.
* Note that width and height include the border.
@@ -1966,10 +1977,16 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
gl_put_texobj_on_dirty_list( ctx, texObj );
ctx->NewState |= NEW_TEXTURING;
}
- else if (target==GL_PROXY_TEXTURE_3D) {
+ else if (target == GL_PROXY_TEXTURE_3D) {
/* Proxy texture: check for errors and update proxy state */
- if (texture_error_check(ctx, target, level, internalFormat,
- format, type, 3, width, height, depth, border)) {
+ GLenum error = texture_error_check(ctx, target, level, internalFormat,
+ format, type, 3, width, height, depth, border);
+ if (!error && ctx->Driver.TestProxyTexImage) {
+ error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
+ internalFormat, format, type,
+ width, height, depth, border);
+ }
+ if (error) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
clear_proxy_teximage(ctx->Texture.Proxy3D->Image[level]);
@@ -2904,8 +2921,14 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
}
else if (target == GL_PROXY_TEXTURE_1D) {
/* Proxy texture: check for errors and update proxy state */
- if (texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 1, width, 1, 1, border)) {
+ GLenum error = texture_error_check(ctx, target, level, internalFormat,
+ GL_NONE, GL_NONE, 1, width, 1, 1, border);
+ if (!error && ctx->Driver.TestProxyTexImage) {
+ error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
+ internalFormat, GL_NONE, GL_NONE,
+ width, 1, 1, border);
+ }
+ if (error) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
clear_proxy_teximage(ctx->Texture.Proxy1D->Image[level]);
@@ -3033,8 +3056,14 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
}
else if (target == GL_PROXY_TEXTURE_2D) {
/* Proxy texture: check for errors and update proxy state */
- if (texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 1, width, 1, 1, border)) {
+ GLenum error = texture_error_check(ctx, target, level, internalFormat,
+ GL_NONE, GL_NONE, 2, width, height, 1, border);
+ if (!error && ctx->Driver.TestProxyTexImage) {
+ error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
+ internalFormat, GL_NONE, GL_NONE,
+ width, height, 1, border);
+ }
+ if (error) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
clear_proxy_teximage(ctx->Texture.Proxy2D->Image[level]);
@@ -3156,8 +3185,14 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
}
else if (target == GL_PROXY_TEXTURE_3D) {
/* Proxy texture: check for errors and update proxy state */
- if (texture_error_check(ctx, target, level, internalFormat,
- GL_NONE, GL_NONE, 1, width, height, depth, border)) {
+ GLenum error = texture_error_check(ctx, target, level, internalFormat,
+ GL_NONE, GL_NONE, 1, width, height, depth, border);
+ if (!error && ctx->Driver.TestProxyTexImage) {
+ error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
+ internalFormat, GL_NONE, GL_NONE,
+ width, height, depth, border);
+ }
+ if (error) {
/* if error, clear all proxy texture image parameters */
if (level>=0 && level<ctx->Const.MaxTextureLevels) {
clear_proxy_teximage(ctx->Texture.Proxy3D->Image[level]);