summaryrefslogtreecommitdiff
path: root/src/video_core/swrasterizer/rasterizer.cpp
diff options
context:
space:
mode:
authorGravatar Subv2017-06-28 12:35:35 -0500
committerGravatar wwylele2017-07-11 19:39:15 +0300
commitb8229a768434ab9b47123359669761c05ecdd6b0 (patch)
treee5ca7862ea6ae36e0228b6c857cc96ae675ac006 /src/video_core/swrasterizer/rasterizer.cpp
parentSwRasterizer/Lighting: Do not use global state in LookupLightingLut. (diff)
downloadyuzu-b8229a768434ab9b47123359669761c05ecdd6b0.tar.gz
yuzu-b8229a768434ab9b47123359669761c05ecdd6b0.tar.xz
yuzu-b8229a768434ab9b47123359669761c05ecdd6b0.zip
SwRasterizer/Lighting: Do not use global registers state in ComputeFragmentsColors.
Diffstat (limited to 'src/video_core/swrasterizer/rasterizer.cpp')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index b69f7b692..d2d77e8b0 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -129,8 +129,8 @@ static float LookupLightingLut(const Pica::State::Lighting& lighting, size_t lut
129} 129}
130 130
131std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors( 131std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
132 const Math::Quaternion<float>& normquat, const Math::Vec3<float>& view) { 132 const Pica::LightingRegs& lighting, const Math::Quaternion<float>& normquat,
133 const auto& lighting = g_state.regs.lighting; 133 const Math::Vec3<float>& view) {
134 134
135 if (lighting.disable) 135 if (lighting.disable)
136 return {Math::MakeVec<u8>(0, 0, 0, 0), Math::MakeVec<u8>(0, 0, 0, 0)}; 136 return {Math::MakeVec<u8>(0, 0, 0, 0), Math::MakeVec<u8>(0, 0, 0, 0)};
@@ -732,7 +732,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
732 Math::Vec4<u8> secondary_fragment_color; 732 Math::Vec4<u8> secondary_fragment_color;
733 733
734 std::tie(primary_fragment_color, secondary_fragment_color) = 734 std::tie(primary_fragment_color, secondary_fragment_color) =
735 ComputeFragmentsColors(normquat, fragment_position); 735 ComputeFragmentsColors(g_state.regs.lighting, normquat, fragment_position);
736 736
737 for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size(); 737 for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
738 ++tev_stage_index) { 738 ++tev_stage_index) {