namespace
{
-const int FLOAT_EXPANSION_E = 0x3FFF;
+const int FLOAT_EXPANSION_E = 0x03FF; // 10 bits error allowed, requires 22 accurate bits
+const int FLOAT_EXPANSION_E_64 = 0x07FF;
GLint64 expandGLFloatToInteger (GLfloat f)
{
using tcu::TestLog;
using tcu::toHex;
- const GLint64 expectedGLStateMax = expandGLFloatToInteger(reference) + FLOAT_EXPANSION_E;
- const GLint64 expectedGLStateMin = expandGLFloatToInteger(reference) - FLOAT_EXPANSION_E;
+ const GLint64 expectedGLStateMax = expandGLFloatToInteger(reference) + FLOAT_EXPANSION_E_64;
+ const GLint64 expectedGLStateMin = expandGLFloatToInteger(reference) - FLOAT_EXPANSION_E_64;
StateQueryMemoryWriteGuard<GLint64> state;
glGetInteger64v(name, &state);
const GLint64 referenceAsGLintMin[] =
{
- expandGLFloatToInteger(reference0) - FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference1) - FLOAT_EXPANSION_E
+ expandGLFloatToInteger(reference0) - FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference1) - FLOAT_EXPANSION_E_64
};
const GLint64 referenceAsGLintMax[] =
{
- expandGLFloatToInteger(reference0) + FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference1) + FLOAT_EXPANSION_E
+ expandGLFloatToInteger(reference0) + FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference1) + FLOAT_EXPANSION_E_64
};
StateQueryMemoryWriteGuard<GLint64[2]> floatVector2;
const GLint64 referenceAsGLintMin[] =
{
- expandGLFloatToInteger(reference0) - FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference1) - FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference2) - FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference3) - FLOAT_EXPANSION_E
+ expandGLFloatToInteger(reference0) - FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference1) - FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference2) - FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference3) - FLOAT_EXPANSION_E_64
};
const GLint64 referenceAsGLintMax[] =
{
- expandGLFloatToInteger(reference0) + FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference1) + FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference2) + FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference3) + FLOAT_EXPANSION_E
+ expandGLFloatToInteger(reference0) + FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference1) + FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference2) + FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference3) + FLOAT_EXPANSION_E_64
};
StateQueryMemoryWriteGuard<GLint64[4]> floatVector4;
namespace
{
-const int FLOAT_EXPANSION_E = 0x03FF;
+const int FLOAT_EXPANSION_E = 0x03FF; // 10 bits error allowed, requires 22 accurate bits
+const int FLOAT_EXPANSION_E_64 = 0x07FF;
GLint64 expandGLFloatToInteger (GLfloat f)
{
if (!state.verifyValidity(testCtx))
return;
- const GLint64 expectedGLStateMax = expandGLFloatToInteger(reference) + FLOAT_EXPANSION_E;
- const GLint64 expectedGLStateMin = expandGLFloatToInteger(reference) - FLOAT_EXPANSION_E;
+ const GLint64 expectedGLStateMax = expandGLFloatToInteger(reference) + FLOAT_EXPANSION_E_64;
+ const GLint64 expectedGLStateMin = expandGLFloatToInteger(reference) - FLOAT_EXPANSION_E_64;
if (state < expectedGLStateMin || state > expectedGLStateMax)
{
const GLint64 referenceAsGLintMin[] =
{
- expandGLFloatToInteger(reference0) - FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference1) - FLOAT_EXPANSION_E
+ expandGLFloatToInteger(reference0) - FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference1) - FLOAT_EXPANSION_E_64
};
const GLint64 referenceAsGLintMax[] =
{
- expandGLFloatToInteger(reference0) + FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference1) + FLOAT_EXPANSION_E
+ expandGLFloatToInteger(reference0) + FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference1) + FLOAT_EXPANSION_E_64
};
if (floatVector2[0] < referenceAsGLintMin[0] || floatVector2[0] > referenceAsGLintMax[0] ||
const GLint64 referenceAsGLintMin[] =
{
- expandGLFloatToInteger(reference0) - FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference1) - FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference2) - FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference3) - FLOAT_EXPANSION_E
+ expandGLFloatToInteger(reference0) - FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference1) - FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference2) - FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference3) - FLOAT_EXPANSION_E_64
};
const GLint64 referenceAsGLintMax[] =
{
- expandGLFloatToInteger(reference0) + FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference1) + FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference2) + FLOAT_EXPANSION_E,
- expandGLFloatToInteger(reference3) + FLOAT_EXPANSION_E
+ expandGLFloatToInteger(reference0) + FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference1) + FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference2) + FLOAT_EXPANSION_E_64,
+ expandGLFloatToInteger(reference3) + FLOAT_EXPANSION_E_64
};
if (floatVector4[0] < referenceAsGLintMin[0] || floatVector4[0] > referenceAsGLintMax[0] ||