mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
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.
This commit is contained in:
parent
31594a8138
commit
56fdcf5f00
3 changed files with 3 additions and 3 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue