-/* $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
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]);
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]);
}
-
/*
* Called by the API or display list executor.
* Note that width and height include the border.
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]);
}
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]);
}
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]);
}
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]);