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

@ -147,7 +147,7 @@ RID MaterialStorage::shader_allocate() {
return shader_owner.allocate_rid();
}
void MaterialStorage::shader_initialize(RID p_rid) {
void MaterialStorage::shader_initialize(RID p_rid, bool p_embedded) {
shader_owner.initialize_rid(p_rid, DummyShader());
}

View File

@ -50,6 +50,7 @@ private:
mutable RID_Owner<DummyShader> shader_owner;
ShaderCompiler dummy_compiler;
HashSet<RID> dummy_embedded_set;
struct DummyMaterial {
RID shader;
@ -87,7 +88,7 @@ public:
bool owns_shader(RID p_rid) { return shader_owner.owns(p_rid); }
virtual RID shader_allocate() override;
virtual void shader_initialize(RID p_rid) override;
virtual void shader_initialize(RID p_rid, bool p_embedded) override;
virtual void shader_free(RID p_rid) override;
virtual void shader_set_code(RID p_shader, const String &p_code) override;
@ -101,6 +102,9 @@ public:
virtual Variant shader_get_parameter_default(RID p_material, const StringName &p_param) const override { return Variant(); }
virtual RS::ShaderNativeSourceCode shader_get_native_source_code(RID p_shader) const override { return RS::ShaderNativeSourceCode(); }
virtual void shader_embedded_set_lock() override {}
virtual const HashSet<RID> &shader_embedded_set_get() const override { return dummy_embedded_set; }
virtual void shader_embedded_set_unlock() override {}
/* MATERIAL API */