summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-07-11 20:47:55 +0200
committerwwylele <wwylele@gmail.com>2017-07-11 21:15:35 +0200
commite415558a4fc471bc3ac2d22dd8052aeb63769c6e (patch)
tree779daf232305f8bf64de3cb01415b008a51906a4
parentSwRasterizer/Lighting: refactor GetLutValue into a function. (diff)
downloadyuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.tar
yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.tar.gz
yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.tar.bz2
yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.tar.lz
yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.tar.xz
yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.tar.zst
yuzu-e415558a4fc471bc3ac2d22dd8052aeb63769c6e.zip
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp21
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(
diffuse_sum += Math::MakeVec(lighting.global_ambient.ToVec3f(), 0.0f);
- return {Math::MakeVec<float>(MathUtil::Clamp(diffuse_sum.x, 0.0f, 1.0f) * 255,
- MathUtil::Clamp(diffuse_sum.y, 0.0f, 1.0f) * 255,
- MathUtil::Clamp(diffuse_sum.z, 0.0f, 1.0f) * 255,
- MathUtil::Clamp(diffuse_sum.w, 0.0f, 1.0f) * 255)
- .Cast<u8>(),
- Math::MakeVec<float>(MathUtil::Clamp(specular_sum.x, 0.0f, 1.0f) * 255,
- MathUtil::Clamp(specular_sum.y, 0.0f, 1.0f) * 255,
- MathUtil::Clamp(specular_sum.z, 0.0f, 1.0f) * 255,
- MathUtil::Clamp(specular_sum.w, 0.0f, 1.0f) * 255)
- .Cast<u8>()};
+ auto diffuse = Math::MakeVec<float>(MathUtil::Clamp(diffuse_sum.x, 0.0f, 1.0f) * 255,
+ MathUtil::Clamp(diffuse_sum.y, 0.0f, 1.0f) * 255,
+ MathUtil::Clamp(diffuse_sum.z, 0.0f, 1.0f) * 255,
+ MathUtil::Clamp(diffuse_sum.w, 0.0f, 1.0f) * 255)
+ .Cast<u8>();
+ auto specular = Math::MakeVec<float>(MathUtil::Clamp(specular_sum.x, 0.0f, 1.0f) * 255,
+ MathUtil::Clamp(specular_sum.y, 0.0f, 1.0f) * 255,
+ MathUtil::Clamp(specular_sum.z, 0.0f, 1.0f) * 255,
+ MathUtil::Clamp(specular_sum.w, 0.0f, 1.0f) * 255)
+ .Cast<u8>();
+ return {diffuse, specular};
}
MICROPROFILE_DEFINE(GPU_Rasterization, "GPU", "Rasterization", MP_RGB(50, 50, 240));