public void AttachChildShader( string name )
{
// is the name valid and already loaded?
// check with the high level program manager to see if it was loaded
var hlProgram = (HighLevelGpuProgram)HighLevelGpuProgramManager.Instance.GetByName( name );
if ( hlProgram != null )
{
if ( hlProgram.SyntaxCode == "glsl" )
{
// make sure attached program source gets loaded and compiled
// don't need a low level implementation for attached shader objects
// loadHighLevelImpl will only load the source and compile once
// so don't worry about calling it several times
var childShader = (GLSLProgram)hlProgram;
// load the source and attach the child shader only if supported
if ( IsSupported )
{
childShader.LoadHighLevelImpl();
// add to the constainer
attachedGLSLPrograms.Add( childShader );
AttachedShaderNames += name + " ";
}
}
}
}