diff options
author | bunnei <bunneidev@gmail.com> | 2015-05-08 00:37:59 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-05-10 04:26:17 +0200 |
commit | 23e8be573ef047d8a0bee191f4065dbcd60a7f65 (patch) | |
tree | e4274244ccd93c0b4e15e84f551c99382e8169d9 /src | |
parent | rasterizer: Implemented AddSigned combiner op. (diff) | |
download | yuzu-23e8be573ef047d8a0bee191f4065dbcd60a7f65.tar yuzu-23e8be573ef047d8a0bee191f4065dbcd60a7f65.tar.gz yuzu-23e8be573ef047d8a0bee191f4065dbcd60a7f65.tar.bz2 yuzu-23e8be573ef047d8a0bee191f4065dbcd60a7f65.tar.lz yuzu-23e8be573ef047d8a0bee191f4065dbcd60a7f65.tar.xz yuzu-23e8be573ef047d8a0bee191f4065dbcd60a7f65.tar.zst yuzu-23e8be573ef047d8a0bee191f4065dbcd60a7f65.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/pica.h | 13 | ||||
-rw-r--r-- | src/video_core/rasterizer.cpp | 5 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 26a700038..5e169ff69 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -300,7 +300,18 @@ struct Regs { BitField<24, 8, u32> const_a; }; - INSERT_PADDING_WORDS(0x1); + union { + BitField< 0, 2, u32> color_scale; + BitField<16, 2, u32> alpha_scale; + }; + + inline unsigned GetColorMultiplier() const { + return (color_scale < 3) ? (1 << color_scale) : 1; + } + + inline unsigned GetAlphaMultiplier() const { + return (alpha_scale < 3) ? (1 << alpha_scale) : 1; + } }; TevStageConfig tev_stage0; diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index f74721d4b..46a326bb4 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -597,7 +597,10 @@ 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); + combiner_output[0] = std::min((unsigned)255, color_output.r() * tev_stage.GetColorMultiplier()); + combiner_output[1] = std::min((unsigned)255, color_output.g() * tev_stage.GetColorMultiplier()); + combiner_output[2] = std::min((unsigned)255, color_output.b() * tev_stage.GetColorMultiplier()); + combiner_output[3] = std::min((unsigned)255, alpha_output * tev_stage.GetAlphaMultiplier()); if (registers.tev_combiner_buffer_input.TevStageUpdatesCombinerBufferColor(tev_stage_index)) { combiner_buffer.r() = combiner_output.r(); |