diff options
author | bunnei <bunneidev@gmail.com> | 2015-05-07 04:18:11 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-05-10 04:12:36 +0200 |
commit | a806b420a64d44e8b9a0d6f0a742d7eaad06168a (patch) | |
tree | 5620a7882d73cbefbf63a0a0813507fc512eef16 /src/video_core/rasterizer.cpp | |
parent | rasterizer: Return zero'd vectors on error conditions. (diff) | |
download | yuzu-a806b420a64d44e8b9a0d6f0a742d7eaad06168a.tar yuzu-a806b420a64d44e8b9a0d6f0a742d7eaad06168a.tar.gz yuzu-a806b420a64d44e8b9a0d6f0a742d7eaad06168a.tar.bz2 yuzu-a806b420a64d44e8b9a0d6f0a742d7eaad06168a.tar.lz yuzu-a806b420a64d44e8b9a0d6f0a742d7eaad06168a.tar.xz yuzu-a806b420a64d44e8b9a0d6f0a742d7eaad06168a.tar.zst yuzu-a806b420a64d44e8b9a0d6f0a742d7eaad06168a.zip |
Diffstat (limited to 'src/video_core/rasterizer.cpp')
-rw-r--r-- | src/video_core/rasterizer.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 3b36afad9..7bdb503c8 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -376,7 +376,13 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, // with some basic arithmetic. Alpha combiners can be configured separately but work // analogously. Math::Vec4<u8> combiner_output; - for (const auto& tev_stage : tev_stages) { + Math::Vec4<u8> combiner_buffer = { + registers.tev_combiner_buffer_color.r, registers.tev_combiner_buffer_color.g, + registers.tev_combiner_buffer_color.b, registers.tev_combiner_buffer_color.a + }; + + for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size(); ++tev_stage_index) { + const auto& tev_stage = tev_stages[tev_stage_index]; using Source = Regs::TevStageConfig::Source; using ColorModifier = Regs::TevStageConfig::ColorModifier; using AlphaModifier = Regs::TevStageConfig::AlphaModifier; @@ -398,6 +404,9 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, case Source::Texture2: return texture_color[2]; + case Source::PreviousBuffer: + return combiner_buffer; + case Source::Constant: return {tev_stage.const_r, tev_stage.const_g, tev_stage.const_b, tev_stage.const_a}; @@ -579,6 +588,16 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, auto alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result); combiner_output = Math::MakeVec(color_output, alpha_output); + + if (registers.tev_combiner_buffer_input.TevStageUpdatesCombinerBufferColor(tev_stage_index)) { + combiner_buffer.r() = combiner_output.r(); + combiner_buffer.g() = combiner_output.g(); + combiner_buffer.b() = combiner_output.b(); + } + + if (registers.tev_combiner_buffer_input.TevStageUpdatesCombinerBufferAlpha(tev_stage_index)) { + combiner_buffer.a() = combiner_output.a(); + } } if (registers.output_merger.alpha_test.enable) { |