1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Initialize shader placeholders up front

Then use the placeholder to create the shader instead of swapping RIDs
This fixes a false positive that reported leaked shaders
This commit is contained in:
clayjohn
2023-08-03 16:13:33 +02:00
parent 237bd0a615
commit 558f4b7559
2 changed files with 34 additions and 30 deletions

View File

@@ -161,7 +161,7 @@ void ShaderRD::_clear_version(Version *p_version) {
// Clear versions if they exist.
if (p_version->variants) {
for (int i = 0; i < variant_defines.size(); i++) {
if (variants_enabled[i] && group_enabled[variant_defines[i].group]) {
if (p_version->variants[i].is_valid()) {
RD::get_singleton()->free(p_version->variants[i]);
}
}