Vary fragment shader in separate shader random tests.
authorJarkko Pöyry <jpoyry@google.com>
Thu, 26 Feb 2015 02:14:28 +0000 (18:14 -0800)
committerJarkko Poyry <jpoyry@google.com>
Tue, 3 Mar 2015 21:21:37 +0000 (21:21 +0000)
- Use supplied random seed in genFrgShaderSrc to vary generated fragment
  shaders slightly. This prevents random test cases from always using
  identical fragment shader pipeline programs. Prior to this CL, the
  supplied random seed was unused.

Change-Id: Ib74b16cc92f41181a415966a4f2e4feab83781af

modules/gles31/functional/es31fSeparateShaderTests.cpp

index a387e97e4a61c9341c9f0250a906eb41cc92d47a..71c7be27559e8adca4845d7dfd3d9da49f623a23 100644 (file)
@@ -551,7 +551,14 @@ string genFrgShaderSrc (deUint32                                                   seed,
 
        if (inputs.size() > 0)
        {
 
        if (inputs.size() > 0)
        {
-               oss << "\t" << "switch (imod(int(0.5 * (gl_FragCoord.x - gl_FragCoord.y)), "
+               oss << "\t"
+                       << "switch (imod(int(0.5 * (";
+
+               printFloat(oss, rnd.getFloat(0.5f, 2.0f));
+               oss << " * gl_FragCoord.x - ";
+
+               printFloat(oss, rnd.getFloat(0.5f, 2.0f));
+               oss << " * gl_FragCoord.y)), "
                        << inputs.size() << "))" << "\n"
                        << "\t" << "{" << "\n";
 
                        << inputs.size() << "))" << "\n"
                        << "\t" << "{" << "\n";