diff options
Diffstat (limited to 'source/blender/draw/engines/workbench')
6 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c index faf64b55c2d..47a03073839 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c +++ b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c @@ -301,7 +301,7 @@ void workbench_antialiasing_cache_init(WORKBENCH_Data *vedata) const float *size = DRW_viewport_size_get(); const float *sizeinv = DRW_viewport_invert_size_get(); - float metrics[4] = {sizeinv[0], sizeinv[1], size[0], size[1]}; + const float metrics[4] = {sizeinv[0], sizeinv[1], size[0], size[1]}; { /* Stage 1: Edge detection. */ diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.c b/source/blender/draw/engines/workbench/workbench_effect_dof.c index e13f7bfdd92..f2f75d616ff 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_dof.c +++ b/source/blender/draw/engines/workbench/workbench_effect_dof.c @@ -155,7 +155,7 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata) } const float *full_size = DRW_viewport_size_get(); - int size[2] = {max_ii(1, (int)full_size[0] / 2), max_ii(1, (int)full_size[1] / 2)}; + const int size[2] = {max_ii(1, (int)full_size[0] / 2), max_ii(1, (int)full_size[1] / 2)}; #if 0 /* TODO(fclem) finish COC min_max optimisation */ /* NOTE: We Ceil here in order to not miss any edge texel if using a NPO2 texture. */ int shrink_h_size[2] = {ceilf(size[0] / 8.0f), size[1]}; diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c index 53119723fab..ca80b6a9002 100644 --- a/source/blender/draw/engines/workbench/workbench_engine.c +++ b/source/blender/draw/engines/workbench/workbench_engine.c @@ -64,7 +64,7 @@ void workbench_engine_init(void *ved) workbench_update_world_ubo(wpd); if (txl->dummy_image_tx == NULL) { - float fpixel[4] = {1.0f, 0.0f, 1.0f, 1.0f}; + const float fpixel[4] = {1.0f, 0.0f, 1.0f, 1.0f}; txl->dummy_image_tx = DRW_texture_create_2d(1, 1, GPU_RGBA8, 0, fpixel); } wpd->dummy_image_tx = txl->dummy_image_tx; @@ -480,8 +480,8 @@ void workbench_draw_sample(void *ved) WORKBENCH_PrivateData *wpd = vedata->stl->wpd; WORKBENCH_PassList *psl = vedata->psl; DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); - float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - float clear_col_with_alpha[4] = {0.0f, 0.0f, 0.0f, 1.0f}; + const float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + const float clear_col_with_alpha[4] = {0.0f, 0.0f, 0.0f, 1.0f}; const bool do_render = workbench_antialiasing_setup(vedata); const bool xray_is_visible = wpd->shading.xray_alpha > 0.0f; diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index 2ed63bac853..538083b4beb 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -60,7 +60,7 @@ void workbench_material_ubo_data(WORKBENCH_PrivateData *wpd, hash = (hash * 13) ^ BLI_ghashutil_strhash_p_murmur(ob->id.lib->filepath); } float hue = BLI_hash_int_01(hash); - float hsv[3] = {hue, HSV_SATURATION, HSV_VALUE}; + const float hsv[3] = {hue, HSV_SATURATION, HSV_VALUE}; hsv_to_rgb_v(hsv, data->base_color); break; } diff --git a/source/blender/draw/engines/workbench/workbench_shadow.c b/source/blender/draw/engines/workbench/workbench_shadow.c index 2cf5f3c4c13..56a028d5a7e 100644 --- a/source/blender/draw/engines/workbench/workbench_shadow.c +++ b/source/blender/draw/engines/workbench/workbench_shadow.c @@ -62,7 +62,7 @@ static void workbench_shadow_update(WORKBENCH_PrivateData *wpd) wpd->shadow_cached_direction, wpd->shadow_direction_ws, 1e-5f); if (wpd->shadow_changed) { - float up[3] = {0.0f, 0.0f, 1.0f}; + const float up[3] = {0.0f, 0.0f, 1.0f}; unit_m4(wpd->shadow_mat); /* TODO fix singularity. */ @@ -229,7 +229,7 @@ static float workbench_shadow_object_shadow_distance(WORKBENCH_PrivateData *wpd, { BoundBox *shadow_bbox = workbench_shadow_object_shadow_bbox_get(wpd, ob, oed); - int corners[4] = {0, 3, 4, 7}; + const int corners[4] = {0, 3, 4, 7}; float dist = 1e4f, dist_isect; for (int i = 0; i < 4; i++) { if (isect_ray_plane_v3(shadow_bbox->vec[corners[i]], diff --git a/source/blender/draw/engines/workbench/workbench_volume.c b/source/blender/draw/engines/workbench/workbench_volume.c index d3c4d51dbd4..f71e77d5da5 100644 --- a/source/blender/draw/engines/workbench/workbench_volume.c +++ b/source/blender/draw/engines/workbench/workbench_volume.c @@ -43,8 +43,8 @@ void workbench_volume_engine_init(WORKBENCH_Data *vedata) WORKBENCH_TextureList *txl = vedata->txl; if (txl->dummy_volume_tx == NULL) { - float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - float one[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + const float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + const float one[4] = {1.0f, 1.0f, 1.0f, 1.0f}; txl->dummy_volume_tx = GPU_texture_create_3d(1, 1, 1, GPU_RGBA8, zero, NULL); txl->dummy_shadow_tx = GPU_texture_create_3d(1, 1, 1, GPU_RGBA8, one, NULL); txl->dummy_coba_tx = GPU_texture_create_1d(1, GPU_RGBA8, zero, NULL); |