summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2017-03-05 01:52:24 +0000
committerTillmann Karras <tilkax@gmail.com>2017-03-05 01:53:54 +0000
commit8a72e84ece81da83b46a747601c22e1146771213 (patch)
tree97a1a9c939339cb542164c4b2959e20338c1ed84 /Source/Core/VideoCommon/PixelShaderGen.cpp
parentc2594695b8beda137c808e666b0651a1f09a293c (diff)
VideoCommon: remove unnecessary trunc()
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 3c09e200f0..608248fab8 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -379,11 +379,6 @@ ShaderCode GeneratePixelShaderCode(APIType ApiType, const pixel_shader_uid_data*
"int3 iround(float3 x) { return int3(round(x)); }\n"
"int4 iround(float4 x) { return int4(round(x)); }\n\n");
- out.Write("int itrunc(float x) { return int (trunc(x)); }\n"
- "int2 itrunc(float2 x) { return int2(trunc(x)); }\n"
- "int3 itrunc(float3 x) { return int3(trunc(x)); }\n"
- "int4 itrunc(float4 x) { return int4(trunc(x)); }\n\n");
-
if (ApiType == APIType::OpenGL)
{
out.Write("SAMPLER_BINDING(0) uniform sampler2DArray samp[8];\n");
@@ -661,7 +656,7 @@ ShaderCode GeneratePixelShaderCode(APIType ApiType, const pixel_shader_uid_data*
out.SetConstantsUsed(C_TEXDIMS, C_TEXDIMS + uid_data->genMode_numtexgens - 1);
for (unsigned int i = 0; i < uid_data->genMode_numtexgens; ++i)
{
- out.Write("\tint2 fixpoint_uv%d = itrunc(", i);
+ out.Write("\tint2 fixpoint_uv%d = int2(", i);
out.Write("(uv%d.z == 0.0 ? uv%d.xy : uv%d.xy / uv%d.z)", i, i, i, i);
out.Write(" * " I_TEXDIMS "[%d].zw);\n", i);
// TODO: S24 overflows here?