diff options
| author | 2015-05-25 00:40:01 -0400 | |
|---|---|---|
| committer | 2015-05-31 01:52:40 -0400 | |
| commit | 3b5ff61201e23068a4e4e526e3c51dd9732b7ae4 (patch) | |
| tree | 3e4104e5be4731d0e686c9358e237878503c7795 /src/video_core/rasterizer.cpp | |
| parent | vertex_shader: Use address offset on src2 in inverted mode. (diff) | |
| download | yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.tar.gz yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.tar.xz yuzu-3b5ff61201e23068a4e4e526e3c51dd9732b7ae4.zip | |
rasterizer: Implement AddSigned combiner function for alpha channel.
Diffstat (limited to 'src/video_core/rasterizer.cpp')
| -rw-r--r-- | src/video_core/rasterizer.cpp | 7 |
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, | |||
| 570 | case Operation::Add: | 570 | case Operation::Add: |
| 571 | return std::min(255, input[0] + input[1]); | 571 | return std::min(255, input[0] + input[1]); |
| 572 | 572 | ||
| 573 | case Operation::AddSigned: | ||
| 574 | { | ||
| 575 | // TODO(bunnei): Verify that the color conversion from (float) 0.5f to (byte) 128 is correct | ||
| 576 | auto result = static_cast<int>(input[0]) + static_cast<int>(input[1]) - 128; | ||
| 577 | return static_cast<u8>(MathUtil::Clamp<int>(result, 0, 255)); | ||
| 578 | } | ||
| 579 | |||
| 573 | case Operation::Lerp: | 580 | case Operation::Lerp: |
| 574 | return (input[0] * input[2] + input[1] * (255 - input[2])) / 255; | 581 | return (input[0] * input[2] + input[1] * (255 - input[2])) / 255; |
| 575 | 582 | ||