summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar wwylele2017-07-11 22:19:00 +0300
committerGravatar wwylele2017-07-11 22:19:00 +0300
commit4feff63ffaec4d62d5bdfc85968cc99298907767 (patch)
treedee2f575a20a60d1c62bd8f6b5993de5ffb9b60a /src
parentSwRasterizer/Lighting: unify float suffix (diff)
downloadyuzu-4feff63ffaec4d62d5bdfc85968cc99298907767.tar.gz
yuzu-4feff63ffaec4d62d5bdfc85968cc99298907767.tar.xz
yuzu-4feff63ffaec4d62d5bdfc85968cc99298907767.zip
SwRasterizer/Lighting: dist atten lut input need to be clamp
Diffstat (limited to 'src')
-rw-r--r--src/video_core/swrasterizer/rasterizer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp
index c83680629..37d1313cf 100644
--- a/src/video_core/swrasterizer/rasterizer.cpp
+++ b/src/video_core/swrasterizer/rasterizer.cpp
@@ -171,7 +171,7 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
171 size_t lut = 171 size_t lut =
172 static_cast<size_t>(LightingRegs::LightingSampler::DistanceAttenuation) + num; 172 static_cast<size_t>(LightingRegs::LightingSampler::DistanceAttenuation) + num;
173 173
174 float sample_loc = scale * distance + bias; 174 float sample_loc = MathUtil::Clamp(scale * distance + bias, 0.0f, 1.0f);
175 175
176 u8 lutindex = 176 u8 lutindex =
177 static_cast<u8>(MathUtil::Clamp(std::floor(sample_loc * 256.0f), 0.0f, 255.0f)); 177 static_cast<u8>(MathUtil::Clamp(std::floor(sample_loc * 256.0f), 0.0f, 255.0f));