mesa: consolidate assertions in teximage code
This commit is contained in:
@@ -2276,6 +2276,7 @@ _mesa_choose_texture_format(struct gl_context *ctx,
|
|||||||
prevImage->InternalFormat == internalFormat) {
|
prevImage->InternalFormat == internalFormat) {
|
||||||
/* use the same format */
|
/* use the same format */
|
||||||
texImage->TexFormat = prevImage->TexFormat;
|
texImage->TexFormat = prevImage->TexFormat;
|
||||||
|
ASSERT(texImage->TexFormat != MESA_FORMAT_NONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2350,8 +2351,6 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
|
|||||||
width, border, format, type, pixels,
|
width, border, format, type, pixels,
|
||||||
&ctx->Unpack, texObj, texImage);
|
&ctx->Unpack, texObj, texImage);
|
||||||
|
|
||||||
ASSERT(texImage->TexFormat);
|
|
||||||
|
|
||||||
_mesa_set_fetch_functions(texImage, 1);
|
_mesa_set_fetch_functions(texImage, 1);
|
||||||
|
|
||||||
check_gen_mipmap(ctx, target, texObj, level);
|
check_gen_mipmap(ctx, target, texObj, level);
|
||||||
@@ -2460,8 +2459,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
|
|||||||
width, height, border, format, type,
|
width, height, border, format, type,
|
||||||
pixels, &ctx->Unpack, texObj, texImage);
|
pixels, &ctx->Unpack, texObj, texImage);
|
||||||
|
|
||||||
ASSERT(texImage->TexFormat);
|
|
||||||
|
|
||||||
_mesa_set_fetch_functions(texImage, 2);
|
_mesa_set_fetch_functions(texImage, 2);
|
||||||
|
|
||||||
check_gen_mipmap(ctx, target, texObj, level);
|
check_gen_mipmap(ctx, target, texObj, level);
|
||||||
@@ -2574,8 +2571,6 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
|
|||||||
width, height, depth, border, format, type,
|
width, height, depth, border, format, type,
|
||||||
pixels, &ctx->Unpack, texObj, texImage);
|
pixels, &ctx->Unpack, texObj, texImage);
|
||||||
|
|
||||||
ASSERT(texImage->TexFormat);
|
|
||||||
|
|
||||||
_mesa_set_fetch_functions(texImage, 3);
|
_mesa_set_fetch_functions(texImage, 3);
|
||||||
|
|
||||||
check_gen_mipmap(ctx, target, texObj, level);
|
check_gen_mipmap(ctx, target, texObj, level);
|
||||||
@@ -2902,8 +2897,6 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
|
|||||||
ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat,
|
ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat,
|
||||||
x, y, width, border);
|
x, y, width, border);
|
||||||
|
|
||||||
ASSERT(texImage->TexFormat);
|
|
||||||
|
|
||||||
_mesa_set_fetch_functions(texImage, 1);
|
_mesa_set_fetch_functions(texImage, 1);
|
||||||
|
|
||||||
check_gen_mipmap(ctx, target, texObj, level);
|
check_gen_mipmap(ctx, target, texObj, level);
|
||||||
@@ -2972,8 +2965,6 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
|
|||||||
ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat,
|
ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat,
|
||||||
x, y, width, height, border);
|
x, y, width, height, border);
|
||||||
|
|
||||||
ASSERT(texImage->TexFormat);
|
|
||||||
|
|
||||||
_mesa_set_fetch_functions(texImage, 2);
|
_mesa_set_fetch_functions(texImage, 2);
|
||||||
|
|
||||||
check_gen_mipmap(ctx, target, texObj, level);
|
check_gen_mipmap(ctx, target, texObj, level);
|
||||||
|
Reference in New Issue
Block a user