Bump float->int64 conversion threshold by one bit.
authorJarkko Pöyry <jpoyry@google.com>
Mon, 22 Jun 2015 20:36:15 +0000 (13:36 -0700)
committerJarkko Pöyry <jpoyry@google.com>
Mon, 22 Jun 2015 20:50:27 +0000 (13:50 -0700)
Bug: 22008195
Change-Id: I4e597eb6b5ead08c0582579920ca6bb47df8bd2c

modules/gles2/functional/es2fFloatStateQueryTests.cpp
modules/gles3/functional/es3fFloatStateQueryTests.cpp

index 8d8c1b3..9f9939e 100644 (file)
@@ -48,7 +48,8 @@ namespace FloatStateQueryVerifiers
 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)
 {
@@ -476,8 +477,8 @@ void GetInteger64Verifier::verifyFloatExpanded (tcu::TestContext& testCtx, GLenu
        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);
@@ -503,13 +504,13 @@ void GetInteger64Verifier::verifyFloat2Expanded (tcu::TestContext& testCtx, GLen
 
        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;
@@ -541,17 +542,17 @@ void GetInteger64Verifier::verifyFloat4Color (tcu::TestContext& testCtx, GLenum
 
        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;
index 1c00af4..65f88a5 100644 (file)
@@ -48,7 +48,8 @@ namespace FloatStateQueryVerifiers
 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)
 {
@@ -536,8 +537,8 @@ void GetInteger64Verifier::verifyFloatExpanded (tcu::TestContext& testCtx, GLenu
        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)
        {
@@ -563,13 +564,13 @@ void GetInteger64Verifier::verifyFloat2Expanded (tcu::TestContext& testCtx, GLen
 
        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] ||
@@ -601,17 +602,17 @@ void GetInteger64Verifier::verifyFloat4Color (tcu::TestContext& testCtx, GLenum
 
        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] ||