-------------------------------------------------------------------------
| 3096 | } |
| 3097 | //------------------------------------------------------------------------- |
| 3098 | void PassTranslator::translateComputeProgramRef(ScriptCompiler *compiler, ObjectAbstractNode *node) |
| 3099 | { |
| 3100 | if(node->name.empty()) |
| 3101 | { |
| 3102 | compiler->addError(ScriptCompiler::CE_OBJECTNAMEEXPECTED, node->file, node->line); |
| 3103 | return; |
| 3104 | } |
| 3105 | |
| 3106 | ProcessResourceNameScriptCompilerEvent evt(ProcessResourceNameScriptCompilerEvent::GPU_PROGRAM, node->name); |
| 3107 | compiler->_fireEvent(&evt, 0); |
| 3108 | |
| 3109 | if (!GpuProgramManager::getSingleton().getByName(evt.mName)) |
| 3110 | { |
| 3111 | compiler->addError(ScriptCompiler::CE_REFERENCETOANONEXISTINGOBJECT, node->file, node->line); |
| 3112 | return; |
| 3113 | } |
| 3114 | |
| 3115 | Pass *pass = any_cast<Pass*>(node->parent->context); |
| 3116 | pass->setComputeProgram(evt.mName); |
| 3117 | if(pass->getComputeProgram()->isSupported()) |
| 3118 | { |
| 3119 | GpuProgramParametersSharedPtr params = pass->getComputeProgramParameters(); |
| 3120 | GpuProgramTranslator::translateProgramParameters(compiler, params, node); |
| 3121 | } |
| 3122 | } |
| 3123 | //------------------------------------------------------------------------- |
| 3124 | void PassTranslator::translateShadowCasterVertexProgramRef(ScriptCompiler *compiler, ObjectAbstractNode *node) |
| 3125 | { |
nothing calls this directly
no test coverage detected