summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2017-06-28 12:37:14 -0500
committerGravatar wwylele2017-07-11 19:39:15 +0300
commit7526af5e52ac1e24512faa1cd8f1a169407689fb (patch)
treeed30b99b01bbb5dd13cb0314d8855c7353520e95 /src
parentSwRasterizer/Lighting: Do not use global registers state in ComputeFragmentsC... (diff)
downloadyuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.tar.gz
yuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.tar.xz
yuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.zip
SwRasterizer/Lighting: Move the lighting enable check outside the ComputeFragmentsColors function.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index d2d77e8b0..b2d2b6ef2 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -132,9 +132,6 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
132 const Pica::LightingRegs& lighting, const Math::Quaternion<float>& normquat, 132 const Pica::LightingRegs& lighting, const Math::Quaternion<float>& normquat,
133 const Math::Vec3<float>& view) { 133 const Math::Vec3<float>& view) {
134 134
135 if (lighting.disable)
136 return {Math::MakeVec<u8>(0, 0, 0, 0), Math::MakeVec<u8>(0, 0, 0, 0)};
137
138 // TODO(Subv): Bump mapping 135 // TODO(Subv): Bump mapping
139 Math::Vec3<float> surface_normal = {0.0f, 0.0f, 1.0f}; 136 Math::Vec3<float> surface_normal = {0.0f, 0.0f, 1.0f};
140 137
@@ -728,11 +725,13 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
728 regs.texturing.tev_combiner_buffer_color.a, 725 regs.texturing.tev_combiner_buffer_color.a,
729 }; 726 };
730 727
731 Math::Vec4<u8> primary_fragment_color; 728 Math::Vec4<u8> primary_fragment_color = {0, 0, 0, 0};
732 Math::Vec4<u8> secondary_fragment_color; 729 Math::Vec4<u8> secondary_fragment_color = {0, 0, 0, 0};
733 730
734 std::tie(primary_fragment_color, secondary_fragment_color) = 731 if (!g_state.regs.lighting.disable) {
735 ComputeFragmentsColors(g_state.regs.lighting, normquat, fragment_position); 732 std::tie(primary_fragment_color, secondary_fragment_color) =
733 ComputeFragmentsColors(g_state.regs.lighting, normquat, fragment_position);
734 }
736 735
737 for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size(); 736 for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
738 ++tev_stage_index) { 737 ++tev_stage_index) {