Cycles: Cleanup, use switch() instead of if-else chain

About to add extra debug passes, which will be more clear to use switch().
This commit is contained in:
Sergey Sharybin 2017-01-12 12:45:37 +01:00
parent 39bc6172a4
commit e9e1c95e64
1 changed files with 8 additions and 6 deletions

View File

@ -305,12 +305,14 @@ static PassType get_pass_type(BL::RenderPass& b_pass)
#ifdef WITH_CYCLES_DEBUG
case BL::RenderPass::type_DEBUG:
{
if(b_pass.debug_type() == BL::RenderPass::debug_type_BVH_TRAVERSAL_STEPS)
return PASS_BVH_TRAVERSAL_STEPS;
if(b_pass.debug_type() == BL::RenderPass::debug_type_BVH_TRAVERSED_INSTANCES)
return PASS_BVH_TRAVERSED_INSTANCES;
if(b_pass.debug_type() == BL::RenderPass::debug_type_RAY_BOUNCES)
return PASS_RAY_BOUNCES;
switch(b_pass.debug_type()) {
case BL::RenderPass::debug_type_BVH_TRAVERSAL_STEPS:
return PASS_BVH_TRAVERSAL_STEPS;
case BL::RenderPass::debug_type_BVH_TRAVERSED_INSTANCES:
return PASS_BVH_TRAVERSED_INSTANCES;
case BL::RenderPass::debug_type_RAY_BOUNCES:
return PASS_RAY_BOUNCES;
}
break;
}
#endif