summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-05-25 06:40:01 +0200
committerbunnei <bunneidev@gmail.com>2015-05-31 07:52:40 +0200
commit3b5ff61201e23068a4e4e526e3c51dd9732b7ae4 (patch)
tree3e4104e5be4731d0e686c9358e237878503c7795
parentvertex_shader: Use address offset on src2 in inverted mode. (diff)
downloadyuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.tar
yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.tar.gz
yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.tar.bz2
yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.tar.lz
yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.tar.xz
yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.tar.zst
yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.zip
-rw-r--r--src/video_core/rasterizer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index 6df3a74f2..8f39e609b 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -570,6 +570,13 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0,
case Operation::Add:
return std::min(255, input[0] + input[1]);
+ case Operation::AddSigned:
+ {
+ // TODO(bunnei): Verify that the color conversion from (float) 0.5f to (byte) 128 is correct
+ auto result = static_cast<int>(input[0]) + static_cast<int>(input[1]) - 128;
+ return static_cast<u8>(MathUtil::Clamp<int>(result, 0, 255));
+ }
+
case Operation::Lerp:
return (input[0] * input[2] + input[1] * (255 - input[2])) / 255;