Relax mediump interpolation accuracy requirements and clarify thresholds
authorPyry Haulos <phaulos@google.com>
Fri, 13 Feb 2015 18:58:03 +0000 (10:58 -0800)
committerPyry Haulos <phaulos@google.com>
Fri, 13 Feb 2015 19:18:12 +0000 (19:18 +0000)
This change relaxes mediump interpolation accuracy in
dEQP-GLES3.functional.fragment_out.* to 4 ULP from 1 ULP.

Threshold computation is also fixed/clarified by moving interpolation
threshold to be dependent on precision qualifier, and allowing only
rounding difference in format-dependent threshold. The original error
was likely due to incorrectly accomodating for interpolation in format
threshold.

Bug: 19380820
Change-Id: I457a9b7e07bad94399d07f37caa29d65ad95a5c8

modules/gles3/functional/es3fFragmentOutputTests.cpp

index 319dcc9..f7fb0ad 100644 (file)
@@ -825,21 +825,23 @@ FragmentOutputCase::IterateResult FragmentOutputCase::iterate (void)
                                deUint32        precThreshold   = 0;    //!< Threshold computed based on output type precision
                                UVec4           finalThreshold;
 
+                               // 1 ULP rounding error is allowed for smaller floating-point formats
                                switch (format.type)
                                {
-                                       case tcu::TextureFormat::FLOAT:                                                 formatThreshold = UVec4(4);                                                                             break;
-                                       case tcu::TextureFormat::HALF_FLOAT:                                    formatThreshold = UVec4((1<<13) + 4);                                                   break;
-                                       case tcu::TextureFormat::UNSIGNED_INT_11F_11F_10F_REV:  formatThreshold = UVec4((1<<17) + 4, (1<<17)+4, (1<<18)+4, 4);  break;
+                                       case tcu::TextureFormat::FLOAT:                                                 formatThreshold = UVec4(0);                                                                                     break;
+                                       case tcu::TextureFormat::HALF_FLOAT:                                    formatThreshold = UVec4((1<<(23-10)));                                                          break;
+                                       case tcu::TextureFormat::UNSIGNED_INT_11F_11F_10F_REV:  formatThreshold = UVec4((1<<(23-6)), (1<<(23-6)), (1<<(23-5)), 0);      break;
                                        default:
                                                DE_ASSERT(false);
                                                break;
                                }
 
+                               // 4 ULP interpolation
                                switch (outPrecision)
                                {
-                                       case glu::PRECISION_LOWP:               precThreshold   = (1<<21);      break;
-                                       case glu::PRECISION_MEDIUMP:    precThreshold   = (1<<13);      break;
-                                       case glu::PRECISION_HIGHP:              precThreshold   = 0;            break;
+                                       case glu::PRECISION_LOWP:               precThreshold   = (4<<(23-8));  break;
+                                       case glu::PRECISION_MEDIUMP:    precThreshold   = (4<<(23-10)); break;
+                                       case glu::PRECISION_HIGHP:              precThreshold   = 4;                    break;
                                        default:
                                                DE_ASSERT(false);
                                }