diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-04 11:08:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-04 11:08:09 +0300 |
commit | 670b2944f4bdbb8efec9ac7d18e58c0b36aa1f44 (patch) | |
tree | 77aee9fd6d37cbce0fdedde4edc99fd187cdcb3d /source/blender/draw/engines/eevee | |
parent | 2bee48301342570e24c9c58f3d9732d8c2090e6f (diff) |
Cleanup: indentation (right shift)
Diffstat (limited to 'source/blender/draw/engines/eevee')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightcache.c | 54 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_render.c | 77 |
2 files changed, 71 insertions, 60 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 440ee8c8264..38983afa5f3 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -281,32 +281,34 @@ LightCache *EEVEE_lightcache_create( void EEVEE_lightcache_load(LightCache *lcache) { if (lcache->grid_tx.tex == NULL && lcache->grid_tx.data) { - lcache->grid_tx.tex = GPU_texture_create_nD(lcache->grid_tx.tex_size[0], - lcache->grid_tx.tex_size[1], - lcache->grid_tx.tex_size[2], - 2, - lcache->grid_tx.data, - IRRADIANCE_FORMAT, - GPU_DATA_UNSIGNED_BYTE, - 0, - false, - NULL); + lcache->grid_tx.tex = GPU_texture_create_nD( + lcache->grid_tx.tex_size[0], + lcache->grid_tx.tex_size[1], + lcache->grid_tx.tex_size[2], + 2, + lcache->grid_tx.data, + IRRADIANCE_FORMAT, + GPU_DATA_UNSIGNED_BYTE, + 0, + false, + NULL); GPU_texture_bind(lcache->grid_tx.tex, 0); GPU_texture_filter_mode(lcache->grid_tx.tex, true); GPU_texture_unbind(lcache->grid_tx.tex); } if (lcache->cube_tx.tex == NULL && lcache->cube_tx.data) { - lcache->cube_tx.tex = GPU_texture_create_nD(lcache->cube_tx.tex_size[0], - lcache->cube_tx.tex_size[1], - lcache->cube_tx.tex_size[2], - 2, - lcache->cube_tx.data, - GPU_R11F_G11F_B10F, - GPU_DATA_10_11_11_REV, - 0, - false, - NULL); + lcache->cube_tx.tex = GPU_texture_create_nD( + lcache->cube_tx.tex_size[0], + lcache->cube_tx.tex_size[1], + lcache->cube_tx.tex_size[2], + 2, + lcache->cube_tx.data, + GPU_R11F_G11F_B10F, + GPU_DATA_10_11_11_REV, + 0, + false, + NULL); GPU_texture_bind(lcache->cube_tx.tex, 0); GPU_texture_mipmap_mode(lcache->cube_tx.tex, true, true); for (int mip = 0; mip < lcache->mips_len; ++mip) { @@ -465,8 +467,9 @@ static void eevee_lightbake_create_resources(EEVEE_LightBake *lbake) lbake->cube_prb = MEM_callocN(sizeof(LightProbe *) * lbake->cube_len, "EEVEE Cube visgroup ptr"); lbake->grid_prb = MEM_callocN(sizeof(LightProbe *) * lbake->grid_len, "EEVEE Grid visgroup ptr"); - lbake->grid_prev = DRW_texture_create_2D_array(lbake->irr_size[0], lbake->irr_size[1], lbake->irr_size[2], - IRRADIANCE_FORMAT, DRW_TEX_FILTER, NULL); + lbake->grid_prev = DRW_texture_create_2D_array( + lbake->irr_size[0], lbake->irr_size[1], lbake->irr_size[2], + IRRADIANCE_FORMAT, DRW_TEX_FILTER, NULL); /* Ensure Light Cache is ready to accept new data. If not recreate one. * WARNING: All the following must be threadsafe. It's currently protected @@ -889,9 +892,10 @@ static void eevee_lightbake_render_grid_sample(void *ved, void *user_data) if (lbake->bounce_curr == 0) { /* We only need to filter the visibility for the first bounce. */ - EEVEE_lightbake_filter_visibility(sldata, vedata, lbake->rt_depth, lbake->store_fb, sample_offset, - prb->clipsta, prb->clipend, egrid->visibility_range, - prb->vis_blur, lbake->vis_res); + EEVEE_lightbake_filter_visibility( + sldata, vedata, lbake->rt_depth, lbake->store_fb, sample_offset, + prb->clipsta, prb->clipend, egrid->visibility_range, + prb->vis_blur, lbake->vis_res); } /* Update level for progressive update. */ diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index 45bfba09890..eddebdbec4c 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -209,11 +209,12 @@ static void eevee_render_result_combined( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_COMBINED, viewname); GPU_framebuffer_bind(vedata->stl->effects->final_fb); - GPU_framebuffer_read_color(vedata->stl->effects->final_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 4, 0, rp->rect); + GPU_framebuffer_read_color( + vedata->stl->effects->final_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 4, 0, rp->rect); /* Premult alpha */ int pixels_len = BLI_rcti_size_x(rect) * BLI_rcti_size_y(rect); @@ -238,11 +239,12 @@ static void eevee_render_result_subsurface( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_SUBSURFACE_COLOR, viewname); GPU_framebuffer_bind(vedata->fbl->sss_accum_fb); - GPU_framebuffer_read_color(vedata->fbl->sss_accum_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 3, 1, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->sss_accum_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 3, 1, rp->rect); /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rp->rectx * rp->recty * 3; i++) { @@ -254,11 +256,12 @@ static void eevee_render_result_subsurface( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_SUBSURFACE_DIRECT, viewname); GPU_framebuffer_bind(vedata->fbl->sss_accum_fb); - GPU_framebuffer_read_color(vedata->fbl->sss_accum_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 3, 0, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->sss_accum_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 3, 0, rp->rect); /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rp->rectx * rp->recty * 3; i++) { @@ -289,11 +292,12 @@ static void eevee_render_result_normal( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_NORMAL, viewname); GPU_framebuffer_bind(vedata->fbl->main_fb); - GPU_framebuffer_read_color(vedata->fbl->main_fb, - g_data->overscan_pixels + rect->xmin, - g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 3, 1, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->main_fb, + g_data->overscan_pixels + rect->xmin, + g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 3, 1, rp->rect); /* Convert Eevee encoded normals to Blender normals. */ for (int i = 0; i < rp->rectx * rp->recty * 3; i += 3) { @@ -336,11 +340,12 @@ static void eevee_render_result_z( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_Z, viewname); GPU_framebuffer_bind(vedata->fbl->main_fb); - GPU_framebuffer_read_depth(vedata->fbl->main_fb, - g_data->overscan_pixels + rect->xmin, - g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - rp->rect); + GPU_framebuffer_read_depth( + vedata->fbl->main_fb, + g_data->overscan_pixels + rect->xmin, + g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + rp->rect); bool is_persp = DRW_viewport_is_persp_get(); @@ -373,11 +378,12 @@ static void eevee_render_result_mist( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_MIST, viewname); GPU_framebuffer_bind(vedata->fbl->mist_accum_fb); - GPU_framebuffer_read_color(vedata->fbl->mist_accum_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 1, 0, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->mist_accum_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 1, 0, rp->rect); /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rp->rectx * rp->recty; i++) { @@ -402,11 +408,12 @@ static void eevee_render_result_occlusion( RenderPass *rp = RE_pass_find_by_name(rl, RE_PASSNAME_AO, viewname); GPU_framebuffer_bind(vedata->fbl->ao_accum_fb); - GPU_framebuffer_read_color(vedata->fbl->ao_accum_fb, - vedata->stl->g_data->overscan_pixels + rect->xmin, - vedata->stl->g_data->overscan_pixels + rect->ymin, - BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), - 3, 0, rp->rect); + GPU_framebuffer_read_color( + vedata->fbl->ao_accum_fb, + vedata->stl->g_data->overscan_pixels + rect->xmin, + vedata->stl->g_data->overscan_pixels + rect->ymin, + BLI_rcti_size_x(rect), BLI_rcti_size_y(rect), + 3, 0, rp->rect); /* This is the accumulated color. Divide by the number of samples. */ for (int i = 0; i < rp->rectx * rp->recty * 3; i += 3) { |