MCPcopy Create free account
hub / github.com/Kitware/VTK / FindUniform

Method FindUniform

Rendering/OpenGL2/vtkShaderProgram.cxx:1086–1107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1084}
1085
1086int vtkShaderProgram::FindUniform(const char* cname)
1087{
1088 if (cname == nullptr || !this->Linked)
1089 {
1090 return -1;
1091 }
1092
1093 GLint loc = -1;
1094
1095 IterT iter = this->UniformLocs.find(cname);
1096 if (iter == this->UniformLocs.end())
1097 {
1098 loc = static_cast<int>(glGetUniformLocation(static_cast<GLuint>(Handle), (const GLchar*)cname));
1099 const char* allocStr = strdup(cname);
1100 this->UniformLocs.insert(std::make_pair(allocStr, static_cast<int>(loc)));
1101 }
1102 else
1103 {
1104 loc = iter->second;
1105 }
1106 return loc;
1107}
1108
1109bool vtkShaderProgram::IsUniformUsed(const char* cname)
1110{

Callers 15

SetUniformiMethod · 0.95
SetUniformfMethod · 0.95
SetUniformMatrixMethod · 0.95
SetUniformMatrix3x3Method · 0.95
SetUniformMatrix4x4vMethod · 0.95
SetUniform1fvMethod · 0.95
SetUniform1ivMethod · 0.95
SetUniform3fvMethod · 0.95
SetUniform4fvMethod · 0.95
SetUniform2fMethod · 0.95
SetUniform2fvMethod · 0.95
SetUniform3fMethod · 0.95

Calls 4

strdupFunction · 0.85
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected