GLint depth, GLint border )
{
const GLboolean isProxy = _mesa_is_proxy_texture(target);
- GLboolean sizeOK;
+ GLboolean sizeOK = GL_TRUE;
GLboolean colorFormat, indexFormat;
+ GLenum proxy_target;
/* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */
if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
*/
if (dimensions == 1) {
if (target == GL_PROXY_TEXTURE_1D || target == GL_TEXTURE_1D) {
- sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_1D,
- level, internalFormat,
- format, type,
- width, 1, 1, border);
+ proxy_target = GL_PROXY_TEXTURE_1D;
+ height = 1;
+ width = 1;
}
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexImage1D(target)" );
}
}
else if (dimensions == 2) {
+ depth = 1;
if (target == GL_PROXY_TEXTURE_2D || target == GL_TEXTURE_2D) {
- sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_2D,
- level, internalFormat,
- format, type,
- width, height, 1, border);
+ proxy_target = GL_PROXY_TEXTURE_2D;
}
else if (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB ||
(target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
_mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)");
return GL_TRUE;
}
- sizeOK = (width == height) &&
- ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_CUBE_MAP_ARB,
- level, internalFormat, format, type,
- width, height, 1, border);
+ proxy_target = GL_PROXY_TEXTURE_CUBE_MAP_ARB;
+ sizeOK = (width == height);
}
else if (target == GL_PROXY_TEXTURE_RECTANGLE_NV ||
target == GL_TEXTURE_RECTANGLE_NV) {
_mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)");
return GL_TRUE;
}
- sizeOK = ctx->Driver.TestProxyTexImage(ctx,
- GL_PROXY_TEXTURE_RECTANGLE_NV,
- level, internalFormat,
- format, type,
- width, height, 1, border);
+ proxy_target = GL_PROXY_TEXTURE_RECTANGLE_NV;
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glTexImage2D(target)");
}
else if (dimensions == 3) {
if (target == GL_PROXY_TEXTURE_3D || target == GL_TEXTURE_3D) {
- sizeOK = ctx->Driver.TestProxyTexImage(ctx, GL_PROXY_TEXTURE_3D,
- level, internalFormat,
- format, type,
- width, height, depth, border);
+ proxy_target = GL_PROXY_TEXTURE_3D;
}
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexImage3D(target)" );
return GL_TRUE;
}
+ sizeOK = sizeOK && ctx->Driver.TestProxyTexImage(ctx, proxy_target, level,
+ internalFormat, format,
+ type, width, height,
+ depth, border);
if (!sizeOK) {
if (!isProxy) {
_mesa_error(ctx, GL_INVALID_VALUE,