| 338 | } |
| 339 | |
| 340 | const 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 | |
| 357 | void Primitive::addPrimitiveVariablesToShaderSetup( Shader::Setup *shaderSetup, const std::string &vertexPrefix, GLuint vertexDivisor ) const |
| 358 | { |