-------------------------------------------------------------------------
| 2992 | } |
| 2993 | //------------------------------------------------------------------------- |
| 2994 | void PassTranslator::translateVertexProgramRef(ScriptCompiler *compiler, ObjectAbstractNode *node) |
| 2995 | { |
| 2996 | if(node->name.empty()) |
| 2997 | { |
| 2998 | compiler->addError(ScriptCompiler::CE_OBJECTNAMEEXPECTED, node->file, node->line); |
| 2999 | return; |
| 3000 | } |
| 3001 | |
| 3002 | ProcessResourceNameScriptCompilerEvent evt(ProcessResourceNameScriptCompilerEvent::GPU_PROGRAM, node->name); |
| 3003 | compiler->_fireEvent(&evt, 0); |
| 3004 | |
| 3005 | if (!GpuProgramManager::getSingleton().getByName(evt.mName)) |
| 3006 | { |
| 3007 | compiler->addError(ScriptCompiler::CE_REFERENCETOANONEXISTINGOBJECT, node->file, node->line); |
| 3008 | return; |
| 3009 | } |
| 3010 | |
| 3011 | Pass *pass = any_cast<Pass*>(node->parent->context); |
| 3012 | pass->setVertexProgram(evt.mName); |
| 3013 | if(pass->getVertexProgram()->isSupported()) |
| 3014 | { |
| 3015 | GpuProgramParametersSharedPtr params = pass->getVertexProgramParameters(); |
| 3016 | GpuProgramTranslator::translateProgramParameters(compiler, params, node); |
| 3017 | } |
| 3018 | } |
| 3019 | //------------------------------------------------------------------------- |
| 3020 | void PassTranslator::translateGeometryProgramRef(ScriptCompiler *compiler, ObjectAbstractNode *node) |
| 3021 | { |
nothing calls this directly
no test coverage detected