diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:49:59 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 13:01:40 +0300 |
commit | 156448ba4ba350dd6f9718b4610f14f4ba187af6 (patch) | |
tree | 5ad43590fbf4d7536f58a38935cbbac3c2ec27bd /source/blender/draw/engines/eevee | |
parent | 88cc3f167f7ee404640289ed9cfd6b13f0494d98 (diff) |
Cleanup: Draw, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/draw` module. Not all warnings are addressed
in this commit.
No functional changes.
Diffstat (limited to 'source/blender/draw/engines/eevee')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightcache.c | 5 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 5 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_motion_blur.c | 17 |
3 files changed, 12 insertions, 15 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 19325729114..38f5536170e 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -1021,9 +1021,8 @@ static void compute_cell_id(EEVEE_LightGrid *egrid, if (visited_cells == cell_idx) { return; } - else { - visited_cells++; - } + + visited_cells++; } } } diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 59e8c1407e6..4f97fe99b27 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -483,9 +483,8 @@ static EeveeMaterialCache material_opaque(EEVEE_Data *vedata, if (BLI_ghash_ensure_p(pd->material_hash, key, (void ***)&emc_p)) { return **emc_p; } - else { - *emc_p = emc = BLI_memblock_alloc(sldata->material_cache); - } + + *emc_p = emc = BLI_memblock_alloc(sldata->material_cache); material_shadow(vedata, sldata, ma, is_hair, emc); diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.c b/source/blender/draw/engines/eevee/eevee_motion_blur.c index 0b79c8016d1..4e49136a6bc 100644 --- a/source/blender/draw/engines/eevee/eevee_motion_blur.c +++ b/source/blender/draw/engines/eevee/eevee_motion_blur.c @@ -480,16 +480,15 @@ void EEVEE_motion_blur_cache_finish(EEVEE_Data *vedata) GPU_VERTBUF_DISCARD_SAFE(mb_geom->vbo[MB_NEXT]); break; } + + /* Modify the batch to include the previous & next position. */ + if (i == MB_PREV) { + GPU_batch_vertbuf_add_ex(batch, vbo, true); + mb_geom->vbo[i] = NULL; + } else { - /* Modify the batch to include the previous & next position. */ - if (i == MB_PREV) { - GPU_batch_vertbuf_add_ex(batch, vbo, true); - mb_geom->vbo[i] = NULL; - } - else { - /* This VBO can be reuse by next time step. Don't pass ownership. */ - GPU_batch_vertbuf_add_ex(batch, vbo, false); - } + /* This VBO can be reuse by next time step. Don't pass ownership. */ + GPU_batch_vertbuf_add_ex(batch, vbo, false); } } } |