From 4fa904e91c78148ba39ac40371d7680294e225bf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 Mar 2019 18:17:16 +1100 Subject: Cleanup: use lowercase for dimensions in function names Most API's already use this convention. --- source/blender/gpu/intern/gpu_draw.c | 8 ++++---- source/blender/gpu/intern/gpu_framebuffer.c | 4 ++-- source/blender/gpu/intern/gpu_material.c | 4 ++-- source/blender/gpu/intern/gpu_texture.c | 22 +++++++++++----------- source/blender/gpu/intern/gpu_viewport.c | 10 +++++----- 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'source/blender/gpu/intern') diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index d91ea234931..65c07ea01a8 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -855,7 +855,7 @@ static GPUTexture *create_transfer_function(int type, const ColorBand *coba) break; } - GPUTexture *tex = GPU_texture_create_1D(TFUNC_WIDTH, GPU_RGBA8, data, NULL); + GPUTexture *tex = GPU_texture_create_1d(TFUNC_WIDTH, GPU_RGBA8, data, NULL); MEM_freeN(data); @@ -1067,9 +1067,9 @@ void GPU_create_smoke_velocity(SmokeModifierData *smd) } if (!sds->tex_velocity_x) { - sds->tex_velocity_x = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_x, NULL); - sds->tex_velocity_y = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_y, NULL); - sds->tex_velocity_z = GPU_texture_create_3D(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_z, NULL); + sds->tex_velocity_x = GPU_texture_create_3d(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_x, NULL); + sds->tex_velocity_y = GPU_texture_create_3d(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_y, NULL); + sds->tex_velocity_z = GPU_texture_create_3d(sds->res[0], sds->res[1], sds->res[2], GPU_R16F, vel_z, NULL); } } #else // WITH_SMOKE diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index 461d74738c5..83acdf6a756 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -791,12 +791,12 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, bool dept height = max_ii(1, height); width = max_ii(1, width); - ofs->color = GPU_texture_create_2D_multisample( + ofs->color = GPU_texture_create_2d_multisample( width, height, (high_bitdepth) ? GPU_RGBA16F : GPU_RGBA8, NULL, samples, err_out); if (depth) { - ofs->depth = GPU_texture_create_2D_multisample(width, height, GPU_DEPTH24_STENCIL8, NULL, samples, err_out); + ofs->depth = GPU_texture_create_2d_multisample(width, height, GPU_DEPTH24_STENCIL8, NULL, samples, err_out); } if ((depth && !ofs->depth) || !ofs->color) { diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 302b3b4ef1c..af8fcf6164e 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -165,7 +165,7 @@ static void gpu_material_ramp_texture_build(GPUMaterial *mat) GPUColorBandBuilder *builder = mat->coba_builder; - mat->coba_tex = GPU_texture_create_1D_array(CM_TABLE + 1, builder->current_layer, GPU_RGBA16F, + mat->coba_tex = GPU_texture_create_1d_array(CM_TABLE + 1, builder->current_layer, GPU_RGBA16F, (float *)builder->pixels, NULL); MEM_freeN(builder); @@ -539,7 +539,7 @@ struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int GPU_texture_free(material->sss_tex_profile); } - material->sss_tex_profile = GPU_texture_create_1D(64, GPU_RGBA16F, translucence_profile, NULL); + material->sss_tex_profile = GPU_texture_create_1d(64, GPU_RGBA16F, translucence_profile, NULL); MEM_freeN(translucence_profile); diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index c950eadad1f..ebb7b4bc0f0 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -439,7 +439,7 @@ static GLenum gpu_get_gl_datatype(eGPUDataFormat format) } } -static float *GPU_texture_3D_rescale(GPUTexture *tex, int w, int h, int d, int channels, const float *fpixels) +static float *GPU_texture_rescale_3d(GPUTexture *tex, int w, int h, int d, int channels, const float *fpixels) { const uint xf = w / tex->w, yf = h / tex->h, zf = d / tex->d; float *nfpixels = MEM_mallocN(channels * sizeof(float) * tex->w * tex->h * tex->d, "GPUTexture Rescaled 3Dtex"); @@ -575,7 +575,7 @@ static bool gpu_texture_try_alloc( return false; case GL_PROXY_TEXTURE_3D: BLI_assert(data_type == GL_FLOAT); - *rescaled_fpixels = GPU_texture_3D_rescale(tex, w, h, d, channels, fpixels); + *rescaled_fpixels = GPU_texture_rescale_3d(tex, w, h, d, channels, fpixels); return (bool)*rescaled_fpixels; } } @@ -985,7 +985,7 @@ GPUTexture *GPU_texture_from_preview(PreviewImage *prv, int mipmap) } -GPUTexture *GPU_texture_create_1D( +GPUTexture *GPU_texture_create_1d( int w, eGPUTextureFormat tex_format, const float *pixels, char err_out[256]) { BLI_assert(w > 0); @@ -993,7 +993,7 @@ GPUTexture *GPU_texture_create_1D( return GPU_texture_create_nD(w, 0, 0, 1, pixels, tex_format, data_format, 0, false, err_out); } -GPUTexture *GPU_texture_create_1D_array( +GPUTexture *GPU_texture_create_1d_array( int w, int h, eGPUTextureFormat tex_format, const float *pixels, char err_out[256]) { BLI_assert(w > 0 && h > 0); @@ -1001,7 +1001,7 @@ GPUTexture *GPU_texture_create_1D_array( return GPU_texture_create_nD(w, h, 0, 1, pixels, tex_format, data_format, 0, false, err_out); } -GPUTexture *GPU_texture_create_2D( +GPUTexture *GPU_texture_create_2d( int w, int h, eGPUTextureFormat tex_format, const float *pixels, char err_out[256]) { BLI_assert(w > 0 && h > 0); @@ -1009,7 +1009,7 @@ GPUTexture *GPU_texture_create_2D( return GPU_texture_create_nD(w, h, 0, 2, pixels, tex_format, data_format, 0, false, err_out); } -GPUTexture *GPU_texture_create_2D_multisample( +GPUTexture *GPU_texture_create_2d_multisample( int w, int h, eGPUTextureFormat tex_format, const float *pixels, int samples, char err_out[256]) { BLI_assert(w > 0 && h > 0); @@ -1017,7 +1017,7 @@ GPUTexture *GPU_texture_create_2D_multisample( return GPU_texture_create_nD(w, h, 0, 2, pixels, tex_format, data_format, samples, false, err_out); } -GPUTexture *GPU_texture_create_2D_array( +GPUTexture *GPU_texture_create_2d_array( int w, int h, int d, eGPUTextureFormat tex_format, const float *pixels, char err_out[256]) { BLI_assert(w > 0 && h > 0 && d > 0); @@ -1025,7 +1025,7 @@ GPUTexture *GPU_texture_create_2D_array( return GPU_texture_create_nD(w, h, d, 2, pixels, tex_format, data_format, 0, false, err_out); } -GPUTexture *GPU_texture_create_3D( +GPUTexture *GPU_texture_create_3d( int w, int h, int d, eGPUTextureFormat tex_format, const float *pixels, char err_out[256]) { BLI_assert(w > 0 && h > 0 && d > 0); @@ -1275,9 +1275,9 @@ void GPU_invalid_tex_init(void) { memory_usage = 0; const float color[4] = {1.0f, 0.0f, 1.0f, 1.0f}; - GG.invalid_tex_1D = GPU_texture_create_1D(1, GPU_RGBA8, color, NULL); - GG.invalid_tex_2D = GPU_texture_create_2D(1, 1, GPU_RGBA8, color, NULL); - GG.invalid_tex_3D = GPU_texture_create_3D(1, 1, 1, GPU_RGBA8, color, NULL); + GG.invalid_tex_1D = GPU_texture_create_1d(1, GPU_RGBA8, color, NULL); + GG.invalid_tex_2D = GPU_texture_create_2d(1, 1, GPU_RGBA8, color, NULL); + GG.invalid_tex_3D = GPU_texture_create_3d(1, 1, 1, GPU_RGBA8, color, NULL); } void GPU_invalid_tex_bind(int mode) diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c index 7688b113547..9a39b724b6a 100644 --- a/source/blender/gpu/intern/gpu_viewport.c +++ b/source/blender/gpu/intern/gpu_viewport.c @@ -304,7 +304,7 @@ GPUTexture *GPU_viewport_texture_pool_query(GPUViewport *viewport, void *engine, } } - tex = GPU_texture_create_2D(width, height, format, NULL, NULL); + tex = GPU_texture_create_2d(width, height, format, NULL, NULL); GPU_texture_bind(tex, 0); /* Doing filtering for depth does not make sense when not doing shadow mapping, * and enabling texture filtering on integer texture make them unreadable. */ @@ -381,8 +381,8 @@ static void gpu_viewport_default_fb_create(GPUViewport *viewport) int *size = viewport->size; bool ok = true; - dtxl->color = GPU_texture_create_2D(size[0], size[1], GPU_RGBA8, NULL, NULL); - dtxl->depth = GPU_texture_create_2D(size[0], size[1], GPU_DEPTH24_STENCIL8, NULL, NULL); + dtxl->color = GPU_texture_create_2d(size[0], size[1], GPU_RGBA8, NULL, NULL); + dtxl->depth = GPU_texture_create_2d(size[0], size[1], GPU_DEPTH24_STENCIL8, NULL, NULL); if (!(dtxl->depth && dtxl->color)) { ok = false; @@ -426,8 +426,8 @@ static void gpu_viewport_default_multisample_fb_create(GPUViewport *viewport) int samples = viewport->samples; bool ok = true; - dtxl->multisample_color = GPU_texture_create_2D_multisample(size[0], size[1], GPU_RGBA8, NULL, samples, NULL); - dtxl->multisample_depth = GPU_texture_create_2D_multisample(size[0], size[1], GPU_DEPTH24_STENCIL8, NULL, samples, NULL); + dtxl->multisample_color = GPU_texture_create_2d_multisample(size[0], size[1], GPU_RGBA8, NULL, samples, NULL); + dtxl->multisample_depth = GPU_texture_create_2d_multisample(size[0], size[1], GPU_DEPTH24_STENCIL8, NULL, samples, NULL); if (!(dtxl->multisample_depth && dtxl->multisample_color)) { ok = false; -- cgit v1.2.3