Parcourir la source

Merge pull request #113432 from TheDying0fLight/set-shader-path-before-compiling

Set shader path before compilation
Rémi Verschelde il y a 1 semaine
Parent
commit
5f12ada7a4

+ 1 - 0
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);
 	}
 

+ 1 - 1
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);