リビジョン | 832990c0cebb1db8749d9d935390ffb0079dc924 (tree) |
---|---|
日時 | 2017-09-09 04:58:51 |
作者 | Brian Paul <brianp@vmwa...> |
コミッター | Brian Paul |
mesa: whitespace, formatting fixes in teximage.c
Reviewed-by: Eric Anholt <eric@anholt.net>
@@ -2444,7 +2444,8 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, | ||
2444 | 2444 | _mesa_is_enum_format_unsigned_int(internalFormat) != |
2445 | 2445 | _mesa_is_enum_format_unsigned_int(rb_internal_format)) { |
2446 | 2446 | _mesa_error(ctx, GL_INVALID_OPERATION, |
2447 | - "glCopyTexImage%dD(signed vs unsigned integer)", dimensions); | |
2447 | + "glCopyTexImage%dD(signed vs unsigned integer)", | |
2448 | + dimensions); | |
2448 | 2449 | return GL_TRUE; |
2449 | 2450 | } |
2450 | 2451 | } |
@@ -2755,7 +2756,7 @@ _mesa_choose_texture_format(struct gl_context *ctx, | ||
2755 | 2756 | /* see if we've already chosen a format for the previous level */ |
2756 | 2757 | if (level > 0) { |
2757 | 2758 | struct gl_texture_image *prevImage = |
2758 | - _mesa_select_tex_image(texObj, target, level - 1); | |
2759 | + _mesa_select_tex_image(texObj, target, level - 1); | |
2759 | 2760 | /* See if the prev level is defined and has an internal format which |
2760 | 2761 | * matches the new internal format. |
2761 | 2762 | */ |
@@ -3025,22 +3026,22 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims, | ||
3025 | 3026 | * rarely-tested software fallback rendering. |
3026 | 3027 | */ |
3027 | 3028 | if (border && ctx->Const.StripTextureBorder) { |
3028 | - strip_texture_border(target, &width, &height, &depth, unpack, | |
3029 | - &unpack_no_border); | |
3029 | + strip_texture_border(target, &width, &height, &depth, unpack, | |
3030 | + &unpack_no_border); | |
3030 | 3031 | border = 0; |
3031 | - unpack = &unpack_no_border; | |
3032 | + unpack = &unpack_no_border; | |
3032 | 3033 | } |
3033 | 3034 | |
3034 | 3035 | if (ctx->NewState & _NEW_PIXEL) |
3035 | - _mesa_update_state(ctx); | |
3036 | + _mesa_update_state(ctx); | |
3036 | 3037 | |
3037 | 3038 | _mesa_lock_texture(ctx, texObj); |
3038 | 3039 | { |
3039 | - texImage = _mesa_get_tex_image(ctx, texObj, target, level); | |
3040 | + texImage = _mesa_get_tex_image(ctx, texObj, target, level); | |
3040 | 3041 | |
3041 | - if (!texImage) { | |
3042 | - _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s%uD", func, dims); | |
3043 | - } | |
3042 | + if (!texImage) { | |
3043 | + _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s%uD", func, dims); | |
3044 | + } | |
3044 | 3045 | else { |
3045 | 3046 | ctx->Driver.FreeTextureImageBuffer(ctx, texImage); |
3046 | 3047 |
@@ -3071,6 +3072,7 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims, | ||
3071 | 3072 | } |
3072 | 3073 | } |
3073 | 3074 | |
3075 | + | |
3074 | 3076 | /* This is a wrapper around teximage() so that we can force the KHR_no_error |
3075 | 3077 | * logic to be inlined without inlining the function into all the callers. |
3076 | 3078 | */ |
@@ -3242,7 +3244,7 @@ _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) | ||
3242 | 3244 | ctx->Driver.FreeTextureImageBuffer(ctx, texImage); |
3243 | 3245 | |
3244 | 3246 | ctx->Driver.EGLImageTargetTexture2D(ctx, target, |
3245 | - texObj, texImage, image); | |
3247 | + texObj, texImage, image); | |
3246 | 3248 | |
3247 | 3249 | _mesa_dirty_texobj(ctx, texObj); |
3248 | 3250 | } |
@@ -3694,6 +3696,7 @@ get_copy_tex_image_source(struct gl_context *ctx, mesa_format texFormat) | ||
3694 | 3696 | } |
3695 | 3697 | } |
3696 | 3698 | |
3699 | + | |
3697 | 3700 | static void |
3698 | 3701 | copytexsubimage_by_slice(struct gl_context *ctx, |
3699 | 3702 | struct gl_texture_image *texImage, |
@@ -3724,6 +3727,7 @@ copytexsubimage_by_slice(struct gl_context *ctx, | ||
3724 | 3727 | } |
3725 | 3728 | } |
3726 | 3729 | |
3730 | + | |
3727 | 3731 | static GLboolean |
3728 | 3732 | formats_differ_in_component_sizes(mesa_format f1, mesa_format f2) |
3729 | 3733 | { |
@@ -3983,8 +3987,8 @@ copyteximage(struct gl_context *ctx, GLuint dims, | ||
3983 | 3987 | x += border; |
3984 | 3988 | width -= border * 2; |
3985 | 3989 | if (dims == 2) { |
3986 | - y += border; | |
3987 | - height -= border * 2; | |
3990 | + y += border; | |
3991 | + height -= border * 2; | |
3988 | 3992 | } |
3989 | 3993 | border = 0; |
3990 | 3994 | } |
@@ -3994,7 +3998,7 @@ copyteximage(struct gl_context *ctx, GLuint dims, | ||
3994 | 3998 | texImage = _mesa_get_tex_image(ctx, texObj, target, level); |
3995 | 3999 | |
3996 | 4000 | if (!texImage) { |
3997 | - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims); | |
4001 | + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims); | |
3998 | 4002 | } |
3999 | 4003 | else { |
4000 | 4004 | 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, | ||
4041 | 4045 | border, false); |
4042 | 4046 | } |
4043 | 4047 | |
4048 | + | |
4044 | 4049 | static void |
4045 | 4050 | copyteximage_no_error(struct gl_context *ctx, GLuint dims, GLenum target, |
4046 | 4051 | GLint level, GLenum internalFormat, GLint x, GLint y, |
@@ -4063,7 +4068,6 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, | ||
4063 | 4068 | } |
4064 | 4069 | |
4065 | 4070 | |
4066 | - | |
4067 | 4071 | void GLAPIENTRY |
4068 | 4072 | _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, |
4069 | 4073 | GLint x, GLint y, GLsizei width, GLsizei height, |
@@ -4097,8 +4101,8 @@ _mesa_CopyTexImage2D_no_error(GLenum target, GLint level, GLenum internalFormat, | ||
4097 | 4101 | |
4098 | 4102 | |
4099 | 4103 | void GLAPIENTRY |
4100 | -_mesa_CopyTexSubImage1D( GLenum target, GLint level, | |
4101 | - GLint xoffset, GLint x, GLint y, GLsizei width ) | |
4104 | +_mesa_CopyTexSubImage1D(GLenum target, GLint level, | |
4105 | + GLint xoffset, GLint x, GLint y, GLsizei width) | |
4102 | 4106 | { |
4103 | 4107 | struct gl_texture_object* texObj; |
4104 | 4108 | const char *self = "glCopyTexSubImage1D"; |
@@ -4121,10 +4125,11 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, | ||
4121 | 4125 | x, y, width, 1, self); |
4122 | 4126 | } |
4123 | 4127 | |
4128 | + | |
4124 | 4129 | void GLAPIENTRY |
4125 | -_mesa_CopyTexSubImage2D( GLenum target, GLint level, | |
4126 | - GLint xoffset, GLint yoffset, | |
4127 | - GLint x, GLint y, GLsizei width, GLsizei height ) | |
4130 | +_mesa_CopyTexSubImage2D(GLenum target, GLint level, | |
4131 | + GLint xoffset, GLint yoffset, | |
4132 | + GLint x, GLint y, GLsizei width, GLsizei height) | |
4128 | 4133 | { |
4129 | 4134 | struct gl_texture_object* texObj; |
4130 | 4135 | const char *self = "glCopyTexSubImage2D"; |
@@ -4148,11 +4153,10 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, | ||
4148 | 4153 | } |
4149 | 4154 | |
4150 | 4155 | |
4151 | - | |
4152 | 4156 | void GLAPIENTRY |
4153 | -_mesa_CopyTexSubImage3D( GLenum target, GLint level, | |
4154 | - GLint xoffset, GLint yoffset, GLint zoffset, | |
4155 | - GLint x, GLint y, GLsizei width, GLsizei height ) | |
4157 | +_mesa_CopyTexSubImage3D(GLenum target, GLint level, | |
4158 | + GLint xoffset, GLint yoffset, GLint zoffset, | |
4159 | + GLint x, GLint y, GLsizei width, GLsizei height) | |
4156 | 4160 | { |
4157 | 4161 | struct gl_texture_object* texObj; |
4158 | 4162 | const char *self = "glCopyTexSubImage3D"; |
@@ -4175,6 +4179,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, | ||
4175 | 4179 | zoffset, x, y, width, height, self); |
4176 | 4180 | } |
4177 | 4181 | |
4182 | + | |
4178 | 4183 | void GLAPIENTRY |
4179 | 4184 | _mesa_CopyTextureSubImage1D(GLuint texture, GLint level, |
4180 | 4185 | GLint xoffset, GLint x, GLint y, GLsizei width) |
@@ -4198,6 +4203,7 @@ _mesa_CopyTextureSubImage1D(GLuint texture, GLint level, | ||
4198 | 4203 | 0, x, y, width, 1, self); |
4199 | 4204 | } |
4200 | 4205 | |
4206 | + | |
4201 | 4207 | void GLAPIENTRY |
4202 | 4208 | _mesa_CopyTextureSubImage2D(GLuint texture, GLint level, |
4203 | 4209 | GLint xoffset, GLint yoffset, |
@@ -4223,7 +4229,6 @@ _mesa_CopyTextureSubImage2D(GLuint texture, GLint level, | ||
4223 | 4229 | } |
4224 | 4230 | |
4225 | 4231 | |
4226 | - | |
4227 | 4232 | void GLAPIENTRY |
4228 | 4233 | _mesa_CopyTextureSubImage3D(GLuint texture, GLint level, |
4229 | 4234 | GLint xoffset, GLint yoffset, GLint zoffset, |
@@ -4268,6 +4273,7 @@ _mesa_CopyTexSubImage1D_no_error(GLenum target, GLint level, GLint xoffset, | ||
4268 | 4273 | x, y, width, 1); |
4269 | 4274 | } |
4270 | 4275 | |
4276 | + | |
4271 | 4277 | void GLAPIENTRY |
4272 | 4278 | _mesa_CopyTexSubImage2D_no_error(GLenum target, GLint level, GLint xoffset, |
4273 | 4279 | GLint yoffset, GLint x, GLint y, GLsizei width, |
@@ -4280,6 +4286,7 @@ _mesa_CopyTexSubImage2D_no_error(GLenum target, GLint level, GLint xoffset, | ||
4280 | 4286 | yoffset, 0, x, y, width, height); |
4281 | 4287 | } |
4282 | 4288 | |
4289 | + | |
4283 | 4290 | void GLAPIENTRY |
4284 | 4291 | _mesa_CopyTexSubImage3D_no_error(GLenum target, GLint level, GLint xoffset, |
4285 | 4292 | GLint yoffset, GLint zoffset, GLint x, GLint y, |
@@ -4292,6 +4299,7 @@ _mesa_CopyTexSubImage3D_no_error(GLenum target, GLint level, GLint xoffset, | ||
4292 | 4299 | yoffset, zoffset, x, y, width, height); |
4293 | 4300 | } |
4294 | 4301 | |
4302 | + | |
4295 | 4303 | void GLAPIENTRY |
4296 | 4304 | _mesa_CopyTextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset, |
4297 | 4305 | GLint x, GLint y, GLsizei width) |
@@ -4303,6 +4311,7 @@ _mesa_CopyTextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset, | ||
4303 | 4311 | xoffset, 0, 0, x, y, width, 1); |
4304 | 4312 | } |
4305 | 4313 | |
4314 | + | |
4306 | 4315 | void GLAPIENTRY |
4307 | 4316 | _mesa_CopyTextureSubImage2D_no_error(GLuint texture, GLint level, GLint xoffset, |
4308 | 4317 | GLint yoffset, GLint x, GLint y, |
@@ -4315,6 +4324,7 @@ _mesa_CopyTextureSubImage2D_no_error(GLuint texture, GLint level, GLint xoffset, | ||
4315 | 4324 | xoffset, yoffset, 0, x, y, width, height); |
4316 | 4325 | } |
4317 | 4326 | |
4327 | + | |
4318 | 4328 | void GLAPIENTRY |
4319 | 4329 | _mesa_CopyTextureSubImage3D_no_error(GLuint texture, GLint level, GLint xoffset, |
4320 | 4330 | GLint yoffset, GLint zoffset, GLint x, |
@@ -4410,6 +4420,7 @@ check_clear_tex_image(struct gl_context *ctx, | ||
4410 | 4420 | return true; |
4411 | 4421 | } |
4412 | 4422 | |
4423 | + | |
4413 | 4424 | static struct gl_texture_object * |
4414 | 4425 | get_tex_obj_for_clear(struct gl_context *ctx, |
4415 | 4426 | const char *function, |
@@ -4473,11 +4484,12 @@ get_tex_images_for_clear(struct gl_context *ctx, | ||
4473 | 4484 | return numFaces; |
4474 | 4485 | } |
4475 | 4486 | |
4487 | + | |
4476 | 4488 | void GLAPIENTRY |
4477 | -_mesa_ClearTexSubImage( GLuint texture, GLint level, | |
4478 | - GLint xoffset, GLint yoffset, GLint zoffset, | |
4479 | - GLsizei width, GLsizei height, GLsizei depth, | |
4480 | - GLenum format, GLenum type, const void *data ) | |
4489 | +_mesa_ClearTexSubImage(GLuint texture, GLint level, | |
4490 | + GLint xoffset, GLint yoffset, GLint zoffset, | |
4491 | + GLsizei width, GLsizei height, GLsizei depth, | |
4492 | + GLenum format, GLenum type, const void *data) | |
4481 | 4493 | { |
4482 | 4494 | GET_CURRENT_CONTEXT(ctx); |
4483 | 4495 | struct gl_texture_object *texObj; |
@@ -4522,8 +4534,7 @@ _mesa_ClearTexSubImage( GLuint texture, GLint level, | ||
4522 | 4534 | } |
4523 | 4535 | |
4524 | 4536 | if (numImages == 1) { |
4525 | - if (check_clear_tex_image(ctx, "glClearTexSubImage", | |
4526 | - texImages[0], | |
4537 | + if (check_clear_tex_image(ctx, "glClearTexSubImage", texImages[0], | |
4527 | 4538 | format, type, data, clearValue[0])) { |
4528 | 4539 | ctx->Driver.ClearTexSubImage(ctx, |
4529 | 4540 | texImages[0], |
@@ -4535,8 +4546,7 @@ _mesa_ClearTexSubImage( GLuint texture, GLint level, | ||
4535 | 4546 | /* loop over cube face images */ |
4536 | 4547 | for (i = zoffset; i < zoffset + depth; i++) { |
4537 | 4548 | assert(i < MAX_FACES); |
4538 | - if (!check_clear_tex_image(ctx, "glClearTexSubImage", | |
4539 | - texImages[i], | |
4549 | + if (!check_clear_tex_image(ctx, "glClearTexSubImage", texImages[i], | |
4540 | 4550 | format, type, data, clearValue[i])) |
4541 | 4551 | goto out; |
4542 | 4552 | } |
@@ -4553,6 +4563,7 @@ _mesa_ClearTexSubImage( GLuint texture, GLint level, | ||
4553 | 4563 | _mesa_unlock_texture(ctx, texObj); |
4554 | 4564 | } |
4555 | 4565 | |
4566 | + | |
4556 | 4567 | void GLAPIENTRY |
4557 | 4568 | _mesa_ClearTexImage( GLuint texture, GLint level, |
4558 | 4569 | GLenum format, GLenum type, const void *data ) |
@@ -4574,10 +4585,8 @@ _mesa_ClearTexImage( GLuint texture, GLint level, | ||
4574 | 4585 | texObj, level, texImages); |
4575 | 4586 | |
4576 | 4587 | for (i = 0; i < numImages; i++) { |
4577 | - if (!check_clear_tex_image(ctx, "glClearTexImage", | |
4578 | - texImages[i], | |
4579 | - format, type, data, | |
4580 | - clearValue[i])) | |
4588 | + if (!check_clear_tex_image(ctx, "glClearTexImage", texImages[i], format, | |
4589 | + type, data, clearValue[i])) | |
4581 | 4590 | goto out; |
4582 | 4591 | } |
4583 | 4592 |
@@ -4733,15 +4742,12 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims, | ||
4733 | 4742 | |
4734 | 4743 | /* this will catch any invalid compressed format token */ |
4735 | 4744 | if (!_mesa_is_compressed_format(ctx, format)) { |
4736 | - _mesa_error(ctx, GL_INVALID_ENUM, | |
4737 | - "%s(format)", callerName); | |
4745 | + _mesa_error(ctx, GL_INVALID_ENUM, "%s(format)", callerName); | |
4738 | 4746 | return GL_TRUE; |
4739 | 4747 | } |
4740 | 4748 | |
4741 | 4749 | if (level < 0 || level >= _mesa_max_texture_levels(ctx, target)) { |
4742 | - _mesa_error(ctx, GL_INVALID_VALUE, | |
4743 | - "%s(level=%d)", | |
4744 | - callerName, level); | |
4750 | + _mesa_error(ctx, GL_INVALID_VALUE, "%s(level=%d)", callerName, level); | |
4745 | 4751 | return GL_TRUE; |
4746 | 4752 | } |
4747 | 4753 |
@@ -4759,9 +4765,7 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims, | ||
4759 | 4765 | |
4760 | 4766 | expectedSize = compressed_tex_size(width, height, depth, format); |
4761 | 4767 | if (expectedSize != imageSize) { |
4762 | - _mesa_error(ctx, GL_INVALID_VALUE, | |
4763 | - "%s(size=%d)", | |
4764 | - callerName, imageSize); | |
4768 | + _mesa_error(ctx, GL_INVALID_VALUE, "%s(size=%d)", callerName, imageSize); | |
4765 | 4769 | return GL_TRUE; |
4766 | 4770 | } |
4767 | 4771 |
@@ -4773,28 +4777,24 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims, | ||
4773 | 4777 | } |
4774 | 4778 | |
4775 | 4779 | if ((GLint) format != texImage->InternalFormat) { |
4776 | - _mesa_error(ctx, GL_INVALID_OPERATION, | |
4777 | - "%s(format=%s)", | |
4780 | + _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s)", | |
4778 | 4781 | callerName, _mesa_enum_to_string(format)); |
4779 | 4782 | return GL_TRUE; |
4780 | 4783 | } |
4781 | 4784 | |
4782 | 4785 | if (compressedteximage_only_format(ctx, format)) { |
4783 | - _mesa_error(ctx, GL_INVALID_OPERATION, | |
4784 | - "%s(format=%s cannot be updated)", | |
4786 | + _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s cannot be updated)", | |
4785 | 4787 | callerName, _mesa_enum_to_string(format)); |
4786 | 4788 | return GL_TRUE; |
4787 | 4789 | } |
4788 | 4790 | |
4789 | - if (error_check_subtexture_negative_dimensions(ctx, dims, | |
4790 | - width, height, depth, | |
4791 | - callerName)) { | |
4791 | + if (error_check_subtexture_negative_dimensions(ctx, dims, width, height, | |
4792 | + depth, callerName)) { | |
4792 | 4793 | return GL_TRUE; |
4793 | 4794 | } |
4794 | 4795 | |
4795 | - if (error_check_subtexture_dimensions(ctx, dims, | |
4796 | - texImage, xoffset, yoffset, zoffset, | |
4797 | - width, height, depth, | |
4796 | + if (error_check_subtexture_dimensions(ctx, dims, texImage, xoffset, yoffset, | |
4797 | + zoffset, width, height, depth, | |
4798 | 4798 | callerName)) { |
4799 | 4799 | return GL_TRUE; |
4800 | 4800 | } |