Commit ee0d4c52 by Olli Etuaho

Revert "UniformTest.FloatUniformStateQuery do computations in doubles"

This change broke standalone build on Windows. Two casts from double to GLfloat were missing. This reverts commit 7aa4cae2. BUG=angleproject:891 Change-Id: I69cf773c940fd43b06f21c1ee86e60bac6825684 Reviewed-on: https://chromium-review.googlesource.com/303352Reviewed-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent 630d85cb
......@@ -170,35 +170,36 @@ TEST_P(UniformTest, UniformArrayLocations)
// Test that float to integer GetUniform rounds values correctly.
TEST_P(UniformTest, FloatUniformStateQuery)
{
std::vector<double> inValues;
std::vector<GLfloat> inValues;
std::vector<GLfloat> expectedFValues;
std::vector<GLint> expectedIValues;
double intMaxD = static_cast<double>(std::numeric_limits<GLint>::max());
double intMinD = static_cast<double>(std::numeric_limits<GLint>::min());
GLfloat intMaxF = static_cast<GLfloat>(std::numeric_limits<GLint>::max());
GLfloat intMinF = static_cast<GLfloat>(std::numeric_limits<GLint>::min());
// TODO(jmadill): Investigate rounding of .5
inValues.push_back(-1.0);
inValues.push_back(-0.6);
// inValues.push_back(-0.5); // undefined behaviour?
inValues.push_back(-0.4);
inValues.push_back(0.0);
inValues.push_back(0.4);
// inValues.push_back(0.5); // undefined behaviour?
inValues.push_back(0.6);
inValues.push_back(1.0);
inValues.push_back(999999.2);
inValues.push_back(intMaxD * 2.0);
inValues.push_back(intMaxD + 1.0);
inValues.push_back(intMinD * 2.0);
inValues.push_back(intMinD - 1.0);
for (double value : inValues)
inValues.push_back(-1.0f);
inValues.push_back(-0.6f);
// inValues.push_back(-0.5f); // undefined behaviour?
inValues.push_back(-0.4f);
inValues.push_back(0.0f);
inValues.push_back(0.4f);
// inValues.push_back(0.5f); // undefined behaviour?
inValues.push_back(0.6f);
inValues.push_back(1.0f);
inValues.push_back(999999.2f);
inValues.push_back(intMaxF * 2.0f);
inValues.push_back(intMaxF + 1.0f);
inValues.push_back(intMinF * 2.0f);
inValues.push_back(intMinF - 1.0f);
for (GLfloat value : inValues)
{
expectedFValues.push_back(static_cast<GLfloat>(value));
expectedFValues.push_back(value);
double clampedValue = std::max(intMinD, std::min(intMaxD, value));
double rounded = round(clampedValue);
GLfloat clampedValue = std::max(intMinF, std::min(intMaxF, value));
GLfloat rounded = roundf(clampedValue);
expectedIValues.push_back(static_cast<GLint>(rounded));
}
......
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