Import fixes from main repo:
authorPyry Haulos <phaulos@google.com>
Fri, 26 Sep 2014 22:34:05 +0000 (15:34 -0700)
committerPyry Haulos <phaulos@google.com>
Fri, 26 Sep 2014 23:05:31 +0000 (16:05 -0700)
 * Ensure input colors are valid premultiplied values in advanced
   blending tests
 * Limit input values in mediump fma() tests to avoid overflow
 * Add necessary barrier() calls to ssbo_local_barrier tests

Change-Id: I111c58027dbdbba31047d4333dc82c10855ec75e

modules/gles31/functional/es31fAdvancedBlendTests.cpp
modules/gles31/functional/es31fBasicComputeShaderTests.cpp
modules/gles31/functional/es31fShaderCommonFunctionTests.cpp

index 8e4b1df..dcde00f 100644 (file)
@@ -335,10 +335,11 @@ static tcu::Vec4 randomColor (de::Random* rnd)
        const float rgbValues[]         = { 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f };
        const float alphaValues[]       = { 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f };
 
-       const float r = rnd->choose<float>(DE_ARRAY_BEGIN(rgbValues), DE_ARRAY_END(rgbValues));
-       const float g = rnd->choose<float>(DE_ARRAY_BEGIN(rgbValues), DE_ARRAY_END(rgbValues));
-       const float b = rnd->choose<float>(DE_ARRAY_BEGIN(rgbValues), DE_ARRAY_END(rgbValues));
+       // \note Spec assumes premultiplied inputs.
        const float a = rnd->choose<float>(DE_ARRAY_BEGIN(alphaValues), DE_ARRAY_END(alphaValues));
+       const float r = a * rnd->choose<float>(DE_ARRAY_BEGIN(rgbValues), DE_ARRAY_END(rgbValues));
+       const float g = a * rnd->choose<float>(DE_ARRAY_BEGIN(rgbValues), DE_ARRAY_END(rgbValues));
+       const float b = a * rnd->choose<float>(DE_ARRAY_BEGIN(rgbValues), DE_ARRAY_END(rgbValues));
        return tcu::Vec4(r, g, b, a);
 }
 
index 1b2513e..12b2f62 100644 (file)
@@ -614,8 +614,10 @@ public:
                        << "\n"
                        << "    sb_out.values[globalOffs + localOffs] = globalOffs;\n"
                        << "    memoryBarrierBuffer();\n"
+                       << "    barrier();\n"
                        << "    sb_out.values[globalOffs + ((localOffs+1u)%localSize)] += localOffs;\n"
                        << "    memoryBarrierBuffer();\n"
+                       << "    barrier();\n"
                        << "    sb_out.values[globalOffs + ((localOffs+2u)%localSize)] += localOffs;\n"
                        << "}\n";
 
index 7327532..3aec886 100644 (file)
@@ -1931,7 +1931,7 @@ public:
                const Vec2 ranges[] =
                {
                        Vec2(-2.0f,             2.0f),  // lowp
-                       Vec2(-1e3f,             1e3f),  // mediump
+                       Vec2(-127.f,    127.f), // mediump
                        Vec2(-1e7f,             1e7f)   // highp
                };