summaryrefslogtreecommitdiffstats
path: root/src/video_core/swrasterizer
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-06-28 19:37:14 +0200
committerwwylele <wwylele@gmail.com>2017-07-11 18:39:15 +0200
commit7526af5e52ac1e24512faa1cd8f1a169407689fb (patch)
treeed30b99b01bbb5dd13cb0314d8855c7353520e95 /src/video_core/swrasterizer
parentSwRasterizer/Lighting: Do not use global registers state in ComputeFragmentsColors. (diff)
downloadyuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.tar
yuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.tar.gz
yuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.tar.bz2
yuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.tar.lz
yuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.tar.xz
yuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.tar.zst
yuzu-7526af5e52ac1e24512faa1cd8f1a169407689fb.zip
Diffstat (limited to 'src/video_core/swrasterizer')
-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(
const Pica::LightingRegs& lighting, const Math::Quaternion<float>& normquat,
const Math::Vec3<float>& view) {
- if (lighting.disable)
- return {Math::MakeVec<u8>(0, 0, 0, 0), Math::MakeVec<u8>(0, 0, 0, 0)};
-
// TODO(Subv): Bump mapping
Math::Vec3<float> surface_normal = {0.0f, 0.0f, 1.0f};
@@ -728,11 +725,13 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
regs.texturing.tev_combiner_buffer_color.a,
};
- Math::Vec4<u8> primary_fragment_color;
- Math::Vec4<u8> secondary_fragment_color;
+ Math::Vec4<u8> primary_fragment_color = {0, 0, 0, 0};
+ Math::Vec4<u8> secondary_fragment_color = {0, 0, 0, 0};
- std::tie(primary_fragment_color, secondary_fragment_color) =
- ComputeFragmentsColors(g_state.regs.lighting, normquat, fragment_position);
+ if (!g_state.regs.lighting.disable) {
+ std::tie(primary_fragment_color, secondary_fragment_color) =
+ ComputeFragmentsColors(g_state.regs.lighting, normquat, fragment_position);
+ }
for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
++tev_stage_index) {