diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-01-03 17:43:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 17:43:05 +0100 |
commit | de066d56a2304b51d8a36e175c565bb7f7f1b11b (patch) | |
tree | 4796f639af298ce3744bee4e478aa6347a37f9e1 /servers/rendering/shader_language.h | |
parent | 1032c2c434ec882905b1ab2426d8ce3043dd6958 (diff) | |
parent | fd9c92d4ab32a908a69f6f7fadf65d77c43a6b54 (diff) | |
download | redot-engine-de066d56a2304b51d8a36e175c565bb7f7f1b11b.tar.gz |
Merge pull request #56153 from Chaosus/shader_uniform_limit_warning
Add a shader warning when the uniform buffer limit is exceeded
Diffstat (limited to 'servers/rendering/shader_language.h')
-rw-r--r-- | servers/rendering/shader_language.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index 72d4951a35..bf3c601aea 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -787,7 +787,7 @@ public: static bool is_sampler_type(DataType p_type); static Variant constant_value_to_variant(const Vector<ShaderLanguage::ConstantNode::Value> &p_value, DataType p_type, int p_array_size, ShaderLanguage::ShaderNode::Uniform::Hint p_hint = ShaderLanguage::ShaderNode::Uniform::HINT_NONE); static PropertyInfo uniform_to_property_info(const ShaderNode::Uniform &p_uniform); - static uint32_t get_type_size(DataType p_type); + static uint32_t get_datatype_size(DataType p_type); static void get_keyword_list(List<String> *r_keywords); static bool is_control_flow_keyword(String p_keyword); @@ -919,11 +919,14 @@ private: bool check_warnings = false; uint32_t warning_flags; - void _add_line_warning(ShaderWarning::Code p_code, const StringName &p_subject = "") { - warnings.push_back(ShaderWarning(p_code, tk_line, p_subject)); + void _add_line_warning(ShaderWarning::Code p_code, const StringName &p_subject = "", const Vector<Variant> &p_extra_args = Vector<Variant>()) { + warnings.push_back(ShaderWarning(p_code, tk_line, p_subject, p_extra_args)); } - void _add_warning(ShaderWarning::Code p_code, int p_line, const StringName &p_subject = "") { - warnings.push_back(ShaderWarning(p_code, p_line, p_subject)); + void _add_global_warning(ShaderWarning::Code p_code, const StringName &p_subject = "", const Vector<Variant> &p_extra_args = Vector<Variant>()) { + warnings.push_back(ShaderWarning(p_code, -1, p_subject, p_extra_args)); + } + void _add_warning(ShaderWarning::Code p_code, int p_line, const StringName &p_subject = "", const Vector<Variant> &p_extra_args = Vector<Variant>()) { + warnings.push_back(ShaderWarning(p_code, p_line, p_subject, p_extra_args)); } void _check_warning_accums(); #endif // DEBUG_ENABLED |