diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-23 00:02:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-23 00:02:33 +0200 |
commit | fe929d4787b2b11390891fb03da1dda78b18eb65 (patch) | |
tree | de748bb0f4cd015fb50d137c10653645769a8a29 /drivers | |
parent | 0c815022178ca23fa55085981384caa749f7f18a (diff) | |
parent | f649678402350a210cbb40e312be7b20592e85e0 (diff) |
Merge pull request #62513 from reduz/shader_preprocessor_remake
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles3/storage/material_storage.cpp | 7 | ||||
-rw-r--r-- | drivers/gles3/storage/material_storage.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index 8a8d79b3f7..ab92fe0d1a 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -2462,6 +2462,13 @@ void MaterialStorage::shader_set_code(RID p_shader, const String &p_code) { } } +void MaterialStorage::shader_set_path_hint(RID p_shader, const String &p_path) { + GLES3::Shader *shader = shader_owner.get_or_null(p_shader); + ERR_FAIL_COND(!shader); + + shader->path_hint = p_path; +} + String MaterialStorage::shader_get_code(RID p_shader) const { const GLES3::Shader *shader = shader_owner.get_or_null(p_shader); ERR_FAIL_COND_V(!shader, String()); diff --git a/drivers/gles3/storage/material_storage.h b/drivers/gles3/storage/material_storage.h index 6ad277c2b9..0e96541250 100644 --- a/drivers/gles3/storage/material_storage.h +++ b/drivers/gles3/storage/material_storage.h @@ -73,6 +73,7 @@ struct Material; struct Shader { ShaderData *data = nullptr; String code; + String path_hint; RS::ShaderMode mode; HashMap<StringName, HashMap<int, RID>> default_texture_parameter; HashSet<Material *> owners; @@ -542,6 +543,7 @@ public: virtual void shader_free(RID p_rid) override; virtual void shader_set_code(RID p_shader, const String &p_code) override; + virtual void shader_set_path_hint(RID p_shader, const String &p_path) override; virtual String shader_get_code(RID p_shader) const override; virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const override; |