From: Brian Paul Date: Tue, 5 Sep 2017 19:03:45 +0000 (-0600) Subject: mesa: whitespace, formatting fixes in teximage.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=832990c0cebb1db8749d9d935390ffb0079dc924;p=mesa.git mesa: whitespace, formatting fixes in teximage.c Reviewed-by: Eric Anholt --- diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 32ca172d47c..d0642051909 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2444,7 +2444,8 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, _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; } } @@ -2755,7 +2756,7 @@ _mesa_choose_texture_format(struct gl_context *ctx, /* 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. */ @@ -3025,22 +3026,22 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims, * 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); @@ -3071,6 +3072,7 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims, } } + /* 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. */ @@ -3242,7 +3244,7 @@ _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) ctx->Driver.FreeTextureImageBuffer(ctx, texImage); ctx->Driver.EGLImageTargetTexture2D(ctx, target, - texObj, texImage, image); + texObj, texImage, image); _mesa_dirty_texobj(ctx, texObj); } @@ -3694,6 +3696,7 @@ get_copy_tex_image_source(struct gl_context *ctx, mesa_format texFormat) } } + static void copytexsubimage_by_slice(struct gl_context *ctx, struct gl_texture_image *texImage, @@ -3724,6 +3727,7 @@ copytexsubimage_by_slice(struct gl_context *ctx, } } + static GLboolean formats_differ_in_component_sizes(mesa_format f1, mesa_format f2) { @@ -3983,8 +3987,8 @@ copyteximage(struct gl_context *ctx, GLuint dims, x += border; width -= border * 2; if (dims == 2) { - y += border; - height -= border * 2; + y += border; + height -= border * 2; } border = 0; } @@ -3994,7 +3998,7 @@ copyteximage(struct gl_context *ctx, GLuint dims, 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; @@ -4041,6 +4045,7 @@ copyteximage_err(struct gl_context *ctx, GLuint dims, GLenum target, border, false); } + static void copyteximage_no_error(struct gl_context *ctx, GLuint dims, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, @@ -4063,7 +4068,6 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, } - void GLAPIENTRY _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, @@ -4097,8 +4101,8 @@ _mesa_CopyTexImage2D_no_error(GLenum target, GLint level, GLenum internalFormat, 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"; @@ -4121,10 +4125,11 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, 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"; @@ -4148,11 +4153,10 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, } - 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"; @@ -4175,6 +4179,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, zoffset, x, y, width, height, self); } + void GLAPIENTRY _mesa_CopyTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) @@ -4198,6 +4203,7 @@ _mesa_CopyTextureSubImage1D(GLuint texture, GLint level, 0, x, y, width, 1, self); } + void GLAPIENTRY _mesa_CopyTextureSubImage2D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, @@ -4223,7 +4229,6 @@ _mesa_CopyTextureSubImage2D(GLuint texture, GLint level, } - void GLAPIENTRY _mesa_CopyTextureSubImage3D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, @@ -4268,6 +4273,7 @@ _mesa_CopyTexSubImage1D_no_error(GLenum target, GLint level, GLint xoffset, x, y, width, 1); } + void GLAPIENTRY _mesa_CopyTexSubImage2D_no_error(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, @@ -4280,6 +4286,7 @@ _mesa_CopyTexSubImage2D_no_error(GLenum target, GLint level, GLint xoffset, 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, @@ -4292,6 +4299,7 @@ _mesa_CopyTexSubImage3D_no_error(GLenum target, GLint level, GLint xoffset, yoffset, zoffset, x, y, width, height); } + void GLAPIENTRY _mesa_CopyTextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) @@ -4303,6 +4311,7 @@ _mesa_CopyTextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset, 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, @@ -4315,6 +4324,7 @@ _mesa_CopyTextureSubImage2D_no_error(GLuint texture, GLint level, GLint xoffset, 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, @@ -4410,6 +4420,7 @@ check_clear_tex_image(struct gl_context *ctx, return true; } + static struct gl_texture_object * get_tex_obj_for_clear(struct gl_context *ctx, const char *function, @@ -4473,11 +4484,12 @@ get_tex_images_for_clear(struct gl_context *ctx, 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; @@ -4522,8 +4534,7 @@ _mesa_ClearTexSubImage( GLuint texture, GLint level, } 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], @@ -4535,8 +4546,7 @@ _mesa_ClearTexSubImage( GLuint texture, GLint level, /* 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; } @@ -4553,6 +4563,7 @@ _mesa_ClearTexSubImage( GLuint texture, GLint level, _mesa_unlock_texture(ctx, texObj); } + void GLAPIENTRY _mesa_ClearTexImage( GLuint texture, GLint level, GLenum format, GLenum type, const void *data ) @@ -4574,10 +4585,8 @@ _mesa_ClearTexImage( GLuint texture, GLint level, 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; } @@ -4733,15 +4742,12 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims, /* 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; } @@ -4759,9 +4765,7 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims, 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; } @@ -4773,28 +4777,24 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims, } 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; }