This commit is contained in:
Spartan322
2025-05-29 02:06:56 -04:00
474 changed files with 15946 additions and 7019 deletions

View File

@@ -243,7 +243,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();
@@ -253,11 +261,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);
}