#include "framebuffer.h"
#include "hash.h"
#include "image.h"
-#include "util/imports.h"
+
#include "macros.h"
#include "mipmap.h"
#include "multisample.h"
return 1;
}
- return _mesa_logbase2(size) + 1;
+ return util_logbase2(size) + 1;
}
img->Depth = depth;
img->Width2 = width - 2 * border; /* == 1 << img->WidthLog2; */
- img->WidthLog2 = _mesa_logbase2(img->Width2);
+ img->WidthLog2 = util_logbase2(img->Width2);
switch(target) {
case GL_TEXTURE_1D:
case GL_TEXTURE_2D_MULTISAMPLE:
case GL_PROXY_TEXTURE_2D_MULTISAMPLE:
img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
- img->HeightLog2 = _mesa_logbase2(img->Height2);
+ img->HeightLog2 = util_logbase2(img->Height2);
if (depth == 0)
img->Depth2 = 0;
else
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:
img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
- img->HeightLog2 = _mesa_logbase2(img->Height2);
+ img->HeightLog2 = util_logbase2(img->Height2);
img->Depth2 = depth; /* no border */
img->DepthLog2 = 0; /* not used */
break;
case GL_TEXTURE_3D:
case GL_PROXY_TEXTURE_3D:
img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
- img->HeightLog2 = _mesa_logbase2(img->Height2);
+ img->HeightLog2 = util_logbase2(img->Height2);
img->Depth2 = depth - 2 * border; /* == 1 << img->DepthLog2; */
- img->DepthLog2 = _mesa_logbase2(img->Depth2);
+ img->DepthLog2 = util_logbase2(img->Depth2);
break;
default:
_mesa_problem(NULL, "invalid target 0x%x in _mesa_init_teximage_fields()",
if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;
if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ if (width > 0 && !util_is_power_of_two_nonzero(width - 2 * border))
return GL_FALSE;
}
return GL_TRUE;
if (height < 2 * border || height > 2 * border + maxSize)
return GL_FALSE;
if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ if (width > 0 && !util_is_power_of_two_nonzero(width - 2 * border))
return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ if (height > 0 && !util_is_power_of_two_nonzero(height - 2 * border))
return GL_FALSE;
}
return GL_TRUE;
if (depth < 2 * border || depth > 2 * border + maxSize)
return GL_FALSE;
if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ if (width > 0 && !util_is_power_of_two_nonzero(width - 2 * border))
return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ if (height > 0 && !util_is_power_of_two_nonzero(height - 2 * border))
return GL_FALSE;
- if (depth > 0 && !_mesa_is_pow_two(depth - 2 * border))
+ if (depth > 0 && !util_is_power_of_two_nonzero(depth - 2 * border))
return GL_FALSE;
}
return GL_TRUE;
if (height < 2 * border || height > 2 * border + maxSize)
return GL_FALSE;
if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ if (width > 0 && !util_is_power_of_two_nonzero(width - 2 * border))
return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ if (height > 0 && !util_is_power_of_two_nonzero(height - 2 * border))
return GL_FALSE;
}
return GL_TRUE;
if (height < 0 || height > ctx->Const.MaxArrayTextureLayers)
return GL_FALSE;
if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ if (width > 0 && !util_is_power_of_two_nonzero(width - 2 * border))
return GL_FALSE;
}
return GL_TRUE;
if (depth < 0 || depth > ctx->Const.MaxArrayTextureLayers)
return GL_FALSE;
if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ if (width > 0 && !util_is_power_of_two_nonzero(width - 2 * border))
return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ if (height > 0 && !util_is_power_of_two_nonzero(height - 2 * border))
return GL_FALSE;
}
return GL_TRUE;
if (level >= ctx->Const.MaxCubeTextureLevels)
return GL_FALSE;
if (!ctx->Extensions.ARB_texture_non_power_of_two) {
- if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
+ if (width > 0 && !util_is_power_of_two_nonzero(width - 2 * border))
return GL_FALSE;
- if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
+ if (height > 0 && !util_is_power_of_two_nonzero(height - 2 * border))
return GL_FALSE;
}
return GL_TRUE;
* requires GL_OES_texture_float) are filtered elsewhere.
*/
char bufCallerName[20];
- _mesa_snprintf(bufCallerName, 20, "glTexImage%dD", dimensions);
+ snprintf(bufCallerName, 20, "glTexImage%dD", dimensions);
if (_mesa_is_gles(ctx) &&
texture_format_error_check_gles(ctx, format, type,
internalFormat, bufCallerName)) {
if (type != GL_UNSIGNED_SHORT_8_8_MESA &&
type != GL_UNSIGNED_SHORT_8_8_REV_MESA) {
char message[100];
- _mesa_snprintf(message, sizeof(message),
+ snprintf(message, sizeof(message),
"glTexImage%dD(format/type YCBCR mismatch)",
dimensions);
_mesa_error(ctx, GL_INVALID_ENUM, "%s", message);
}
if (border != 0) {
char message[100];
- _mesa_snprintf(message, sizeof(message),
+ snprintf(message, sizeof(message),
"glTexImage%dD(format=GL_YCBCR_MESA and border=%d)",
dimensions, border);
_mesa_error(ctx, GL_INVALID_VALUE, "%s", message);