diff options
| author | 2017-07-11 21:47:55 +0300 | |
|---|---|---|
| committer | 2017-07-11 22:15:35 +0300 | |
| commit | e415558a4fc471bc3ac2d22dd8052aeb63769c6e (patch) | |
| tree | 779daf232305f8bf64de3cb01415b008a51906a4 /src | |
| parent | SwRasterizer/Lighting: refactor GetLutValue into a function. (diff) | |
| download | yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.tar.gz yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.tar.xz yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.zip | |
SwRasterizer/Lighting: get rid of nested return
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/swrasterizer/rasterizer.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index 53c3bb585..e46790f85 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp | |||
| @@ -340,16 +340,17 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors( | |||
| 340 | 340 | ||
| 341 | diffuse_sum += Math::MakeVec(lighting.global_ambient.ToVec3f(), 0.0f); | 341 | diffuse_sum += Math::MakeVec(lighting.global_ambient.ToVec3f(), 0.0f); |
| 342 | 342 | ||
| 343 | return {Math::MakeVec<float>(MathUtil::Clamp(diffuse_sum.x, 0.0f, 1.0f) * 255, | 343 | auto diffuse = Math::MakeVec<float>(MathUtil::Clamp(diffuse_sum.x, 0.0f, 1.0f) * 255, |
| 344 | MathUtil::Clamp(diffuse_sum.y, 0.0f, 1.0f) * 255, | 344 | MathUtil::Clamp(diffuse_sum.y, 0.0f, 1.0f) * 255, |
| 345 | MathUtil::Clamp(diffuse_sum.z, 0.0f, 1.0f) * 255, | 345 | MathUtil::Clamp(diffuse_sum.z, 0.0f, 1.0f) * 255, |
| 346 | MathUtil::Clamp(diffuse_sum.w, 0.0f, 1.0f) * 255) | 346 | MathUtil::Clamp(diffuse_sum.w, 0.0f, 1.0f) * 255) |
| 347 | .Cast<u8>(), | 347 | .Cast<u8>(); |
| 348 | Math::MakeVec<float>(MathUtil::Clamp(specular_sum.x, 0.0f, 1.0f) * 255, | 348 | auto specular = Math::MakeVec<float>(MathUtil::Clamp(specular_sum.x, 0.0f, 1.0f) * 255, |
| 349 | MathUtil::Clamp(specular_sum.y, 0.0f, 1.0f) * 255, | 349 | MathUtil::Clamp(specular_sum.y, 0.0f, 1.0f) * 255, |
| 350 | MathUtil::Clamp(specular_sum.z, 0.0f, 1.0f) * 255, | 350 | MathUtil::Clamp(specular_sum.z, 0.0f, 1.0f) * 255, |
| 351 | MathUtil::Clamp(specular_sum.w, 0.0f, 1.0f) * 255) | 351 | MathUtil::Clamp(specular_sum.w, 0.0f, 1.0f) * 255) |
| 352 | .Cast<u8>()}; | 352 | .Cast<u8>(); |
| 353 | return {diffuse, specular}; | ||
| 353 | } | 354 | } |
| 354 | 355 | ||
| 355 | MICROPROFILE_DEFINE(GPU_Rasterization, "GPU", "Rasterization", MP_RGB(50, 50, 240)); | 356 | MICROPROFILE_DEFINE(GPU_Rasterization, "GPU", "Rasterization", MP_RGB(50, 50, 240)); |