Commit 3ed16305 by Alexis Hetu Committed by Alexis Hétu

Floating point parameters should be rounded, not truncated

Bug 20724899 Change-Id: I03f858ee3d159cfa2541afa1d8d063ca99701a4c Reviewed-on: https://swiftshader-review.googlesource.com/3964Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent cef77793
......@@ -5910,7 +5910,7 @@ void TexParameterf(GLenum target, GLenum pname, GLfloat param)
}
break;
case GL_TEXTURE_BASE_LEVEL:
if(clientVersion < 3 || !texture->setBaseLevel((GLint)param))
if(clientVersion < 3 || !texture->setBaseLevel((GLint)(roundf(param))))
{
return error(GL_INVALID_VALUE);
}
......@@ -5934,7 +5934,7 @@ void TexParameterf(GLenum target, GLenum pname, GLfloat param)
}
break;
case GL_TEXTURE_MAX_LEVEL:
if(clientVersion < 3 || !texture->setMaxLevel((GLint)param))
if(clientVersion < 3 || !texture->setMaxLevel((GLint)(roundf(param))))
{
return error(GL_INVALID_VALUE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment