Prevent shuffling custom shader functions (shader cache requires determinism)

This commit is contained in:
Bartłomiej T. Listwon
2024-01-03 12:03:56 +01:00
parent 4c4cb12e38
commit 73793ab89c
4 changed files with 16 additions and 14 deletions

View File

@ -3405,7 +3405,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
//add to current function as dependency
for (int j = 0; j < shader->functions.size(); j++) {
if (shader->functions[j].name == current_function) {
shader->functions.write[j].uses_function.insert(name);
shader->functions.write[j].uses_function.push_back(name);
break;
}
}

View File

@ -602,7 +602,7 @@ public:
struct Function {
StringName name;
FunctionNode *function;
Set<StringName> uses_function;
Vector<StringName> uses_function;
bool callable;
};