Lines Matching defs:value
621 static string shaderVarValueStr (const VarValue& value)
623 const int numElems = glu::getDataTypeScalarSize(value.type);
627 result << glu::getDataTypeName(value.type) << "(";
634 if (glu::isDataTypeFloatOrVec(value.type) || glu::isDataTypeMatrix(value.type))
635 result << de::floatToString(value.val.floatV[i], 2);
636 else if (glu::isDataTypeIntOrIVec((value.type)))
637 result << de::toString(value.val.intV[i]);
638 else if (glu::isDataTypeUintOrUVec((value.type)))
639 result << de::toString(value.val.uintV[i]) << "u";
640 else if (glu::isDataTypeBoolOrBVec((value.type)))
641 result << (value.val.boolV[i] ? "true" : "false");
642 else if (glu::isDataTypeSampler((value.type)))
643 result << shaderVarValueStr(getSamplerFillValue(value));
654 static string apiVarValueStr (const VarValue& value)
656 const int numElems = glu::getDataTypeScalarSize(value.type);
667 if (glu::isDataTypeFloatOrVec(value.type) || glu::isDataTypeMatrix(value.type))
668 result << de::floatToString(value.val.floatV[i], 2);
669 else if (glu::isDataTypeIntOrIVec((value.type)))
670 result << de::toString(value.val.intV[i]);
671 else if (glu::isDataTypeUintOrUVec((value.type)))
672 result << de::toString(value.val.uintV[i]);
673 else if (glu::isDataTypeBoolOrBVec((value.type)))
674 result << (value.val.boolV[i] ? "true" : "false");
675 else if (glu::isDataTypeSampler((value.type)))
676 result << value.val.samplerV.unit;
917 // UNIFORMFUNC_VALUE: use pass-by-value versions of uniform assignment funcs, e.g. glUniform1f(), where possible. If not given, use pass-by-pointer versions.
957 VarValue finalValue; //!< The value we ultimately want to set for this uniform.
1039 // Check that every uniform has the default (zero) value.
1041 // Assign the basicUniforms[].finalValue values for uniforms. \note rnd parameter is for booleans (true can be any nonzero value).
1073 void setupTexture (const VarValue& value);
1178 const VarValue value = m_features & FEATURE_UNIFORMVALUE_ZERO ? generateZeroVarValue(type)
1182 basicUniformsDst.push_back(BasicUniform(varName, varType.getBasicType(), isActive, value));
1204 const VarValue value = m_features & FEATURE_UNIFORMVALUE_ZERO ? generateZeroVarValue(elemBasicType)
1208 basicUniformsDst.push_back(BasicUniform(indexedName.c_str(), elemBasicType, isCurElemActive, value, arrayRootName.c_str(), elemNdx, size));
1390 void UniformCase::setupTexture (const VarValue& value)
1396 DE_ASSERT(getSamplerLookupReturnType(value.type) == glu::TYPE_FLOAT_VEC4);
1400 const tcu::Vec4 color = vec4FromPtr(&value.val.samplerV.fillColor.floatV[0]);
1402 if (value.type == glu::TYPE_SAMPLER_2D)
1411 GLU_CHECK_CALL(glActiveTexture(GL_TEXTURE0 + value.val.samplerV.unit));
1412 m_filledTextureUnits.push_back(value.val.samplerV.unit);
1419 else if (value.type == glu::TYPE_SAMPLER_CUBE)
1433 GLU_CHECK_CALL(glActiveTexture(GL_TEXTURE0 + value.val.samplerV.unit));
1434 m_filledTextureUnits.push_back(value.val.samplerV.unit);
1715 VarValue value;
1717 deMemset(&value, 0xcd, sizeof(value)); // Initialize to known garbage.
1721 value.type = glu::TYPE_INVALID;
1722 valuesDst.push_back(value);
1731 value.type = uniform.type;
1733 DE_STATIC_ASSERT(sizeof(GLint) == sizeof(value.val.intV[0]));
1734 DE_STATIC_ASSERT(sizeof(GLuint) == sizeof(value.val.uintV[0]));
1735 DE_STATIC_ASSERT(sizeof(GLfloat) == sizeof(value.val.floatV[0]));
1738 GLU_CHECK_CALL(glGetUniformfv(programGL, location, &value.val.floatV[0]));
1740 GLU_CHECK_CALL(glGetUniformiv(programGL, location, &value.val.intV[0]));
1742 GLU_CHECK_CALL(glGetUniformuiv(programGL, location, &value.val.uintV[0]));
1747 GLU_CHECK_CALL(glGetUniformiv(programGL, location, &value.val.intV[0]));
1749 value.val.boolV[i] = value.val.intV[i] != 0;
1753 GLU_CHECK_CALL(glGetUniformuiv(programGL, location, &value.val.uintV[0]));
1755 value.val.boolV[i] = value.val.uintV[i] != 0;
1759 GLU_CHECK_CALL(glGetUniformfv(programGL, location, &value.val.floatV[0]));
1761 value.val.boolV[i] = value.val.floatV[i] != 0.0f;
1768 value.val.samplerV.unit = unit;
1773 valuesDst.push_back(value);
1775 log << TestLog::Message << "// Got " << uniform.name << " value " << apiVarValueStr(value) << TestLog::EndMessage;
1806 log << TestLog::Message << "// FAILURE: uniform " << uniform.name << " has non-zero initial value" << TestLog::EndMessage; \
1824 log << TestLog::Message << "// FAILURE: uniform " << uniform.name << " has non-zero initial value" << TestLog::EndMessage;
1892 log << TestLog::Message << "// Using type " << glu::getDataTypeName(boolApiType) << " to set boolean value " << apiVarValueStr(unifValue) << " for " << curName << TestLog::EndMessage;
2057 log << TestLog::Message << "// FAILURE: value obtained with glGetUniform*() for uniform " << uniform.name << " differs from value set with glUniform*()" << TestLog::EndMessage;
2309 CHECKMETHOD_RENDER, //!< Check values by rendering with the value-checking shader.
2400 case ASSIGNMETHOD_VALUE: return "Assign values by-value";
2431 const ScopedLogSection section(log, "UniformAssign", "Uniform value assignments");
2442 const ScopedLogSection section(log, "GetUniforms", "Uniform value query");
2539 PERFORM_AND_CHECK(getUniforms(uniformDefaultValues, basicUniforms, programGL), "GetUniformDefaults", "Uniform default value query");
2549 const ScopedLogSection section(log, "UniformAssign", "Uniform value assignments");
2554 PERFORM_AND_CHECK(getUniforms(uniformValues, basicUniforms, programGL), "GetUniforms", "Uniform value query");
2730 TestCaseGroup* const valueGroup = new TestCaseGroup(m_context, "value", "Uniform value tests");