MCPcopy Create free account
hub / github.com/ImageEngine/cortex / shaderSetup

Method shaderSetup

src/IECoreGL/Primitive.cpp:340–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340const Shader::Setup *Primitive::shaderSetup( const Shader *shader, State *state ) const
341{
342 for( ShaderSetupVector::const_iterator it = m_shaderSetups.begin(), eIt = m_shaderSetups.end(); it != eIt; it++ )
343 {
344 if( (*it)->shader() == shader )
345 {
346 return it->get();
347 }
348 }
349
350 Shader::SetupPtr setup = new Shader::Setup( shader );
351 addPrimitiveVariablesToShaderSetup( setup.get() );
352
353 m_shaderSetups.push_back( setup );
354 return setup.get();
355}
356
357void Primitive::addPrimitiveVariablesToShaderSetup( Shader::Setup *shaderSetup, const std::string &vertexPrefix, GLuint vertexDivisor ) const
358{

Callers 4

testShaderAttributeMethod · 0.45
Primitive.cppFile · 0.45
renderMethod · 0.45
shaderSetupFunction · 0.45

Calls 4

shaderMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by 1

testShaderAttributeMethod · 0.36