diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 15ff1f79b2e..6c4a77eb28e 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -987,7 +987,13 @@ Error ShaderCompilerGLES2::compile(VS::ShaderMode p_mode, const String &p_code, if (err != OK) { Vector shader = p_code.split("\n"); for (int i = 0; i < shader.size(); i++) { - print_line(itos(i + 1) + " " + shader[i]); + if (i + 1 == parser.get_error_line()) { + // Mark the error line to be visible without having to look at + // the trace at the end. + print_line(vformat("E%4d-> %s", i + 1, shader[i])); + } else { + print_line(vformat("%5d | %s", i + 1, shader[i])); + } } _err_print_error(nullptr, p_path.utf8().get_data(), parser.get_error_line(), parser.get_error_text().utf8().get_data(), ERR_HANDLER_SHADER); diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp index 6e97654f0ef..845a1d5e0bc 100644 --- a/drivers/gles2/shader_gles2.cpp +++ b/drivers/gles2/shader_gles2.cpp @@ -119,7 +119,7 @@ static void _display_error_with_code(const String &p_error, const Vector lines = String(total_code).split("\n"); for (int j = 0; j < lines.size(); j++) { - print_line(itos(line) + ": " + lines[j]); + print_line(vformat("%4d | %s", line, lines[j])); line++; } diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 0fad0e2f0de..adb2fe25f08 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -1031,7 +1031,13 @@ Error ShaderCompilerGLES3::compile(VS::ShaderMode p_mode, const String &p_code, if (err != OK) { Vector shader = p_code.split("\n"); for (int i = 0; i < shader.size(); i++) { - print_line(itos(i + 1) + " " + shader[i]); + if (i + 1 == parser.get_error_line()) { + // Mark the error line to be visible without having to look at + // the trace at the end. + print_line(vformat("E%4d-> %s", i + 1, shader[i])); + } else { + print_line(vformat("%5d | %s", i + 1, shader[i])); + } } _err_print_error(nullptr, p_path.utf8().get_data(), parser.get_error_line(), parser.get_error_text().utf8().get_data(), ERR_HANDLER_SHADER); diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp index 83f3c1718cf..af03b0b6a02 100644 --- a/drivers/gles3/shader_gles3.cpp +++ b/drivers/gles3/shader_gles3.cpp @@ -149,7 +149,7 @@ static void _display_error_with_code(const String &p_error, const Vector lines = String(total_code).split("\n"); for (int j = 0; j < lines.size(); j++) { - print_line(itos(line) + ": " + lines[j]); + print_line(vformat("%4d | %s", line, lines[j])); line++; }