Lines Matching full:rnd
207 static glu::VarType generateRandomType (const int maxDepth, int& curStructIdx, vector<const StructType*>& structTypesDst, Random& rnd)
209 const bool isStruct = maxDepth > 0 && rnd.getFloat() < 0.2f;
210 const bool isArray = rnd.getFloat() < 0.3f;
214 const int numMembers = rnd.getInt(1, 5);
218 structType->addMember(("m" + de::toString(i)).c_str(), generateRandomType(maxDepth-1, curStructIdx, structTypesDst, rnd));
221 return isArray ? glu::VarType(glu::VarType(structType), rnd.getInt(1, 5)) : glu::VarType(structType);
225 const glu::DataType basicType = (glu::DataType)s_testDataTypes[rnd.getInt(0, DE_LENGTH_OF_ARRAY(s_testDataTypes)-1)];
227 return isArray ? glu::VarType(glu::VarType(basicType, precision), rnd.getInt(1, 5)) : glu::VarType(basicType, precision);
452 Random rnd (seed);
453 const int numUniforms = rnd.getInt(1, 5);
468 uniform.type = (("u_var" + de::toString(i)).c_str(), generateRandomType(3, structIdx, structTypes, rnd));
578 static VarValue generateRandomVarValue (const glu::DataType type, Random& rnd, int samplerUnit = -1 /* Used if type is a sampler type. \note Samplers' unit numbers are not randomized. */)
589 result.val.floatV[i] = rnd.getFloat(-10.0f, 10.0f);
594 result.val.intV[i] = rnd.getInt(-10, 10);
599 result.val.boolV[i] = rnd.getBool();
606 result.val.samplerV.fillColor[i] = rnd.getFloat(0.0f, 1.0f);
684 static VarValue getRandomBoolRepresentation (const VarValue& boolValue, const glu::DataType targetScalarType, Random& rnd)
700 result.val.intV[i] = rnd.getInt(-10, 10);
714 result.val.floatV[i] = rnd.getFloat(-10.0f, 10.0f);
873 // Assign the basicUniforms[].finalValue values for uniforms. \note rnd parameter is for booleans (true can be any nonzero value).
874 void assignUniforms (const vector<BasicUniform>& basicUniforms, deUint32 programGL, Random& rnd);
878 bool renderTest (const vector<BasicUniform>& basicUniforms, const ShaderProgram& program, Random& rnd);
880 virtual bool test (const vector<BasicUniform>& basicUniforms, const vector<BasicUniformReportRef>& basicUniformReportsRef, const ShaderProgram& program, Random& rnd) = 0;
896 Random& rnd) const;
923 Random rnd(seed);
927 #define ARRAY_CHOICE(ARR) (ARR[rnd.getInt(0, DE_LENGTH_OF_ARRAY(ARR)-1)])
1011 void UniformCase::generateBasicUniforms (vector<BasicUniform>& basicUniformsDst, vector<BasicUniformReportRef>& basicUniformReportsDst, const glu::VarType& varType, const char* const varName, const bool isParentActive, int& samplerUnitCounter, Random& rnd) const
1018 : glu::isDataTypeSampler(type) ? generateRandomVarValue(type, rnd, samplerUnitCounter++)
1019 : generateRandomVarValue(varType.getBasicType(), rnd);
1044 : glu::isDataTypeSampler(elemBasicType) ? generateRandomVarValue(elemBasicType, rnd, samplerUnitCounter++)
1045 : generateRandomVarValue(elemBasicType, rnd);
1050 generateBasicUniforms(basicUniformsDst, basicUniformReportsDst, varType.getElementType(), indexedName.c_str(), isCurElemActive, samplerUnitCounter, rnd);
1072 generateBasicUniforms(basicUniformsDst, basicUniformReportsDst, member.getType(), memberFullName.c_str(), isParentActive, samplerUnitCounter, rnd);
1479 void UniformCase::assignUniforms (const vector<BasicUniform>& basicUniforms, deUint32 programGL, Random& rnd)
1524 const VarValue apiValue = glu::isDataTypeBoolOrBVec(unifValue.type) ? getRandomBoolRepresentation(unifValue, boolApiType, rnd)
1663 bool UniformCase::renderTest (const vector<BasicUniform>& basicUniforms, const ShaderProgram& program, Random& rnd)
1669 const int viewportX = rnd.getInt(0, renderTarget.getWidth() - viewportW);
1670 const int viewportY = rnd.getInt(0, renderTarget.getHeight() - viewportH);
1742 Random rnd
1750 generateBasicUniforms(basicUniforms, basicUniformReportsRef, m_uniformCollection->getUniform(i).type, m_uniformCollection->getUniform(i).name.c_str(), true, samplerUnitCounter, rnd);
1767 const bool success = test(basicUniforms, basicUniformReportsRef, program, rnd);
1778 bool test (const vector<BasicUniform>& basicUniforms, const vector<BasicUniformReportRef>& basicUniformReportsRef, const ShaderProgram& program, Random& rnd);
1786 bool UniformInfoQueryCase::test (const vector<BasicUniform>& basicUniforms, const vector<BasicUniformReportRef>& basicUniformReportsRef, const ShaderProgram& program, Random& rnd)
1789 DE_UNREF(rnd);
1839 bool test (const vector<BasicUniform>& basicUniforms, const vector<BasicUniformReportRef>& basicUniformReportsRef, const ShaderProgram& program, Random& rnd);
1930 bool UniformValueCase::test (const vector<BasicUniform>& basicUniforms, const vector<BasicUniformReportRef>& basicUniformReportsRef, const ShaderProgram& program, Random& rnd)
1940 assignUniforms(basicUniforms, programGL, rnd);
1980 const bool success = renderTest(basicUniforms, program, rnd);
1994 bool test (const vector<BasicUniform>& basicUniforms, const vector<BasicUniformReportRef>& basicUniformReportsRef, const ShaderProgram& program, Random& rnd);
2002 bool RandomUniformCase::test (const vector<BasicUniform>& basicUniforms, const vector<BasicUniformReportRef>& basicUniformReportsRef, const ShaderProgram& program, Random& rnd)
2007 bool performGetActiveUniforms = rnd.getBool();
2008 const bool performGetUniforms = rnd.getBool();
2009 const bool performCheckUniformDefaultValues = performGetUniforms && rnd.getBool();
2010 const bool performAssignUniforms = rnd.getBool();
2011 const bool performCompareUniformValues = performGetUniforms && performAssignUniforms && rnd.getBool();
2012 const bool performRenderTest = renderingPossible && performAssignUniforms && rnd.getBool();
2049 assignUniforms(basicUniforms, programGL, rnd);
2059 PERFORM_AND_CHECK(renderTest(basicUniforms, program, rnd), "RenderTest", "Render test");