소스 검색

set shader path before compilation

Simon Döhl 1 주 전
부모
커밋
772caa8170
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      drivers/gles3/storage/material_storage.cpp
  2. 1 1
      servers/rendering/rendering_server_default.h

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