summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRedMser <redmser.jj2@gmail.com>2019-01-17 19:25:08 +0100
committerRedMser <redmser.jj2@gmail.com>2019-01-17 19:25:08 +0100
commita285a1cfdfd85d2be27c6d6a7895298f906865c2 (patch)
tree7f9c562bba574e1f9159ca2781679ae808a21ab6
parentf958ba5abcd7dfcde226c8780d0c3d1ce4ca336d (diff)
Fix shader compile error line numbers starting at 0.
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp2
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index f0a8ceb8c5..bff031b93a 100644
--- a/drivers/gles2/shader_compiler_gles2.cpp
+++ b/drivers/gles2/shader_compiler_gles2.cpp
@@ -737,7 +737,7 @@ Error ShaderCompilerGLES2::compile(VS::ShaderMode p_mode, const String &p_code,
Vector<String> shader = p_code.split("\n");
for (int i = 0; i < shader.size(); i++) {
- print_line(itos(i) + " " + shader[i]);
+ print_line(itos(i + 1) + " " + shader[i]);
}
_err_print_error(NULL, 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_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index 56446b33ff..cda6dac506 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -748,7 +748,7 @@ Error ShaderCompilerGLES3::compile(VS::ShaderMode p_mode, const String &p_code,
Vector<String> shader = p_code.split("\n");
for (int i = 0; i < shader.size(); i++) {
- print_line(itos(i) + " " + shader[i]);
+ print_line(itos(i + 1) + " " + shader[i]);
}
_err_print_error(NULL, p_path.utf8().get_data(), parser.get_error_line(), parser.get_error_text().utf8().get_data(), ERR_HANDLER_SHADER);