diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index f60c30ce761..138a6c45193 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -2281,6 +2281,7 @@ void MaterialStorage::shader_set_code(RID p_shader, const String &p_code) { } if (shader->data) { + shader->data->set_path_hint(shader->path_hint); shader->data->set_code(p_code); } diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index e9ac6098ec6..f65f6011691 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -263,8 +263,8 @@ public: } RSG::material_storage->shader_initialize(shader, false); - RSG::material_storage->shader_set_code(shader, p_code); RSG::material_storage->shader_set_path_hint(shader, p_path_hint); + RSG::material_storage->shader_set_code(shader, p_code); } else { command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_initialize, shader, false); command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_code, shader, p_code);