mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Merge commit godotengine/godot@de37627404
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user