mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 17:42:41 +08:00
[pipeline] refactor custom pipeline init (#14040)
This commit is contained in:
@@ -178,15 +178,7 @@ void ProgramLib::registerEffect(EffectAsset *effect) {
|
||||
auto *tmpl = define(shader);
|
||||
tmpl->effectName = effect->getName();
|
||||
}
|
||||
|
||||
for (auto &tech : effect->_techniques) {
|
||||
for (auto &pass : tech.passes) {
|
||||
// grab default property declaration if there is none
|
||||
if (pass.propertyIndex.has_value() && !pass.properties.has_value()) {
|
||||
pass.properties = tech.passes[pass.propertyIndex.value()].properties;
|
||||
}
|
||||
}
|
||||
}
|
||||
render::addEffectDefaultProperties(*effect);
|
||||
}
|
||||
|
||||
IProgramInfo *ProgramLib::define(IShaderInfo &shader) {
|
||||
@@ -362,7 +354,7 @@ IProgramInfo *ProgramLib::define(IShaderInfo &shader) {
|
||||
* @param name Target shader name
|
||||
*/
|
||||
|
||||
IProgramInfo *ProgramLib::getTemplate(const ccstd::string &name) {
|
||||
const IProgramInfo *ProgramLib::getTemplate(const ccstd::string &name) const {
|
||||
auto it = _templates.find(name);
|
||||
return it != _templates.end() ? &it->second : nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user