diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-03 16:58:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-03 16:58:10 +0300 |
commit | d5f6e573ed43521e497c83eff02f828aea1a35c9 (patch) | |
tree | 48bbbdb3a857b0bad01b57a9122c0f02946e4a6f | |
parent | 6dca5ff41f9baa6fb27b862e270f6e27d7f16541 (diff) |
Cleanup: use const arguments
6 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index 24d35e2bd45..0c2512904f9 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -461,7 +461,7 @@ void EEVEE_lights_cache_shcaster_material_add(EEVEE_ViewLayerData *sldata, struct GPUMaterial *gpumat, struct GPUBatch *geom, struct Object *ob, - float *alpha_threshold) + const float *alpha_threshold) { /* TODO / PERF : reuse the same shading group for objects with the same material */ DRWShadingGroup *grp = DRW_shgroup_material_create(gpumat, psl->shadow_pass); diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 2b8673e2f53..0c08082f50b 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -1405,10 +1405,10 @@ static void material_transparent(Material *ma, const bool do_cull = (ma->blend_flag & MA_BL_CULL_BACKFACE) != 0; const bool use_ssrefract = (((ma->blend_flag & MA_BL_SS_REFRACTION) != 0) && ((stl->effects->enabled_effects & EFFECT_REFRACT) != 0)); - float *color_p = &ma->r; - float *metal_p = &ma->metallic; - float *spec_p = &ma->spec; - float *rough_p = &ma->roughness; + const float *color_p = &ma->r; + const float *metal_p = &ma->metallic; + const float *spec_p = &ma->spec; + const float *rough_p = &ma->roughness; if (ma->use_nodes && ma->nodetree) { static float error_col[3] = {1.0f, 0.0f, 1.0f}; diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index 6b82c7aa915..9080d969dd1 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -921,7 +921,7 @@ void EEVEE_lights_cache_shcaster_material_add(EEVEE_ViewLayerData *sldata, struct GPUMaterial *gpumat, struct GPUBatch *geom, struct Object *ob, - float *alpha_threshold); + const float *alpha_threshold); void EEVEE_lights_cache_shcaster_object_add(EEVEE_ViewLayerData *sldata, struct Object *ob); void EEVEE_lights_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata); void EEVEE_lights_update(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata); diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c index 90e4a2ead22..66e2cf7122d 100644 --- a/source/blender/draw/modes/paint_texture_mode.c +++ b/source/blender/draw/modes/paint_texture_mode.c @@ -244,7 +244,7 @@ static void PAINT_TEXTURE_cache_init(void *vedata) /* Uniforms need a pointer to it's value so be sure it's accessible at * any given time (i.e. use static vars) */ - static float color[4] = {1.0f, 0.0f, 1.0f, 1.0}; + static const float color[4] = {1.0f, 0.0f, 1.0f, 1.0}; DRW_shgroup_uniform_vec4(shgrp, "color", color, 1); if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) { @@ -319,7 +319,7 @@ static void PAINT_TEXTURE_cache_init(void *vedata) DRW_STATE_BLEND_ALPHA; DRWPass *pass = DRW_pass_create("Face Mask Pass", state); DRWShadingGroup *shgrp = DRW_shgroup_create(sh_data->face_select_overlay, pass); - static float col[4] = {1.0f, 1.0f, 1.0f, 0.2f}; + static const float col[4] = {1.0f, 1.0f, 1.0f, 0.2f}; DRW_shgroup_uniform_vec4(shgrp, "color", col, 1); if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) { diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c index 374cb10031e..b4438b7e69e 100644 --- a/source/blender/draw/modes/paint_vertex_mode.c +++ b/source/blender/draw/modes/paint_vertex_mode.c @@ -256,7 +256,7 @@ static void PAINT_VERTEX_cache_init(void *vedata) } { - static float col[4] = {1.0f, 1.0f, 1.0f, 0.2f}; + static const float col[4] = {1.0f, 1.0f, 1.0f, 0.2f}; DRWPass *pass = DRW_pass_create("Face Mask Pass", DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND_ALPHA); diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 39eb93af199..c4ce49c5982 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -3216,7 +3216,7 @@ static PBool p_chart_lscm_solve(PHandle *handle, PChart *chart) LinearSolver *context = chart->u.lscm.context; PVert *v, *pin1 = chart->u.lscm.pin1, *pin2 = chart->u.lscm.pin2; PFace *f; - float *alpha = chart->u.lscm.abf_alpha; + const float *alpha = chart->u.lscm.abf_alpha; float area_pinned_up, area_pinned_down; bool flip_faces; int row; |