summaryrefslogtreecommitdiffstats
path: root/src/video_core/swrasterizer/rasterizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/swrasterizer/rasterizer.cpp')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index 7557fcb89..20addf0bd 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -276,8 +276,10 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
DEBUG_ASSERT(0 != texture.config.address);
- float24 u = uv[i].u();
- float24 v = uv[i].v();
+ int coordinate_i =
+ (i == 2 && regs.texturing.main_config.texture2_use_coord1) ? 1 : i;
+ float24 u = uv[coordinate_i].u();
+ float24 v = uv[coordinate_i].v();
// Only unit 0 respects the texturing type (according to 3DBrew)
// TODO: Refactor so cubemaps and shadowmaps can be handled
@@ -403,13 +405,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());