diff options
| author | bunnei <bunneidev@gmail.com> | 2017-04-21 17:03:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-21 17:03:22 -0400 |
| commit | ea53d6085a454215b4279e1c365273ef0b0202c8 (patch) | |
| tree | 541a9579b76d955a5a543cd6c8451e489424c20c /src/video_core/swrasterizer/rasterizer.cpp | |
| parent | 5d852467a25a749a729056edb4597173976a5820 (diff) | |
| parent | 2c2e872b318dee94057461a24c5915e8e0ebc844 (diff) | |
Merge pull request #2671 from wwylele/dot3-rgba
rasterizer: implement combiner operation 7 (Dot3_RGBA)
Diffstat (limited to 'src/video_core/swrasterizer/rasterizer.cpp')
| -rw-r--r-- | src/video_core/swrasterizer/rasterizer.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index 7557fcb89..cb1b90a81 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -403,13 +403,22 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve }; auto color_output = ColorCombine(tev_stage.color_op, color_result); - // alpha combiner - std::array<u8, 3> alpha_result = {{ - GetAlphaModifier(tev_stage.alpha_modifier1, GetSource(tev_stage.alpha_source1)), - GetAlphaModifier(tev_stage.alpha_modifier2, GetSource(tev_stage.alpha_source2)), - GetAlphaModifier(tev_stage.alpha_modifier3, GetSource(tev_stage.alpha_source3)), - }}; - auto alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result); + u8 alpha_output; + if (tev_stage.color_op == TexturingRegs::TevStageConfig::Operation::Dot3_RGBA) { + // result of Dot3_RGBA operation is also placed to the alpha component + alpha_output = color_output.x; + } else { + // alpha combiner + std::array<u8, 3> alpha_result = {{ + GetAlphaModifier(tev_stage.alpha_modifier1, + GetSource(tev_stage.alpha_source1)), + GetAlphaModifier(tev_stage.alpha_modifier2, + GetSource(tev_stage.alpha_source2)), + GetAlphaModifier(tev_stage.alpha_modifier3, + GetSource(tev_stage.alpha_source3)), + }}; + alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result); + } combiner_output[0] = std::min((unsigned)255, color_output.r() * tev_stage.GetColorMultiplier()); |
