summaryrefslogtreecommitdiff
path: root/src/video_core/rasterizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/rasterizer.cpp')
-rw-r--r--src/video_core/rasterizer.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index dbdc37ce6..f815d6cf0 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -268,10 +268,8 @@ static u8 PerformStencilAction(Regs::StencilAction action, u8 old_stencil, u8 re
268 268
269// NOTE: Assuming that rasterizer coordinates are 12.4 fixed-point values 269// NOTE: Assuming that rasterizer coordinates are 12.4 fixed-point values
270struct Fix12P4 { 270struct Fix12P4 {
271 Fix12P4() { 271 Fix12P4() {}
272 } 272 Fix12P4(u16 val) : val(val) {}
273 Fix12P4(u16 val) : val(val) {
274 }
275 273
276 static u16 FracMask() { 274 static u16 FracMask() {
277 return 0xF; 275 return 0xF;
@@ -491,7 +489,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
491 255), 489 255),
492 (u8)( 490 (u8)(
493 GetInterpolatedAttribute(v0.color.a(), v1.color.a(), v2.color.a()).ToFloat32() * 491 GetInterpolatedAttribute(v0.color.a(), v1.color.a(), v2.color.a()).ToFloat32() *
494 255)}; 492 255),
493 };
495 494
496 Math::Vec2<float24> uv[3]; 495 Math::Vec2<float24> uv[3];
497 uv[0].u() = GetInterpolatedAttribute(v0.tc0.u(), v1.tc0.u(), v2.tc0.u()); 496 uv[0].u() = GetInterpolatedAttribute(v0.tc0.u(), v1.tc0.u(), v2.tc0.u());
@@ -604,7 +603,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
604 Math::Vec4<u8> combiner_buffer = {0, 0, 0, 0}; 603 Math::Vec4<u8> combiner_buffer = {0, 0, 0, 0};
605 Math::Vec4<u8> next_combiner_buffer = { 604 Math::Vec4<u8> next_combiner_buffer = {
606 regs.tev_combiner_buffer_color.r, regs.tev_combiner_buffer_color.g, 605 regs.tev_combiner_buffer_color.r, regs.tev_combiner_buffer_color.g,
607 regs.tev_combiner_buffer_color.b, regs.tev_combiner_buffer_color.a}; 606 regs.tev_combiner_buffer_color.b, regs.tev_combiner_buffer_color.a,
607 };
608 608
609 for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size(); 609 for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
610 ++tev_stage_index) { 610 ++tev_stage_index) {
@@ -841,18 +841,16 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
841 Math::Vec3<u8> color_result[3] = { 841 Math::Vec3<u8> color_result[3] = {
842 GetColorModifier(tev_stage.color_modifier1, GetSource(tev_stage.color_source1)), 842 GetColorModifier(tev_stage.color_modifier1, GetSource(tev_stage.color_source1)),
843 GetColorModifier(tev_stage.color_modifier2, GetSource(tev_stage.color_source2)), 843 GetColorModifier(tev_stage.color_modifier2, GetSource(tev_stage.color_source2)),
844 GetColorModifier(tev_stage.color_modifier3, 844 GetColorModifier(tev_stage.color_modifier3, GetSource(tev_stage.color_source3)),
845 GetSource(tev_stage.color_source3))}; 845 };
846 auto color_output = ColorCombine(tev_stage.color_op, color_result); 846 auto color_output = ColorCombine(tev_stage.color_op, color_result);
847 847
848 // alpha combiner 848 // alpha combiner
849 std::array<u8, 3> alpha_result = { 849 std::array<u8, 3> alpha_result = {{
850 {GetAlphaModifier(tev_stage.alpha_modifier1, 850 GetAlphaModifier(tev_stage.alpha_modifier1, GetSource(tev_stage.alpha_source1)),
851 GetSource(tev_stage.alpha_source1)), 851 GetAlphaModifier(tev_stage.alpha_modifier2, GetSource(tev_stage.alpha_source2)),
852 GetAlphaModifier(tev_stage.alpha_modifier2, 852 GetAlphaModifier(tev_stage.alpha_modifier3, GetSource(tev_stage.alpha_source3)),
853 GetSource(tev_stage.alpha_source2)), 853 }};
854 GetAlphaModifier(tev_stage.alpha_modifier3,
855 GetSource(tev_stage.alpha_source3))}};
856 auto alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result); 854 auto alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result);
857 855
858 combiner_output[0] = 856 combiner_output[0] =
@@ -1083,7 +1081,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
1083 static_cast<u8>(output_merger.blend_const.r), 1081 static_cast<u8>(output_merger.blend_const.r),
1084 static_cast<u8>(output_merger.blend_const.g), 1082 static_cast<u8>(output_merger.blend_const.g),
1085 static_cast<u8>(output_merger.blend_const.b), 1083 static_cast<u8>(output_merger.blend_const.b),
1086 static_cast<u8>(output_merger.blend_const.a)}; 1084 static_cast<u8>(output_merger.blend_const.a),
1085 };
1087 1086
1088 switch (factor) { 1087 switch (factor) {
1089 case Regs::BlendFactor::Zero: 1088 case Regs::BlendFactor::Zero:
@@ -1267,11 +1266,12 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
1267 LogicOp(combiner_output.a(), dest.a(), output_merger.logic_op)); 1266 LogicOp(combiner_output.a(), dest.a(), output_merger.logic_op));
1268 } 1267 }
1269 1268
1270 const Math::Vec4<u8> result = {output_merger.red_enable ? blend_output.r() : dest.r(), 1269 const Math::Vec4<u8> result = {
1271 output_merger.green_enable ? blend_output.g() : dest.g(), 1270 output_merger.red_enable ? blend_output.r() : dest.r(),
1272 output_merger.blue_enable ? blend_output.b() : dest.b(), 1271 output_merger.green_enable ? blend_output.g() : dest.g(),
1273 output_merger.alpha_enable ? blend_output.a() 1272 output_merger.blue_enable ? blend_output.b() : dest.b(),
1274 : dest.a()}; 1273 output_merger.alpha_enable ? blend_output.a() : dest.a(),
1274 };
1275 1275
1276 if (regs.framebuffer.allow_color_write != 0) 1276 if (regs.framebuffer.allow_color_write != 0)
1277 DrawPixel(x >> 4, y >> 4, result); 1277 DrawPixel(x >> 4, y >> 4, result);