summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderPixel.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2018-09-19 04:30:31 +0100
committerTillmann Karras <tilkax@gmail.com>2018-10-09 00:31:43 +0100
commit56fdcf5f00a8066617ae738652ab041614b0938a (patch)
tree27ea67ace40234c2bd47c3d3f7f47d3c4d8ae320 /Source/Core/VideoCommon/UberShaderPixel.cpp
parent31594a81388d08f4989cf7031062d023b78f88ed (diff)
VideoCommon: remove unnecessary floor()
floatindex is clamped to the range [0, 9]. For non-negative numbers floor() is equivalent to trunc(). Truncation happens implicitly when converting to uint, so the floor() is unnecessary.
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderPixel.cpp')
-rw-r--r--Source/Core/VideoCommon/UberShaderPixel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp
index 9c9630886a..6c5f6f84fe 100644
--- a/Source/Core/VideoCommon/UberShaderPixel.cpp
+++ b/Source/Core/VideoCommon/UberShaderPixel.cpp
@@ -1171,7 +1171,7 @@ ShaderCode GenPixelShader(APIType ApiType, const ShaderHostConfig& host_config,
" // ze *= x_adjust\n"
" float offset = (2.0 * (rawpos.x / " I_FOGF ".w)) - 1.0 - " I_FOGF ".z;\n"
" float floatindex = clamp(9.0 - abs(offset) * 9.0, 0.0, 9.0);\n"
- " uint indexlower = uint(floor(floatindex));\n"
+ " uint indexlower = uint(floatindex);\n"
" uint indexupper = indexlower + 1u;\n"
" float klower = " I_FOGRANGE "[indexlower >> 2u][indexlower & 3u];\n"
" float kupper = " I_FOGRANGE "[indexupper >> 2u][indexupper & 3u];\n"