diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-28 09:23:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-28 09:23:12 +0300 |
commit | 05dbc470ad9c1f953b5e8d2da5e3f1bfba6d4814 (patch) | |
tree | de528cc01ce385cd17d6d0b2fb2624c43a0b78de /source/blender/gpu | |
parent | a1d7f67d81bdc7ece8a757ab79d0b64f4e612bfd (diff) |
Cleanup: warnings & style
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 21 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 9 |
3 files changed, 17 insertions, 15 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index efa98f7ca2a..756fe79151b 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -72,7 +72,7 @@ GPUTexture *GPU_texture_create_2D_multisample( int w, int h, const float *pixels, GPUHDRType hdr, int samples, char err_out[256]); GPUTexture *GPU_texture_create_depth_multisample(int w, int h, int samples, char err_out[256]); GPUTexture *GPU_texture_from_blender( - struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time, int mipmap); + struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time, int mipmap); GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap); void GPU_invalid_tex_init(void); void GPU_invalid_tex_bind(int mode); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index be5235b77bb..71be262be37 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -226,8 +226,8 @@ static bool is_power_of_2_resolution(int w, int h) static bool is_over_resolution_limit(GLenum textarget, int w, int h) { - int size = (textarget == GL_TEXTURE_2D)? - GPU_max_texture_size() : GPU_max_cube_map_size(); + int size = (textarget == GL_TEXTURE_2D) ? + GPU_max_texture_size() : GPU_max_cube_map_size(); int reslimit = (U.glreslimit != 0) ? min_ii(U.glreslimit, size) : size; @@ -237,8 +237,8 @@ static bool is_over_resolution_limit(GLenum textarget, int w, int h) static int smaller_power_of_2_limit(int num) { int reslimit = (U.glreslimit != 0) ? - min_ii(U.glreslimit, GPU_max_texture_size()) : - GPU_max_texture_size(); + min_ii(U.glreslimit, GPU_max_texture_size()) : + GPU_max_texture_size(); /* take texture clamping into account */ if (num > reslimit) return reslimit; @@ -744,7 +744,7 @@ static void **gpu_gen_cube_map(unsigned int *rect, float *frect, int rectw, int return sides; /* PosX, NegX, PosY, NegY, PosZ, NegZ */ - sides = MEM_mallocN(sizeof(void*) * 6, ""); + sides = MEM_mallocN(sizeof(void *) * 6, ""); for (int i = 0; i < 6; i++) sides[i] = MEM_mallocN(block_size * w * h, ""); @@ -813,8 +813,8 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *rect, float *frect, int * GPUs (OpenGL version >= 2.0) since they support non-power-of-two-textures * Then don't bother scaling for hardware that supports NPOT textures! */ if (textarget == GL_TEXTURE_2D && - (!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(rectw, recth) || - is_over_resolution_limit(textarget, rectw, recth))) + ((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(rectw, recth)) || + is_over_resolution_limit(textarget, rectw, recth))) { rectw = smaller_power_of_2_limit(rectw); recth = smaller_power_of_2_limit(recth); @@ -918,8 +918,9 @@ void GPU_create_gl_tex(unsigned int *bind, unsigned int *rect, float *frect, int for (int i = 1; i < ibuf->miptot; i++) { ImBuf *mip = ibuf->mipmap[i - 1]; - void **mip_cube_map = gpu_gen_cube_map(mip->rect, mip->rect_float, - mip->x, mip->y, use_high_bit_depth); + void **mip_cube_map = gpu_gen_cube_map( + mip->rect, mip->rect_float, + mip->x, mip->y, use_high_bit_depth); int mipw = mip->x / 3, miph = mip->y / 2; if (mip_cube_map) { @@ -1157,7 +1158,7 @@ void GPU_paint_set_mipmap(bool mipmap) static bool GPU_check_scaled_image(ImBuf *ibuf, Image *ima, float *frect, int x, int y, int w, int h) { if ((!GPU_full_non_power_of_two_support() && !is_power_of_2_resolution(ibuf->x, ibuf->y)) || - is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y)) + is_over_resolution_limit(GL_TEXTURE_2D, ibuf->x, ibuf->y)) { int x_limit = smaller_power_of_2_limit(ibuf->x); int y_limit = smaller_power_of_2_limit(ibuf->y); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 09d326e2ee8..4d9fa54939c 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1924,16 +1924,17 @@ static void do_world_tex(GPUShadeInput *shi, struct World *wo, GPUNodeLink **hor if (mtex->mapto & WOMAP_ZENUP) { if (mtex->mapto & WOMAP_ZENDOWN) { GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&mtex->zenupfac), - GPU_uniform(&mtex->zendownfac), &zenfac); + GPU_uniform(&mtex->zendownfac), &zenfac); } else { GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&mtex->zenupfac), - GPU_uniform(&zero), &zenfac); + GPU_uniform(&zero), &zenfac); } } - else if (mtex->mapto & WOMAP_ZENDOWN) + else if (mtex->mapto & WOMAP_ZENDOWN) { GPU_link(mat, "world_zen_mapping", shi->view, GPU_uniform(&zero), - GPU_uniform(&mtex->zendownfac), &zenfac); + GPU_uniform(&mtex->zendownfac), &zenfac); + } } else { if (mtex->mapto & WOMAP_ZENUP) |