| 2213 | } |
| 2214 | |
| 2215 | static GpuProgramPtr getProgram(ScriptCompiler* compiler, ObjectAbstractNode* node) |
| 2216 | { |
| 2217 | if(node->name.empty()) |
| 2218 | { |
| 2219 | compiler->addError(ScriptCompiler::CE_OBJECTNAMEEXPECTED, node->file, node->line); |
| 2220 | return nullptr; |
| 2221 | } |
| 2222 | |
| 2223 | ProcessResourceNameScriptCompilerEvent evt(ProcessResourceNameScriptCompilerEvent::GPU_PROGRAM, node->name); |
| 2224 | compiler->_fireEvent(&evt, 0); |
| 2225 | |
| 2226 | auto& mgr = GpuProgramManager::getSingleton(); |
| 2227 | if (auto ret = mgr.getByName(evt.mName, compiler->getResourceGroup())) |
| 2228 | return ret; |
| 2229 | |
| 2230 | // recheck with auto resource group |
| 2231 | if (auto ret = mgr.getByName(evt.mName, RGN_AUTODETECT)) |
| 2232 | return ret; |
| 2233 | |
| 2234 | compiler->addError(ScriptCompiler::CE_REFERENCETOANONEXISTINGOBJECT, node->file, node->line, |
| 2235 | evt.mName); |
| 2236 | return nullptr; |
| 2237 | } |
| 2238 | |
| 2239 | //------------------------------------------------------------------------- |
| 2240 | void PassTranslator::translateProgramRef(GpuProgramType type, ScriptCompiler *compiler, ObjectAbstractNode *node) |
no test coverage detected