diff options
| author | 2015-05-07 18:34:32 -0400 | |
|---|---|---|
| committer | 2015-05-09 22:12:39 -0400 | |
| commit | ff767eeb407b8c8eb372828a867677e6f0f107d5 (patch) | |
| tree | 40ce6d1b9903aee848a0796c35eb827957852c2b /src | |
| parent | rasterizer: Fixed a depth testing bug. (diff) | |
| download | yuzu-ff767eeb407b8c8eb372828a867677e6f0f107d5.tar.gz yuzu-ff767eeb407b8c8eb372828a867677e6f0f107d5.tar.xz yuzu-ff767eeb407b8c8eb372828a867677e6f0f107d5.zip | |
rasterizer: Implemented AddSigned combiner op.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/rasterizer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 2662faac5..f74721d4b 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp | |||
| @@ -499,6 +499,16 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, | |||
| 499 | return result.Cast<u8>(); | 499 | return result.Cast<u8>(); |
| 500 | } | 500 | } |
| 501 | 501 | ||
| 502 | case Operation::AddSigned: | ||
| 503 | { | ||
| 504 | // TODO(bunnei): Verify that the color conversion from (float) 0.5f to (byte) 128 is correct | ||
| 505 | auto result = input[0].Cast<int>() + input[1].Cast<int>() - Math::MakeVec<int>(128, 128, 128); | ||
| 506 | result.r() = MathUtil::Clamp<int>(result.r(), 0, 255); | ||
| 507 | result.g() = MathUtil::Clamp<int>(result.g(), 0, 255); | ||
| 508 | result.b() = MathUtil::Clamp<int>(result.b(), 0, 255); | ||
| 509 | return result.Cast<u8>(); | ||
| 510 | } | ||
| 511 | |||
| 502 | case Operation::Lerp: | 512 | case Operation::Lerp: |
| 503 | return ((input[0] * input[2] + input[1] * (Math::MakeVec<u8>(255, 255, 255) - input[2]).Cast<u8>()) / 255).Cast<u8>(); | 513 | return ((input[0] * input[2] + input[1] * (Math::MakeVec<u8>(255, 255, 255) - input[2]).Cast<u8>()) / 255).Cast<u8>(); |
| 504 | 514 | ||