const struct gl_texture_object *texObj,
GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
- GLint width, GLint height, bool dsa)
+ GLint width, GLint height, const char *caller)
{
struct gl_texture_image *texImage;
- const char *suffix = dsa ? "ture" : "";
/* Check that the source buffer is complete */
if (_mesa_is_user_fbo(ctx->ReadBuffer)) {
}
if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
- "glCopyTex%sSubImage%dD(invalid readbuffer)",
- suffix, dimensions);
+ "%s(invalid readbuffer)", caller);
return GL_TRUE;
}
if (ctx->ReadBuffer->Visual.samples > 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTex%sSubImage%dD(multisample FBO)", suffix,
- dimensions);
+ "%s(multisample FBO)", caller);
return GL_TRUE;
}
}
/* Check level */
if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glCopyTex%sSubImage%dD(level=%d)", suffix,
- dimensions, level);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(level=%d)", caller, level);
return GL_TRUE;
}
/* Get dest image pointers */
if (!texObj) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTex%sSubImage%dD()",
- suffix, dimensions);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s()", caller);
return GL_TRUE;
}
if (!texImage) {
/* destination image does not exist */
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTex%sSubImage%dD(invalid texture image)",
- suffix, dimensions);
+ "%s(invalid texture image)", caller);
return GL_TRUE;
}
if (error_check_subtexture_dimensions(ctx, dimensions, texImage,
xoffset, yoffset, zoffset,
- width, height, 1, dsa ?
- "glCompressedTextureSubImage" :
- "glCompressedTexSubImage")) {
+ width, height, 1, caller)) {
return GL_TRUE;
}
if (_mesa_is_format_compressed(texImage->TexFormat)) {
if (compressedteximage_only_format(ctx, texImage->InternalFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTex%sSubImage%dD(no compression for format)",
- suffix, dimensions);
+ "%s(no compression for format)", caller);
return GL_TRUE;
}
}
if (texImage->InternalFormat == GL_YCBCR_MESA) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTex%sSubImage2D", suffix);
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s()", caller);
return GL_TRUE;
}
if (!_mesa_source_buffer_exists(ctx, texImage->_BaseFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTex%sSubImage%dD(missing readbuffer, format=0x%x)",
- suffix, dimensions, texImage->_BaseFormat);
+ "%s(missing readbuffer, format=0x%x)", caller,
+ texImage->_BaseFormat);
return GL_TRUE;
}
if (_mesa_is_format_integer_color(rb->Format) !=
_mesa_is_format_integer_color(texImage->TexFormat)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTex%sSubImage%dD(integer vs non-integer)",
- suffix, dimensions);
+ "%s(integer vs non-integer)", caller);
return GL_TRUE;
}
}
GLint xoffset, GLint yoffset, GLint zoffset,
GLint x, GLint y,
GLsizei width, GLsizei height,
- bool dsa)
+ const char *caller)
{
struct gl_texture_image *texImage;
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
- _mesa_debug(ctx, "glCopyTex%sSubImage%uD %s %d %d %d %d %d %d %d %d\n",
- dsa ? "ture" : "", dims,
+ _mesa_debug(ctx, "%s %s %d %d %d %d %d %d %d %d\n", caller,
_mesa_lookup_enum_by_nr(target),
level, xoffset, yoffset, zoffset, x, y, width, height);
if (copytexsubimage_error_check(ctx, dims, texObj, target, level,
xoffset, yoffset, zoffset,
- width, height, dsa)) {
+ width, height, caller)) {
return;
}
GLint xoffset, GLint x, GLint y, GLsizei width )
{
struct gl_texture_object* texObj;
+ const char *self = "glCopyTexSubImage1D";
GET_CURRENT_CONTEXT(ctx);
/* Check target (proxies not allowed). Target must be checked prior to
* calling _mesa_get_current_tex_object.
*/
if (!legal_texsubimage_target(ctx, 1, target, false)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glCopyTexSubImage1D(invalid target %s)",
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
_mesa_lookup_enum_by_nr(target));
return;
}
return;
_mesa_copy_texture_sub_image(ctx, 1, texObj, target, level, xoffset, 0, 0,
- x, y, width, 1, false);
+ x, y, width, 1, self);
}
GLint x, GLint y, GLsizei width, GLsizei height )
{
struct gl_texture_object* texObj;
+ const char *self = "glCopyTexSubImage2D";
GET_CURRENT_CONTEXT(ctx);
/* Check target (proxies not allowed). Target must be checked prior to
* calling _mesa_get_current_tex_object.
*/
if (!legal_texsubimage_target(ctx, 2, target, false)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glCopyTexSubImage2D(invalid target %s)",
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
_mesa_lookup_enum_by_nr(target));
return;
}
_mesa_copy_texture_sub_image(ctx, 2, texObj, target, level,
xoffset, yoffset, 0,
- x, y, width, height, false);
+ x, y, width, height, self);
}
GLint x, GLint y, GLsizei width, GLsizei height )
{
struct gl_texture_object* texObj;
+ const char *self = "glCopyTexSubImage3D";
GET_CURRENT_CONTEXT(ctx);
/* Check target (proxies not allowed). Target must be checked prior to
* calling _mesa_get_current_tex_object.
*/
if (!legal_texsubimage_target(ctx, 3, target, false)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glCopyTexSubImage3D(invalid target %s)",
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
_mesa_lookup_enum_by_nr(target));
return;
}
_mesa_copy_texture_sub_image(ctx, 3, texObj, target, level,
xoffset, yoffset, zoffset,
- x, y, width, height, false);
+ x, y, width, height, self);
}
void GLAPIENTRY
GLint xoffset, GLint x, GLint y, GLsizei width)
{
struct gl_texture_object* texObj;
+ const char *self = "glCopyTextureSubImage1D";
GET_CURRENT_CONTEXT(ctx);
- texObj = _mesa_lookup_texture_err(ctx, texture, "glCopyTextureSubImage1D");
+ texObj = _mesa_lookup_texture_err(ctx, texture, self);
if (!texObj)
return;
/* Check target (proxies not allowed). */
if (!legal_texsubimage_target(ctx, 1, texObj->Target, true)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glCopyTextureSubImage1D(invalid target %s)",
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
_mesa_lookup_enum_by_nr(texObj->Target));
return;
}
_mesa_copy_texture_sub_image(ctx, 1, texObj, texObj->Target, level,
- xoffset, 0, 0, x, y, width, 1, true);
+ xoffset, 0, 0, x, y, width, 1, self);
}
void GLAPIENTRY
GLint x, GLint y, GLsizei width, GLsizei height)
{
struct gl_texture_object* texObj;
+ const char *self = "glCopyTextureSubImage2D";
GET_CURRENT_CONTEXT(ctx);
- texObj = _mesa_lookup_texture_err(ctx, texture, "glCopyTextureSubImage2D");
+ texObj = _mesa_lookup_texture_err(ctx, texture, self);
if (!texObj)
return;
/* Check target (proxies not allowed). */
if (!legal_texsubimage_target(ctx, 2, texObj->Target, true)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glCopyTextureSubImage2D(invalid target %s)",
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
_mesa_lookup_enum_by_nr(texObj->Target));
return;
}
_mesa_copy_texture_sub_image(ctx, 2, texObj, texObj->Target, level,
xoffset, yoffset, 0,
- x, y, width, height, true);
+ x, y, width, height, self);
}
GLint x, GLint y, GLsizei width, GLsizei height)
{
struct gl_texture_object* texObj;
+ const char *self = "glCopyTextureSubImage3D";
GET_CURRENT_CONTEXT(ctx);
- texObj = _mesa_lookup_texture_err(ctx, texture, "glCopyTextureSubImage3D");
+ texObj = _mesa_lookup_texture_err(ctx, texture, self);
if (!texObj)
return;
/* Check target (proxies not allowed). */
if (!legal_texsubimage_target(ctx, 3, texObj->Target, true)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glCopyTextureSubImage3D(invalid target %s)",
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", self,
_mesa_lookup_enum_by_nr(texObj->Target));
return;
}
_mesa_copy_texture_sub_image(ctx, 3, texObj, texObj->Target, level,
xoffset, yoffset, zoffset,
- x, y, width, height, true);
+ x, y, width, height, self);
}
static bool