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 a387e97..71c7be2 100644 (file)
@@ -551,7 +551,14 @@ string genFrgShaderSrc (deUint32                                                   seed,
 
        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";