From 1472fca9513b4d107337a876939b193864bd3ca3 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Wed, 2 Oct 2019 10:50:22 +0300 Subject: [PATCH] Removed unnecessary shader error log messages --- drivers/gles2/rasterizer_storage_gles2.cpp | 5 +++-- drivers/gles3/rasterizer_storage_gles3.cpp | 5 +++-- editor/plugins/shader_editor_plugin.cpp | 4 +--- servers/visual/shader_language.cpp | 4 +--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 1584295b4c5..e09e34e2e4d 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1482,8 +1482,9 @@ void RasterizerStorageGLES2::_update_shader(Shader *p_shader) const { } Error err = shaders.compiler.compile(p_shader->mode, p_shader->code, actions, p_shader->path, gen_code); - - ERR_FAIL_COND(err != OK); + if (err != OK) { + return; + } p_shader->shader->set_custom_shader_code(p_shader->custom_code_id, gen_code.vertex, gen_code.vertex_global, gen_code.fragment, gen_code.light, gen_code.fragment_global, gen_code.uniforms, gen_code.texture_uniforms, gen_code.custom_defines); diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index a29831e3f56..95be67a5b7b 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2168,8 +2168,9 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const { } Error err = shaders.compiler.compile(p_shader->mode, p_shader->code, actions, p_shader->path, gen_code); - - ERR_FAIL_COND(err != OK); + if (err != OK) { + return; + } p_shader->shader->set_custom_shader_code(p_shader->custom_code_id, gen_code.vertex, gen_code.vertex_global, gen_code.fragment, gen_code.light, gen_code.fragment_global, gen_code.uniforms, gen_code.texture_uniforms, gen_code.defines); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index df3e23a9e94..791fd4a4be3 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -198,9 +198,7 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, Listget_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip); - if (err != OK) - ERR_PRINT("Shaderlang complete failed"); + sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip); if (calltip != "") { get_text_edit()->set_code_hint(calltip); diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 1b9c3e2effc..3b549afb026 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -5348,9 +5348,7 @@ Error ShaderLanguage::complete(const String &p_code, const Map(); - Error err = _parse_shader(p_functions, p_render_modes, p_shader_types); - if (err != OK) - ERR_PRINT("Failed to parse shader"); + _parse_shader(p_functions, p_render_modes, p_shader_types); switch (completion_type) {