Merge pull request #86744 from Listwon/custom-shader-compilation-determinism

[3.x] Prevent shuffling custom shader functions (shader cache requires determinism)
This commit is contained in:
Rémi Verschelde
2024-02-07 09:40:36 +01:00
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;
};