summaryrefslogtreecommitdiff
path: root/src/video_core/swrasterizer/rasterizer.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2017-04-21 17:03:22 -0400
committerGravatar GitHub2017-04-21 17:03:22 -0400
commitea53d6085a454215b4279e1c365273ef0b0202c8 (patch)
tree541a9579b76d955a5a543cd6c8451e489424c20c /src/video_core/swrasterizer/rasterizer.cpp
parentMerge pull request #2666 from yuriks/gl-cleanups (diff)
parentgl_shader_gen: remove TODO about Lerp behaviour verification. The implementat... (diff)
downloadyuzu-ea53d6085a454215b4279e1c365273ef0b0202c8.tar.gz
yuzu-ea53d6085a454215b4279e1c365273ef0b0202c8.tar.xz
yuzu-ea53d6085a454215b4279e1c365273ef0b0202c8.zip
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.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
403 }; 403 };
404 auto color_output = ColorCombine(tev_stage.color_op, color_result); 404 auto color_output = ColorCombine(tev_stage.color_op, color_result);
405 405
406 // alpha combiner 406 u8 alpha_output;
407 std::array<u8, 3> alpha_result = {{ 407 if (tev_stage.color_op == TexturingRegs::TevStageConfig::Operation::Dot3_RGBA) {
408 GetAlphaModifier(tev_stage.alpha_modifier1, GetSource(tev_stage.alpha_source1)), 408 // result of Dot3_RGBA operation is also placed to the alpha component
409 GetAlphaModifier(tev_stage.alpha_modifier2, GetSource(tev_stage.alpha_source2)), 409 alpha_output = color_output.x;
410 GetAlphaModifier(tev_stage.alpha_modifier3, GetSource(tev_stage.alpha_source3)), 410 } else {
411 }}; 411 // alpha combiner
412 auto alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result); 412 std::array<u8, 3> alpha_result = {{
413 GetAlphaModifier(tev_stage.alpha_modifier1,
414 GetSource(tev_stage.alpha_source1)),
415 GetAlphaModifier(tev_stage.alpha_modifier2,
416 GetSource(tev_stage.alpha_source2)),
417 GetAlphaModifier(tev_stage.alpha_modifier3,
418 GetSource(tev_stage.alpha_source3)),
419 }};
420 alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result);
421 }
413 422
414 combiner_output[0] = 423 combiner_output[0] =
415 std::min((unsigned)255, color_output.r() * tev_stage.GetColorMultiplier()); 424 std::min((unsigned)255, color_output.r() * tev_stage.GetColorMultiplier());