_mesa_is_enum_format_unsigned_int(internalFormat) !=
_mesa_is_enum_format_unsigned_int(rb_internal_format)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexImage%dD(signed vs unsigned integer)", dimensions);
+ "glCopyTexImage%dD(signed vs unsigned integer)",
+ dimensions);
return GL_TRUE;
}
}
/* see if we've already chosen a format for the previous level */
if (level > 0) {
struct gl_texture_image *prevImage =
- _mesa_select_tex_image(texObj, target, level - 1);
+ _mesa_select_tex_image(texObj, target, level - 1);
/* See if the prev level is defined and has an internal format which
* matches the new internal format.
*/
* rarely-tested software fallback rendering.
*/
if (border && ctx->Const.StripTextureBorder) {
- strip_texture_border(target, &width, &height, &depth, unpack,
- &unpack_no_border);
+ strip_texture_border(target, &width, &height, &depth, unpack,
+ &unpack_no_border);
border = 0;
- unpack = &unpack_no_border;
+ unpack = &unpack_no_border;
}
if (ctx->NewState & _NEW_PIXEL)
- _mesa_update_state(ctx);
+ _mesa_update_state(ctx);
_mesa_lock_texture(ctx, texObj);
{
- texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
- if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s%uD", func, dims);
- }
+ if (!texImage) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s%uD", func, dims);
+ }
else {
ctx->Driver.FreeTextureImageBuffer(ctx, texImage);
}
}
+
/* This is a wrapper around teximage() so that we can force the KHR_no_error
* logic to be inlined without inlining the function into all the callers.
*/
ctx->Driver.FreeTextureImageBuffer(ctx, texImage);
ctx->Driver.EGLImageTargetTexture2D(ctx, target,
- texObj, texImage, image);
+ texObj, texImage, image);
_mesa_dirty_texobj(ctx, texObj);
}
}
}
+
static void
copytexsubimage_by_slice(struct gl_context *ctx,
struct gl_texture_image *texImage,
}
}
+
static GLboolean
formats_differ_in_component_sizes(mesa_format f1, mesa_format f2)
{
x += border;
width -= border * 2;
if (dims == 2) {
- y += border;
- height -= border * 2;
+ y += border;
+ height -= border * 2;
}
border = 0;
}
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
if (!texImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
}
else {
GLint srcX = x, srcY = y, dstX = 0, dstY = 0, dstZ = 0;
border, false);
}
+
static void
copyteximage_no_error(struct gl_context *ctx, GLuint dims, GLenum target,
GLint level, GLenum internalFormat, GLint x, GLint y,
}
-
void GLAPIENTRY
_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
GLint x, GLint y, GLsizei width, GLsizei height,
void GLAPIENTRY
-_mesa_CopyTexSubImage1D( GLenum target, GLint level,
- GLint xoffset, GLint x, GLint y, GLsizei width )
+_mesa_CopyTexSubImage1D(GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y, GLsizei width)
{
struct gl_texture_object* texObj;
const char *self = "glCopyTexSubImage1D";
x, y, width, 1, self);
}
+
void GLAPIENTRY
-_mesa_CopyTexSubImage2D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
+_mesa_CopyTexSubImage2D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
{
struct gl_texture_object* texObj;
const char *self = "glCopyTexSubImage2D";
}
-
void GLAPIENTRY
-_mesa_CopyTexSubImage3D( GLenum target, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLint x, GLint y, GLsizei width, GLsizei height )
+_mesa_CopyTexSubImage3D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height)
{
struct gl_texture_object* texObj;
const char *self = "glCopyTexSubImage3D";
zoffset, x, y, width, height, self);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage1D(GLuint texture, GLint level,
GLint xoffset, GLint x, GLint y, GLsizei width)
0, x, y, width, 1, self);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage2D(GLuint texture, GLint level,
GLint xoffset, GLint yoffset,
}
-
void GLAPIENTRY
_mesa_CopyTextureSubImage3D(GLuint texture, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
x, y, width, 1);
}
+
void GLAPIENTRY
_mesa_CopyTexSubImage2D_no_error(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint x, GLint y, GLsizei width,
yoffset, 0, x, y, width, height);
}
+
void GLAPIENTRY
_mesa_CopyTexSubImage3D_no_error(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLint x, GLint y,
yoffset, zoffset, x, y, width, height);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset,
GLint x, GLint y, GLsizei width)
xoffset, 0, 0, x, y, width, 1);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage2D_no_error(GLuint texture, GLint level, GLint xoffset,
GLint yoffset, GLint x, GLint y,
xoffset, yoffset, 0, x, y, width, height);
}
+
void GLAPIENTRY
_mesa_CopyTextureSubImage3D_no_error(GLuint texture, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLint x,
return true;
}
+
static struct gl_texture_object *
get_tex_obj_for_clear(struct gl_context *ctx,
const char *function,
return numFaces;
}
+
void GLAPIENTRY
-_mesa_ClearTexSubImage( GLuint texture, GLint level,
- GLint xoffset, GLint yoffset, GLint zoffset,
- GLsizei width, GLsizei height, GLsizei depth,
- GLenum format, GLenum type, const void *data )
+_mesa_ClearTexSubImage(GLuint texture, GLint level,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type, const void *data)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_object *texObj;
}
if (numImages == 1) {
- if (check_clear_tex_image(ctx, "glClearTexSubImage",
- texImages[0],
+ if (check_clear_tex_image(ctx, "glClearTexSubImage", texImages[0],
format, type, data, clearValue[0])) {
ctx->Driver.ClearTexSubImage(ctx,
texImages[0],
/* loop over cube face images */
for (i = zoffset; i < zoffset + depth; i++) {
assert(i < MAX_FACES);
- if (!check_clear_tex_image(ctx, "glClearTexSubImage",
- texImages[i],
+ if (!check_clear_tex_image(ctx, "glClearTexSubImage", texImages[i],
format, type, data, clearValue[i]))
goto out;
}
_mesa_unlock_texture(ctx, texObj);
}
+
void GLAPIENTRY
_mesa_ClearTexImage( GLuint texture, GLint level,
GLenum format, GLenum type, const void *data )
texObj, level, texImages);
for (i = 0; i < numImages; i++) {
- if (!check_clear_tex_image(ctx, "glClearTexImage",
- texImages[i],
- format, type, data,
- clearValue[i]))
+ if (!check_clear_tex_image(ctx, "glClearTexImage", texImages[i], format,
+ type, data, clearValue[i]))
goto out;
}
/* this will catch any invalid compressed format token */
if (!_mesa_is_compressed_format(ctx, format)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "%s(format)", callerName);
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(format)", callerName);
return GL_TRUE;
}
if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "%s(level=%d)",
- callerName, level);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(level=%d)", callerName, level);
return GL_TRUE;
}
expectedSize = compressed_tex_size(width, height, depth, format);
if (expectedSize != imageSize) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "%s(size=%d)",
- callerName, imageSize);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(size=%d)", callerName, imageSize);
return GL_TRUE;
}
}
if ((GLint) format != texImage->InternalFormat) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(format=%s)",
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s)",
callerName, _mesa_enum_to_string(format));
return GL_TRUE;
}
if (compressedteximage_only_format(ctx, format)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(format=%s cannot be updated)",
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s cannot be updated)",
callerName, _mesa_enum_to_string(format));
return GL_TRUE;
}
- if (error_check_subtexture_negative_dimensions(ctx, dims,
- width, height, depth,
- callerName)) {
+ if (error_check_subtexture_negative_dimensions(ctx, dims, width, height,
+ depth, callerName)) {
return GL_TRUE;
}
- if (error_check_subtexture_dimensions(ctx, dims,
- texImage, xoffset, yoffset, zoffset,
- width, height, depth,
+ if (error_check_subtexture_dimensions(ctx, dims, texImage, xoffset, yoffset,
+ zoffset, width, height, depth,
callerName)) {
return GL_TRUE;
}