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

Add shader baker to project exporter.

Metal Support contributed by Migeran (https://migeran.com) and Stuart Carnie.

Co-authored-by: Stuart Carnie <stuart.carnie@gmail.com>
Co-authored-by: Gergely Kis <gergely.kis@migeran.com>
This commit is contained in:
Dario
2025-01-13 16:13:39 -03:00
parent 99f5a3d665
commit 5a30a7e7cd
112 changed files with 5786 additions and 4203 deletions

View File

@@ -241,7 +241,15 @@ public:
#define ServerName RendererMaterialStorage
#define server_name RSG::material_storage
FUNCRIDSPLIT(shader)
virtual RID shader_create() override {
RID ret = RSG::material_storage->shader_allocate();
if (Thread::get_caller_id() == server_thread) {
RSG::material_storage->shader_initialize(ret, false);
} else {
command_queue.push(RSG::material_storage, &ServerName::shader_initialize, ret, false);
}
return ret;
}
virtual RID shader_create_from_code(const String &p_code, const String &p_path_hint = String()) override {
RID shader = RSG::material_storage->shader_allocate();
@@ -251,11 +259,11 @@ public:
command_queue.flush_if_pending();
}
RSG::material_storage->shader_initialize(shader);
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);
} else {
command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_initialize, shader);
command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_initialize, shader, false);
command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_code, shader, p_code);
command_queue.push(RSG::material_storage, &RendererMaterialStorage::shader_set_path_hint, shader, p_path_hint);
}