diff options
author | bunnei <bunneidev@gmail.com> | 2015-01-28 19:51:45 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-01-28 19:51:45 +0100 |
commit | 8d4c6a1d5e384cd9643ecab889d4a8d44e0fa358 (patch) | |
tree | f99ff5df34528c4b6098d471e140ab057004ba3c | |
parent | Merge pull request #507 from bunnei/alpha-testing (diff) | |
parent | Pica: Implement color/alpha channel enable. (diff) | |
download | yuzu-8d4c6a1d5e384cd9643ecab889d4a8d44e0fa358.tar yuzu-8d4c6a1d5e384cd9643ecab889d4a8d44e0fa358.tar.gz yuzu-8d4c6a1d5e384cd9643ecab889d4a8d44e0fa358.tar.bz2 yuzu-8d4c6a1d5e384cd9643ecab889d4a8d44e0fa358.tar.lz yuzu-8d4c6a1d5e384cd9643ecab889d4a8d44e0fa358.tar.xz yuzu-8d4c6a1d5e384cd9643ecab889d4a8d44e0fa358.tar.zst yuzu-8d4c6a1d5e384cd9643ecab889d4a8d44e0fa358.zip |
-rw-r--r-- | src/video_core/pica.h | 4 | ||||
-rw-r--r-- | src/video_core/rasterizer.cpp | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index a19f4190c..78603ebdf 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -370,6 +370,10 @@ struct Regs { union { BitField< 0, 1, u32> depth_test_enable; BitField< 4, 3, CompareFunc> depth_test_func; + BitField< 8, 1, u32> red_enable; + BitField< 9, 1, u32> green_enable; + BitField<10, 1, u32> blue_enable; + BitField<11, 1, u32> alpha_enable; BitField<12, 1, u32> depth_write_enable; }; diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 15715c43d..7f66c6d42 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -594,7 +594,14 @@ void ProcessTriangle(const VertexShader::OutputVertex& v0, exit(0); } - DrawPixel(x >> 4, y >> 4, combiner_output); + const Math::Vec4<u8> result = { + registers.output_merger.red_enable ? combiner_output.r() : dest.r(), + registers.output_merger.green_enable ? combiner_output.g() : dest.g(), + registers.output_merger.blue_enable ? combiner_output.b() : dest.b(), + registers.output_merger.alpha_enable ? combiner_output.a() : dest.a() + }; + + DrawPixel(x >> 4, y >> 4, result); } } } |