diff options
Diffstat (limited to 'source/blender/draw')
8 files changed, 38 insertions, 34 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c index 9afe54d08fc..751b9a0f7d6 100644 --- a/source/blender/draw/engines/eevee/eevee_effects.c +++ b/source/blender/draw/engines/eevee/eevee_effects.c @@ -132,7 +132,7 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, Object /* Force normal buffer creation. */ if (DRW_state_is_image_render() && - (view_layer->passflag & SCE_PASS_NORMAL) != 0) + (view_layer->passflag & SCE_PASS_NORMAL) != 0) { effects->enabled_effects |= EFFECT_NORMAL_BUFFER; } diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index 1967762a36d..3224088716b 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -190,7 +190,7 @@ static void eevee_draw_background(void *vedata) double r[3]; if (DRW_state_is_image_render() || - ((stl->effects->enabled_effects & EFFECT_TAA) != 0)) + ((stl->effects->enabled_effects & EFFECT_TAA) != 0)) { BLI_halton_3D(primes, offset, stl->effects->taa_current_sample, r); EEVEE_update_noise(psl, fbl, r); @@ -226,8 +226,8 @@ static void eevee_draw_background(void *vedata) } if (((stl->effects->enabled_effects & EFFECT_TAA) != 0) && - (stl->effects->taa_current_sample > 1) && - !DRW_state_is_image_render()) + (stl->effects->taa_current_sample > 1) && + !DRW_state_is_image_render()) { DRW_viewport_matrix_override_set(stl->effects->overide_persmat, DRW_MAT_PERS); DRW_viewport_matrix_override_set(stl->effects->overide_persinv, DRW_MAT_PERSINV); diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index beed1416715..a6bedafc16c 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -507,28 +507,30 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat psl->probe_display = DRW_pass_create("LightProbe Display", state); DRW_shgroup_instance_format(e_data.format_probe_display_cube, { - {"probe_id" , DRW_ATTRIB_INT, 1}, + {"probe_id", DRW_ATTRIB_INT, 1}, {"probe_location", DRW_ATTRIB_FLOAT, 3}, - {"sphere_size" , DRW_ATTRIB_FLOAT, 1}, + {"sphere_size", DRW_ATTRIB_FLOAT, 1}, }); - DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_cube_display_sh, - psl->probe_display, - DRW_cache_sphere_get(), - e_data.format_probe_display_cube); + DRWShadingGroup *grp = DRW_shgroup_instance_create( + e_data.probe_cube_display_sh, + psl->probe_display, + DRW_cache_sphere_get(), + e_data.format_probe_display_cube); stl->g_data->cube_display_shgrp = grp; DRW_shgroup_uniform_buffer(grp, "probeCubes", &sldata->probe_pool); DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo); DRW_shgroup_instance_format(e_data.format_probe_display_planar, { - {"probe_id" , DRW_ATTRIB_INT, 1}, + {"probe_id", DRW_ATTRIB_INT, 1}, {"probe_mat", DRW_ATTRIB_FLOAT, 16}, }); - grp = DRW_shgroup_instance_create(e_data.probe_planar_display_sh, - psl->probe_display, - DRW_cache_quad_get(), - e_data.format_probe_display_planar); + grp = DRW_shgroup_instance_create( + e_data.probe_planar_display_sh, + psl->probe_display, + DRW_cache_quad_get(), + e_data.format_probe_display_planar); stl->g_data->planar_display_shgrp = grp; DRW_shgroup_uniform_buffer(grp, "probePlanars", &txl->planar_pool); } @@ -537,9 +539,10 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat psl->probe_planar_downsample_ps = DRW_pass_create("LightProbe Planar Downsample", DRW_STATE_WRITE_COLOR); struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get(); - DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_planar_downsample_sh, - psl->probe_planar_downsample_ps, - geom, NULL); + DRWShadingGroup *grp = DRW_shgroup_instance_create( + e_data.probe_planar_downsample_sh, + psl->probe_planar_downsample_ps, + geom, NULL); stl->g_data->planar_downsample = grp; DRW_shgroup_uniform_buffer(grp, "source", &txl->planar_pool); DRW_shgroup_uniform_float(grp, "fireflyFactor", &sldata->common_data.ssr_firefly_fac, 1); @@ -564,7 +567,7 @@ void EEVEE_lightprobes_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) ped->num_cell = probe->grid_resolution_x * probe->grid_resolution_y * probe->grid_resolution_z; if ((probe->type == LIGHTPROBE_TYPE_GRID) && - ((pinfo->total_irradiance_samples + ped->num_cell) >= MAX_IRRADIANCE_SAMPLES)) + ((pinfo->total_irradiance_samples + ped->num_cell) >= MAX_IRRADIANCE_SAMPLES)) { printf("Too much grid samples !!!\n"); return; @@ -843,9 +846,10 @@ static void EEVEE_lightprobes_updates(EEVEE_ViewLayerData *sldata, EEVEE_PassLis (probe->flag & LIGHTPROBE_FLAG_SHOW_DATA)) { struct Gwn_Batch *geom = DRW_cache_sphere_get(); - DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_grid_display_sh, - psl->probe_display, - geom, NULL); + DRWShadingGroup *grp = DRW_shgroup_instance_create( + e_data.probe_grid_display_sh, + psl->probe_display, + geom, NULL); DRW_shgroup_set_instance_count(grp, ped->num_cell); DRW_shgroup_uniform_int(grp, "offset", &egrid->offset, 1); DRW_shgroup_uniform_ivec3(grp, "grid_resolution", egrid->resolution, 1); diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index 6f96d1af3ed..582f7ea747a 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -343,7 +343,7 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) /* For light update tracking. */ if ((prev_cube_sh_id >= 0) && - (prev_cube_sh_id < linfo->shcaster_backbuffer->count)) + (prev_cube_sh_id < linfo->shcaster_backbuffer->count)) { linfo->new_shadow_id[prev_cube_sh_id] = linfo->cpu_cube_ct; } diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 71564be496a..0e444039573 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -594,7 +594,7 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, E } if (!DRW_state_is_image_render() && - ((stl->effects->enabled_effects & EFFECT_TAA) == 0)) + ((stl->effects->enabled_effects & EFFECT_TAA) == 0)) { e_data.alpha_hash_offset = 0.0f; } diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index 4524ac397e7..eb7f722f3a8 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -233,7 +233,7 @@ static void eevee_render_result_normal( /* Convert Eevee encoded normals to Blender normals. */ for (int i = 0; i < rr->rectx * rr->recty * 3; i += 3) { - if (rp->rect[i] == 0.0f && rp->rect[i+1] == 0.0f) { + if (rp->rect[i] == 0.0f && rp->rect[i + 1] == 0.0f) { /* If normal is not correct then do not produce NANs. */ continue; } @@ -245,9 +245,9 @@ static void eevee_render_result_normal( float f = dot_v2v2(fenc, fenc); float g = sqrtf(1.0f - f / 4.0f); - rp->rect[i+0] = fenc[0] * g; - rp->rect[i+1] = fenc[1] * g; - rp->rect[i+2] = 1.0f - f / 2.0f; + rp->rect[i + 0] = fenc[0] * g; + rp->rect[i + 1] = fenc[1] * g; + rp->rect[i + 2] = 1.0f - f / 2.0f; mul_mat3_m4_v3(g_data->viewinv, &rp->rect[i]); } @@ -342,7 +342,7 @@ static void eevee_render_result_occlusion( /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rr->rectx * rr->recty * 3; i += 3) { - rp->rect[i] = rp->rect[i+1] = rp->rect[i+2] = min_ff(1.0f, rp->rect[i] / render_samples); + rp->rect[i] = rp->rect[i + 1] = rp->rect[i+2] = min_ff(1.0f, rp->rect[i] / render_samples); } } } @@ -525,4 +525,4 @@ void EEVEE_render_update_passes(RenderEngine *engine, Scene *scene, ViewLayer *v CHECK_PASS(SUBSURFACE_DIRECT, 3, "RGB"); #undef CHECK_PASS -}
\ No newline at end of file +} diff --git a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c index 09f40254f1b..a417a9bdf56 100644 --- a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c +++ b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c @@ -67,12 +67,12 @@ static void compute_cdf(float (*func)(float x), float cdf[FILTER_CDF_TABLE_SIZE] { cdf[0] = 0.0f; /* Actual CDF evaluation. */ - for(int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; ++u) { + for (int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; ++u) { float x = (float)(u + 1) / (float)(FILTER_CDF_TABLE_SIZE - 1); cdf[u + 1] = cdf[u] + func(x - 0.5f); /* [-0.5..0.5]. We resize later. */ } /* Normalize the CDF. */ - for(int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; u++) { + for (int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; u++) { cdf[u] /= cdf[FILTER_CDF_TABLE_SIZE - 1]; } /* Just to make sure. */ @@ -89,7 +89,7 @@ static void invert_cdf(const float cdf[FILTER_CDF_TABLE_SIZE], float invert_cdf[ invert_cdf[u] = 1.0f; } else { - float t = (x - cdf[i])/(cdf[i+1] - cdf[i]); + float t = (x - cdf[i]) / (cdf[i + 1] - cdf[i]); invert_cdf[u] = ((float)i + t) / (float)(FILTER_CDF_TABLE_SIZE - 1); } break; diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 3b2c74e8032..0bf7c24193c 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -174,7 +174,7 @@ static struct { void DRW_globals_free(void) { struct Gwn_VertFormat **format = &g_formats.instance_screenspace; - for (int i = 0; i < sizeof(g_formats) / sizeof(void*); ++i, ++format) { + for (int i = 0; i < sizeof(g_formats) / sizeof(void *); ++i, ++format) { MEM_SAFE_FREE(*format); } } |