Cleanup: use const arguments

This commit is contained in:
Campbell Barton
2019-06-03 23:58:10 +10:00
parent 6dca5ff41f
commit d5f6e573ed
6 changed files with 10 additions and 10 deletions

View File

@@ -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);

View File

@@ -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};

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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;