Lines Matching defs:value

572 static string shaderVarValueStr (const VarValue& value)
574 const int numElems = glu::getDataTypeScalarSize(value.type);
578 result << glu::getDataTypeName(value.type) << "(";
585 if (glu::isDataTypeFloatOrVec(value.type) || glu::isDataTypeMatrix(value.type))
586 result << de::floatToString(value.val.floatV[i], 2);
587 else if (glu::isDataTypeIntOrIVec((value.type)))
588 result << de::toString(value.val.intV[i]);
589 else if (glu::isDataTypeUintOrUVec((value.type)))
590 result << de::toString(value.val.uintV[i]) << "u";
591 else if (glu::isDataTypeBoolOrBVec((value.type)))
592 result << (value.val.boolV[i] ? "true" : "false");
593 else if (glu::isDataTypeSampler((value.type)))
594 result << shaderVarValueStr(getSamplerFillValue(value));
605 static string apiVarValueStr (const VarValue& value)
607 const int numElems = glu::getDataTypeScalarSize(value.type);
618 if (glu::isDataTypeFloatOrVec(value.type) || glu::isDataTypeMatrix(value.type))
619 result << de::floatToString(value.val.floatV[i], 2);
620 else if (glu::isDataTypeIntOrIVec((value.type)))
621 result << de::toString(value.val.intV[i]);
622 else if (glu::isDataTypeUintOrUVec((value.type)))
623 result << de::toString(value.val.uintV[i]);
624 else if (glu::isDataTypeBoolOrBVec((value.type)))
625 result << (value.val.boolV[i] ? "true" : "false");
626 else if (glu::isDataTypeSampler((value.type)))
627 result << value.val.samplerV.unit;
811 // UNIFORMFUNC_VALUE: use pass-by-value versions of uniform assignment funcs, e.g. glProgramUniform1f(), where possible. If not given, use pass-by-pointer versions.
847 VarValue finalValue; //!< The value we ultimately want to set for this uniform.
899 // Assign the basicUniforms[].finalValue values for uniforms. \note rnd parameter is for booleans (true can be any nonzero value).
929 void setupTexture (const VarValue& value);
996 const VarValue value = glu::isDataTypeSampler(type) ? generateRandomVarValue(type, rnd, samplerUnitCounter++)
999 basicUniformsDst.push_back(BasicUniform(varName, varType.getBasicType(), isActive, value));
1021 const VarValue value = glu::isDataTypeSampler(elemBasicType) ? generateRandomVarValue(elemBasicType, rnd, samplerUnitCounter++)
1024 basicUniformsDst.push_back(BasicUniform(indexedName.c_str(), elemBasicType, isCurElemActive, value, arrayRootName.c_str(), elemNdx, size));
1206 void UniformCase::setupTexture (const VarValue& value)
1212 DE_ASSERT(getSamplerLookupReturnType(value.type) == glu::TYPE_FLOAT_VEC4);
1216 const tcu::Vec4 color = vec4FromPtr(&value.val.samplerV.fillColor.floatV[0]);
1218 if (value.type == glu::TYPE_SAMPLER_2D)
1227 GLU_CHECK_CALL(glActiveTexture(GL_TEXTURE0 + value.val.samplerV.unit));
1228 m_filledTextureUnits.push_back(value.val.samplerV.unit);
1235 else if (value.type == glu::TYPE_SAMPLER_CUBE)
1248 GLU_CHECK_CALL(glActiveTexture(GL_TEXTURE0 + value.val.samplerV.unit));
1249 m_filledTextureUnits.push_back(value.val.samplerV.unit);
1274 VarValue value;
1276 deMemset(&value, 0xcd, sizeof(value)); // Initialize to known garbage.
1280 value.type = glu::TYPE_INVALID;
1281 valuesDst.push_back(value);
1290 value.type = uniform.type;
1292 DE_STATIC_ASSERT(sizeof(GLint) == sizeof(value.val.intV[0]));
1293 DE_STATIC_ASSERT(sizeof(GLuint) == sizeof(value.val.uintV[0]));
1294 DE_STATIC_ASSERT(sizeof(GLfloat) == sizeof(value.val.floatV[0]));
1297 GLU_CHECK_CALL(glGetUniformfv(programGL, location, &value.val.floatV[0]));
1299 GLU_CHECK_CALL(glGetUniformiv(programGL, location, &value.val.intV[0]));
1301 GLU_CHECK_CALL(glGetUniformuiv(programGL, location, &value.val.uintV[0]));
1306 GLU_CHECK_CALL(glGetUniformiv(programGL, location, &value.val.intV[0]));
1308 value.val.boolV[i] = value.val.intV[i] != 0;
1312 GLU_CHECK_CALL(glGetUniformuiv(programGL, location, &value.val.uintV[0]));
1314 value.val.boolV[i] = value.val.uintV[i] != 0;
1318 GLU_CHECK_CALL(glGetUniformfv(programGL, location, &value.val.floatV[0]));
1320 value.val.boolV[i] = value.val.floatV[i] != 0.0f;
1327 value.val.samplerV.unit = unit;
1332 valuesDst.push_back(value);
1334 log << TestLog::Message << "// Got " << uniform.name << " value " << apiVarValueStr(value) << TestLog::EndMessage;
1395 log << TestLog::Message << "// Using type " << glu::getDataTypeName(boolApiType) << " to set boolean value " << apiVarValueStr(unifValue) << " for " << curName << TestLog::EndMessage;
1560 log << TestLog::Message << "// FAILURE: value obtained with glGetUniform*() for uniform " << uniform.name << " differs from value set with glProgramUniform*()" << TestLog::EndMessage;
1702 CHECKMETHOD_RENDER, //!< Check values by rendering with the value-checking shader.
1769 case ASSIGNMETHOD_VALUE: return "Assign values by-value";
1797 const ScopedLogSection section(log, "UniformAssign", "Uniform value assignments");
1806 const ScopedLogSection section(log, "GetUniforms", "Uniform value query");
1932 // Basic by-pointer or by-value uniform assignment cases.