summaryrefslogtreecommitdiffstats
path: root/src/video_core/swrasterizer/rasterizer.cpp
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-04-19 22:48:10 +0200
committerwwylele <wwylele@gmail.com>2017-04-19 22:48:10 +0200
commitb624a9520546410445c1320fac163759c9be6750 (patch)
tree232f7c3b141fbfde8e9972e94081a958ee3c0627 /src/video_core/swrasterizer/rasterizer.cpp
parentMerge pull request #2659 from MerryMage/dsp_dsp-correction (diff)
downloadyuzu-b624a9520546410445c1320fac163759c9be6750.tar
yuzu-b624a9520546410445c1320fac163759c9be6750.tar.gz
yuzu-b624a9520546410445c1320fac163759c9be6750.tar.bz2
yuzu-b624a9520546410445c1320fac163759c9be6750.tar.lz
yuzu-b624a9520546410445c1320fac163759c9be6750.tar.xz
yuzu-b624a9520546410445c1320fac163759c9be6750.tar.zst
yuzu-b624a9520546410445c1320fac163759c9be6750.zip
Diffstat (limited to 'src/video_core/swrasterizer/rasterizer.cpp')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp23
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());